Browse Source

iOS 12 - Swift 4.2 - XCode 10 - Realm

Marino Faggiana 6 years ago
parent
commit
581864be66
49 changed files with 58994 additions and 1079 deletions
  1. 14782 0
      Libraries external/Realm/Realm.framework/402D8A9F-892F-3C5E-9154-6A540B74D63C.bcsymbolmap
  2. 36 0
      Libraries external/Realm/Realm.framework/CHANGELOG.md
  3. 13687 0
      Libraries external/Realm/Realm.framework/D681F990-5480-3415-9F1A-940504AE6826.bcsymbolmap
  4. 14 0
      Libraries external/Realm/Realm.framework/Headers/RLMSyncConfiguration.h
  5. 25 0
      Libraries external/Realm/Realm.framework/Headers/RLMSyncManager.h
  6. 46 2
      Libraries external/Realm/Realm.framework/Headers/RLMSyncSession.h
  7. 58 1
      Libraries external/Realm/Realm.framework/Headers/RLMSyncSubscription.h
  8. 8 0
      Libraries external/Realm/Realm.framework/Headers/RLMSyncUser.h
  9. BIN
      Libraries external/Realm/Realm.framework/Info.plist
  10. 2 1
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSyncConfiguration_Private.h
  11. BIN
      Libraries external/Realm/Realm.framework/Realm
  12. 0 494
      Libraries external/Realm/RealmSwift.framework/0A85D1C9-A4CC-36AF-8CCA-4A34B492531A.bcsymbolmap
  13. 14782 0
      Libraries external/Realm/RealmSwift.framework/402D8A9F-892F-3C5E-9154-6A540B74D63C.bcsymbolmap
  14. 894 0
      Libraries external/Realm/RealmSwift.framework/5C573639-1261-3D04-A749-BD077CE893DF.bcsymbolmap
  15. 889 0
      Libraries external/Realm/RealmSwift.framework/CC1F1DA4-4D64-3ED7-B9CC-C4E9B9DED5B8.bcsymbolmap
  16. 13687 0
      Libraries external/Realm/RealmSwift.framework/D681F990-5480-3415-9F1A-940504AE6826.bcsymbolmap
  17. 0 494
      Libraries external/Realm/RealmSwift.framework/F141265C-71B9-3F69-9ED6-18AB64CAB929.bcsymbolmap
  18. 8 8
      Libraries external/Realm/RealmSwift.framework/Headers/RealmSwift-Swift.h
  19. BIN
      Libraries external/Realm/RealmSwift.framework/Info.plist
  20. BIN
      Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/arm.swiftdoc
  21. BIN
      Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/arm.swiftmodule
  22. BIN
      Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/arm64.swiftdoc
  23. BIN
      Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/arm64.swiftmodule
  24. BIN
      Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/i386.swiftdoc
  25. BIN
      Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/i386.swiftmodule
  26. BIN
      Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftdoc
  27. BIN
      Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftmodule
  28. 2 2
      Libraries external/Realm/RealmSwift.framework/Modules/module.modulemap
  29. BIN
      Libraries external/Realm/RealmSwift.framework/RealmSwift
  30. 12 14
      Nextcloud.xcodeproj/project.pbxproj
  31. 2 3
      Share/CCloadItemData.swift
  32. 2 2
      iOSClient/Actions/CCActions.swift
  33. 18 18
      iOSClient/Create/CCCreateCloud.swift
  34. 1 1
      iOSClient/Library/SwiftWebVC/SwiftModalWebVC.swift
  35. 8 8
      iOSClient/Library/SwiftWebVC/SwiftWebVC.swift
  36. 2 2
      iOSClient/Library/SwiftWebVC/SwiftWebVCActivity.swift
  37. 1 1
      iOSClient/Main/CCMore.swift
  38. 7 7
      iOSClient/Main/NCMainCommon.swift
  39. 2 2
      iOSClient/Networking/NCService.swift
  40. 2 2
      iOSClient/Notification/CCNotification.swift
  41. 2 2
      iOSClient/Scan/ScanCollectionView.swift
  42. 1 1
      iOSClient/Scan/WeScan/Common/QuadrilateralView.swift
  43. 1 1
      iOSClient/Scan/WeScan/Extensions/CGPoint+Utils.swift
  44. 1 1
      iOSClient/Scan/WeScan/ImageScannerController.swift
  45. 2 2
      iOSClient/Scan/WeScan/Scan/CloseButton.swift
  46. 2 2
      iOSClient/Scan/WeScan/Scan/ScannerViewController.swift
  47. 2 2
      iOSClient/Scan/WeScan/Scan/ShutterButton.swift
  48. 2 2
      iOSClient/Settings/NCManageAutoUploadFileName.swift
  49. 4 4
      iOSClient/Text/NCText.swift

File diff suppressed because it is too large
+ 14782 - 0
Libraries external/Realm/Realm.framework/402D8A9F-892F-3C5E-9154-6A540B74D63C.bcsymbolmap


+ 36 - 0
Libraries external/Realm/Realm.framework/CHANGELOG.md

@@ -1,3 +1,39 @@
+3.9.0 Release notes (2018-09-10)
+=============================================================
+
+### Enhancements
+
+* Expose RLMSyncUser.refreshToken publicly so that it can be used for custom
+  HTTP requests to Realm Object Server.
+* Add RLMSyncSession.connectionState, which reports whether the session is
+  currently connected to the Realm Object Server or if it is offline.
+* Add `-suspend` and `-resume` methods to `RLMSyncSession` to enable manually
+  pausing data synchronization.
+* Add support for limiting the number of objects matched by a query-based sync
+  subscription. This requires a server running ROS 3.10.1 or newer.
+
+### Bugfixes
+
+* Fix crash when getting the description of a `MigrationObject` which has
+  `List` properties.
+* Fix crash when calling `dynamicList()` on a `MigrationObject`.
+
+3.8.0 Release notes (2018-09-05)
+=============================================================
+
+### Enhancements
+
+* Remove some old and no longer applicable migration logic which created an
+  unencrypted file in the sync metadata directory containing a list of ROS URLs
+  connected to.
+* Add support for pinning SSL certificates used for https and realms
+  connections by setting `RLMSyncManager.sharedManager.pinnedCertificatePaths`
+  in obj-c and `SyncManager.shared.pinnedCertificatePaths` in Swift.
+
+### Bugfixes
+
+* Fix warnings when building Realm as a static framework with CocoaPods.
+
 3.7.6 Release notes (2018-08-08)
 =============================================================
 

File diff suppressed because it is too large
+ 13687 - 0
Libraries external/Realm/Realm.framework/D681F990-5480-3415-9F1A-940504AE6826.bcsymbolmap


+ 14 - 0
Libraries external/Realm/Realm.framework/Headers/RLMSyncConfiguration.h

@@ -39,6 +39,20 @@ NS_ASSUME_NONNULL_BEGIN
  */
 @property (nonatomic, readonly) NSURL *realmURL;
 
+/**
+ A local path to a file containing the trust anchors for SSL connections.
+
+ Only the certificates stored in the PEM file (or any certificates signed by it,
+ if the file contains a CA cert) will be accepted when initiating a connection
+ to a server. This prevents certain certain kinds of man-in-the-middle (MITM)
+ attacks, and can also be used to trust a self-signed certificate which would
+ otherwise be untrusted.
+
+ On macOS, the file may be in any of the formats supported by SecItemImport(),
+ including PEM and .cer (see SecExternalFormat for a complete list of possible
+ formats). On iOS and other platforms, only DER .cer files are supported.
+ */
+@property (nonatomic, nullable) NSURL *pinnedCertificateURL;
 
 /**
  Whether SSL certificate validation is enabled for the connection associated

+ 25 - 0
Libraries external/Realm/Realm.framework/Headers/RLMSyncManager.h

@@ -103,6 +103,31 @@ typedef void(^RLMSyncErrorReportingBlock)(NSError *, RLMSyncSession * _Nullable)
  */
 @property (nullable, nonatomic, copy) NSDictionary<NSString *, NSString *> *customRequestHeaders;
 
+/**
+ A map of hostname to file URL for pinned certificates to use for HTTPS requests.
+
+ When initiating a HTTPS connection to a server, if this dictionary contains an
+ entry for the server's hostname, only the certificates stored in the file (or
+ any certificates signed by it, if the file contains a CA cert) will be accepted
+ when initiating a connection to a server. This prevents certain certain kinds
+ of man-in-the-middle (MITM) attacks, and can also be used to trust a self-signed
+ certificate which would otherwise be untrusted.
+
+ On macOS, the certificate files may be in any of the formats supported by
+ SecItemImport(), including PEM and .cer (see SecExternalFormat for a complete
+ list of possible formats). On iOS and other platforms, only DER .cer files are
+ supported.
+
+ For example, to pin example.com to a .cer file included in your bundle:
+
+ <pre>
+ RLMSyncManager.sharedManager.pinnedCertificatePaths = @{
+    @"example.com": [NSBundle.mainBundle pathForResource:@"example.com" ofType:@"cer"]
+ };
+ </pre>
+ */
+@property (nullable, nonatomic, copy) NSDictionary<NSString *, NSURL *> *pinnedCertificatePaths;
+
 /// The sole instance of the singleton.
 + (instancetype)sharedManager NS_REFINED_FOR_SWIFT;
 

+ 46 - 2
Libraries external/Realm/Realm.framework/Headers/RLMSyncSession.h

@@ -24,14 +24,33 @@
  The current state of the session represented by a session object.
  */
 typedef NS_ENUM(NSUInteger, RLMSyncSessionState) {
-    /// The sync session is bound to the Realm Object Server and communicating with it.
+    /// The sync session is actively communicating or attempting to communicate
+    /// with the Realm Object Server. A session is considered Active even if
+    /// it is not currently connected. Check the connection state instead if you
+    /// wish to know if the connection is currently online.
     RLMSyncSessionStateActive,
-    /// The sync session is not currently communicating with the Realm Object Server.
+    /// The sync session is not attempting to communicate with the Realm Object
+    /// Server, due to the user logging out or synchronization being paused.
     RLMSyncSessionStateInactive,
     /// The sync session encountered a fatal error and is permanently invalid; it should be discarded.
     RLMSyncSessionStateInvalid
 };
 
+/**
+ The current state of a sync session's connection. Sessions which are not in
+ the Active state will always be Disconnected.
+ */
+typedef NS_ENUM(NSUInteger, RLMSyncConnectionState) {
+    /// The sync session is not connected to the server, and is not attempting
+    /// to connect, either because the session is inactive or because it is
+    /// waiting to retry after a failed connection.
+    RLMSyncConnectionStateDisconnected,
+    /// The sync session is attempting to connect to the Realm Object Server.
+    RLMSyncConnectionStateConnecting,
+    /// The sync session is currently connected to the Realm Object Server.
+    RLMSyncConnectionStateConnected,
+};
+
 /**
  The transfer direction (upload or download) tracked by a given progress notification block.
 
@@ -105,8 +124,17 @@ NS_ASSUME_NONNULL_BEGIN
 @interface RLMSyncSession : NSObject
 
 /// The session's current state.
+///
+/// This property is not KVO-compliant.
 @property (nonatomic, readonly) RLMSyncSessionState state;
 
+/// The session's current connection state.
+///
+/// This property is KVO-compliant and can be observed to be notified of changes.
+/// Be warned that KVO observers for this property may be called on a background
+/// thread.
+@property (atomic, readonly) RLMSyncConnectionState connectionState;
+
 /// The Realm Object Server URL of the remote Realm this session corresponds to.
 @property (nullable, nonatomic, readonly) NSURL *realmURL;
 
@@ -119,6 +147,22 @@ NS_ASSUME_NONNULL_BEGIN
  */
 - (nullable RLMSyncConfiguration *)configuration;
 
+/**
+ Temporarily suspend syncronization and disconnect from the server.
+
+ The session will not attempt to connect to Realm Object Server until `resume`
+ is called or the Realm file is closed and re-opened.
+ */
+- (void)suspend;
+
+/**
+ Resume syncronization and reconnect to Realm Object Server after suspending.
+
+ This is a no-op if the session was already active or if the session is invalid.
+ Newly created sessions begin in the Active state and do not need to be resumed.
+ */
+- (void)resume;
+
 /**
  Register a progress notification block.
 

+ 58 - 1
Libraries external/Realm/Realm.framework/Headers/RLMSyncSubscription.h

@@ -115,6 +115,14 @@ typedef NS_ENUM(NSInteger, RLMSyncSubscriptionState) {
 /**
  Subscribe to the query represented by this `RLMResults`.
 
+ Subscribing to a query asks the server to synchronize all objects to the
+ client which match the query, along with all objects which are reachable
+ from those objects via links. This happens asynchronously, and the local
+ client Realm may not immediately have all objects which match the query.
+ Observe the `state` property of the returned subscription object to be
+ notified of when the subscription has been processed by the server and
+ all objects matching the query are available.
+
  The subscription will not be explicitly named.
 
  @return The subscription
@@ -126,13 +134,62 @@ typedef NS_ENUM(NSInteger, RLMSyncSubscriptionState) {
 /**
  Subscribe to the query represented by this `RLMResults`.
 
+ Subscribing to a query asks the server to synchronize all objects to the
+ client which match the query, along with all objects which are reachable
+ from those objects via links. This happens asynchronously, and the local
+ client Realm may not immediately have all objects which match the query.
+ Observe the `state` property of the returned subscription object to be
+ notified of when the subscription has been processed by the server and
+ all objects matching the query are available.
+
+ Creating a new subscription with the same name and query as an existing
+ subscription will not create a new subscription, but instead will return
+ an object referring to the existing sync subscription. This means that
+ performing the same subscription twice followed by removing it once will
+ result in no subscription existing.
+
  @param subscriptionName The name of the subscription
 
  @return The subscription
 
  @see RLMSyncSubscription
 */
-- (RLMSyncSubscription *)subscribeWithName:(NSString *)subscriptionName;
+- (RLMSyncSubscription *)subscribeWithName:(nullable NSString *)subscriptionName;
+
+/**
+ Subscribe to a subset of the query represented by this `RLMResults`.
+
+ Subscribing to a query asks the server to synchronize all objects to the
+ client which match the query, along with all objects which are reachable
+ from those objects via links. This happens asynchronously, and the local
+ client Realm may not immediately have all objects which match the query.
+ Observe the `state` property of the returned subscription object to be
+ notified of when the subscription has been processed by the server and
+ all objects matching the query are available.
+
+ Creating a new subscription with the same name and query as an existing
+ subscription will not create a new subscription, but instead will return
+ an object referring to the existing sync subscription. This means that
+ performing the same subscription twice followed by removing it once will
+ result in no subscription existing.
+
+ The number of top-level matches may optionally be limited. This limit
+ respects the sort and distinct order of the query being subscribed to,
+ if any. Please note that the limit does not count or apply to objects
+ which are added indirectly due to being linked to by the objects in the
+ subscription. If the limit is larger than the number of objects which
+ match the query, all objects will be included. Limiting a subscription
+ requires ROS 3.10.1 or newer, and will fail with an invalid predicate
+ error with older versions.
+
+ @param subscriptionName The name of the subscription
+ @param limit The maximum number of objects to include in the subscription.
+
+ @return The subscription
+
+ @see RLMSyncSubscription
+ */
+- (RLMSyncSubscription *)subscribeWithName:(nullable NSString *)subscriptionName limit:(NSUInteger)limit;
 @end
 
 NS_ASSUME_NONNULL_END

+ 8 - 0
Libraries external/Realm/Realm.framework/Headers/RLMSyncUser.h

@@ -96,6 +96,14 @@ NS_ASSUME_NONNULL_BEGIN
  */
 @property (nullable, nonatomic, readonly) NSString *identity;
 
+/**
+ The user's refresh token used to access the Realm Object Server.
+
+ This is required to make HTTP requests to Realm Object Server's REST API
+ for functionality not exposed natively. It should be treated as sensitive data.
+ */
+@property (nullable, nonatomic, readonly) NSString *refreshToken;
+
 /**
  The URL of the authentication server this user will communicate with.
  */

BIN
Libraries external/Realm/Realm.framework/Info.plist


+ 2 - 1
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSyncConfiguration_Private.h

@@ -33,7 +33,8 @@ typedef NS_ENUM(NSUInteger, RLMSyncStopPolicy) {
                    isPartial:(BOOL)isPartial
                    urlPrefix:(nullable NSString *)urlPrefix
                   stopPolicy:(RLMSyncStopPolicy)stopPolicy
-         enableSSLValidation:(BOOL)enableSSLValidation;
+         enableSSLValidation:(BOOL)enableSSLValidation
+             certificatePath:(nullable NSURL *)certificatePath;
 
 @property (nonatomic, readwrite) RLMSyncStopPolicy stopPolicy;
 

BIN
Libraries external/Realm/Realm.framework/Realm


File diff suppressed because it is too large
+ 0 - 494
Libraries external/Realm/RealmSwift.framework/0A85D1C9-A4CC-36AF-8CCA-4A34B492531A.bcsymbolmap


File diff suppressed because it is too large
+ 14782 - 0
Libraries external/Realm/RealmSwift.framework/402D8A9F-892F-3C5E-9154-6A540B74D63C.bcsymbolmap


File diff suppressed because it is too large
+ 894 - 0
Libraries external/Realm/RealmSwift.framework/5C573639-1261-3D04-A749-BD077CE893DF.bcsymbolmap


File diff suppressed because it is too large
+ 889 - 0
Libraries external/Realm/RealmSwift.framework/CC1F1DA4-4D64-3ED7-B9CC-C4E9B9DED5B8.bcsymbolmap


File diff suppressed because it is too large
+ 13687 - 0
Libraries external/Realm/RealmSwift.framework/D681F990-5480-3415-9F1A-940504AE6826.bcsymbolmap


File diff suppressed because it is too large
+ 0 - 494
Libraries external/Realm/RealmSwift.framework/F141265C-71B9-3F69-9ED6-18AB64CAB929.bcsymbolmap


+ 8 - 8
Libraries external/Realm/RealmSwift.framework/Headers/RealmSwift-Swift.h

@@ -1,4 +1,4 @@
-// Generated by Apple Swift version 4.1 (swiftlang-902.0.48 clang-902.0.37.1)
+// Generated by Apple Swift version 4.2 (swiftlang-1000.11.37.1 clang-1000.11.45.1)
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wgcc-compat"
 
@@ -129,17 +129,17 @@ typedef unsigned int swift_uint4  __attribute__((__ext_vector_type__(4)));
 #endif
 #if !defined(SWIFT_ENUM_ATTR)
 # if defined(__has_attribute) && __has_attribute(enum_extensibility)
-#  define SWIFT_ENUM_ATTR __attribute__((enum_extensibility(open)))
+#  define SWIFT_ENUM_ATTR(_extensibility) __attribute__((enum_extensibility(_extensibility)))
 # else
-#  define SWIFT_ENUM_ATTR
+#  define SWIFT_ENUM_ATTR(_extensibility)
 # endif
 #endif
 #if !defined(SWIFT_ENUM)
-# define SWIFT_ENUM(_type, _name) enum _name : _type _name; enum SWIFT_ENUM_ATTR SWIFT_ENUM_EXTRA _name : _type
+# define SWIFT_ENUM(_type, _name, _extensibility) enum _name : _type _name; enum SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
 # if __has_feature(generalized_swift_name)
-#  define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR SWIFT_ENUM_EXTRA _name : _type
+#  define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) enum _name : _type _name SWIFT_COMPILE_NAME(SWIFT_NAME); enum SWIFT_COMPILE_NAME(SWIFT_NAME) SWIFT_ENUM_ATTR(_extensibility) SWIFT_ENUM_EXTRA _name : _type
 # else
-#  define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME) SWIFT_ENUM(_type, _name)
+#  define SWIFT_ENUM_NAMED(_type, _name, SWIFT_NAME, _extensibility) SWIFT_ENUM(_type, _name, _extensibility)
 # endif
 #endif
 #if !defined(SWIFT_UNAVAILABLE)
@@ -163,9 +163,9 @@ typedef unsigned int swift_uint4  __attribute__((__ext_vector_type__(4)));
 # define SWIFT_DEPRECATED_OBJC(Msg) SWIFT_DEPRECATED_MSG(Msg)
 #endif
 #if __has_feature(modules)
-@import Realm;
-@import ObjectiveC;
 @import Foundation;
+@import ObjectiveC;
+@import Realm;
 @import Realm.Private;
 #endif
 

BIN
Libraries external/Realm/RealmSwift.framework/Info.plist


BIN
Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/arm.swiftdoc


BIN
Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/arm.swiftmodule


BIN
Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/arm64.swiftdoc


BIN
Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/arm64.swiftmodule


BIN
Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/i386.swiftdoc


BIN
Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/i386.swiftmodule


BIN
Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftdoc


BIN
Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftmodule


+ 2 - 2
Libraries external/Realm/RealmSwift.framework/Modules/module.modulemap

@@ -1,4 +1,4 @@
 framework module RealmSwift {
-    header "RealmSwift-Swift.h"
-    requires objc
+  header "RealmSwift-Swift.h"
+  requires objc
 }

BIN
Libraries external/Realm/RealmSwift.framework/RealmSwift


+ 12 - 14
Nextcloud.xcodeproj/project.pbxproj

@@ -3550,7 +3550,7 @@
 				TargetAttributes = {
 					F71459B41D12E3B700CAFEEC = {
 						DevelopmentTeam = 6JLRKY9ZV7;
-						LastSwiftMigration = 0900;
+						LastSwiftMigration = 1000;
 						SystemCapabilities = {
 							com.apple.ApplicationGroups.iOS = {
 								enabled = 1;
@@ -3563,6 +3563,7 @@
 					F72D100B210B6B16009C96B7 = {
 						CreatedOnToolsVersion = 9.4.1;
 						DevelopmentTeam = 6JLRKY9ZV7;
+						LastSwiftMigration = 1000;
 						ProvisioningStyle = Automatic;
 						SystemCapabilities = {
 							com.apple.ApplicationGroups.iOS = {
@@ -3576,11 +3577,12 @@
 					F771E3CF20E2392D00AFB62D = {
 						CreatedOnToolsVersion = 9.4.1;
 						DevelopmentTeam = 6JLRKY9ZV7;
+						LastSwiftMigration = 1000;
 						ProvisioningStyle = Automatic;
 					};
 					F77B0DEB1D118A16002130FE = {
 						DevelopmentTeam = 6JLRKY9ZV7;
-						LastSwiftMigration = 0900;
+						LastSwiftMigration = 1000;
 						ProvisioningStyle = Automatic;
 						SystemCapabilities = {
 							com.apple.Push = {
@@ -4698,8 +4700,7 @@
 				SKIP_INSTALL = YES;
 				SWIFT_OBJC_BRIDGING_HEADER = "Share/Share-Bridging-Header.h";
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
-				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
-				SWIFT_VERSION = 4.0;
+				SWIFT_VERSION = 4.2;
 				TARGETED_DEVICE_FAMILY = "1,2";
 				USE_HEADERMAP = YES;
 			};
@@ -4740,8 +4741,7 @@
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SKIP_INSTALL = YES;
 				SWIFT_OBJC_BRIDGING_HEADER = "Share/Share-Bridging-Header.h";
-				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
-				SWIFT_VERSION = 4.0;
+				SWIFT_VERSION = 4.2;
 				TARGETED_DEVICE_FAMILY = "1,2";
 				USE_HEADERMAP = YES;
 			};
@@ -4793,7 +4793,7 @@
 				SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
 				SWIFT_OBJC_BRIDGING_HEADER = "Notification Service Extension/NotificationServiceExtension-Bridging-Header.h";
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
-				SWIFT_VERSION = 4.0;
+				SWIFT_VERSION = 4.2;
 				TARGETED_DEVICE_FAMILY = "1,2";
 			};
 			name = Debug;
@@ -4841,7 +4841,7 @@
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SKIP_INSTALL = YES;
 				SWIFT_OBJC_BRIDGING_HEADER = "Notification Service Extension/NotificationServiceExtension-Bridging-Header.h";
-				SWIFT_VERSION = 4.0;
+				SWIFT_VERSION = 4.2;
 				TARGETED_DEVICE_FAMILY = "1,2";
 			};
 			name = Release;
@@ -4889,7 +4889,7 @@
 				SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
 				SWIFT_OBJC_BRIDGING_HEADER = "File Provider Extension/FileProviderExtension-Bridging-Header.h";
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
-				SWIFT_VERSION = 4.0;
+				SWIFT_VERSION = 4.2;
 				TARGETED_DEVICE_FAMILY = "1,2";
 			};
 			name = Debug;
@@ -4934,7 +4934,7 @@
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SKIP_INSTALL = YES;
 				SWIFT_OBJC_BRIDGING_HEADER = "File Provider Extension/FileProviderExtension-Bridging-Header.h";
-				SWIFT_VERSION = 4.0;
+				SWIFT_VERSION = 4.2;
 				TARGETED_DEVICE_FAMILY = "1,2";
 			};
 			name = Release;
@@ -4979,8 +4979,7 @@
 				PROVISIONING_PROFILE_SPECIFIER = "";
 				SWIFT_OBJC_BRIDGING_HEADER = "iOSClient/Nextcloud-Bridging-Header.h";
 				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
-				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
-				SWIFT_VERSION = 4.0;
+				SWIFT_VERSION = 4.2;
 				TARGETED_DEVICE_FAMILY = "1,2";
 				USE_HEADERMAP = YES;
 				VERSIONING_SYSTEM = "";
@@ -5026,8 +5025,7 @@
 				PROVISIONING_PROFILE = "";
 				PROVISIONING_PROFILE_SPECIFIER = "";
 				SWIFT_OBJC_BRIDGING_HEADER = "iOSClient/Nextcloud-Bridging-Header.h";
-				SWIFT_SWIFT3_OBJC_INFERENCE = Off;
-				SWIFT_VERSION = 4.0;
+				SWIFT_VERSION = 4.2;
 				TARGETED_DEVICE_FAMILY = "1,2";
 				USE_HEADERMAP = YES;
 				VERSIONING_SYSTEM = "";

+ 2 - 3
Share/CCloadItemData.swift

@@ -36,7 +36,7 @@ class CCloadItemData: NSObject {
             
             for item : NSExtensionItem in inputItems {
                 
-                if let attachments = item.attachments as? [NSItemProvider] {
+                if let attachments = item.attachments {
                     
                     if attachments.isEmpty {
                         
@@ -65,7 +65,7 @@ class CCloadItemData: NSObject {
                                         
                                         print("item as UIImage")
                                         
-                                        if let pngImageData = UIImagePNGRepresentation(image) {
+                                        if let pngImageData = image.pngData() {
                                         
                                             let fileName = "\(dateFormatter.string(from: Date()))\(conuter).png"
                                             let filenamePath = directory + "/" + fileName
@@ -167,7 +167,6 @@ class CCloadItemData: NSObject {
                                     
                                 } else {
                                     
-                                    print("ERROR: \(error)")
                                     hud.performSelector(onMainThread: #selector(CCHud.hideHud), with: nil, waitUntilDone: false)
                                 }
                             })

+ 2 - 2
iOSClient/Actions/CCActions.swift

@@ -80,9 +80,9 @@ class CCActions: NSObject {
         
         ocNetworking?.readFile(fileName, serverUrl: serverUrl, account: self.appDelegate.activeAccount, success: { (metadata) in
                 
-            let alertController = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: NSLocalizedString("_file_already_exists_", comment: ""), preferredStyle: UIAlertControllerStyle.alert)
+            let alertController = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: NSLocalizedString("_file_already_exists_", comment: ""), preferredStyle: UIAlertController.Style.alert)
                 
-            let okAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.default) {
+            let okAction = UIAlertAction(title: "OK", style: UIAlertAction.Style.default) {
                 (result : UIAlertAction) -> Void in
             }
                 

+ 18 - 18
iOSClient/Create/CCCreateCloud.swift

@@ -29,10 +29,10 @@ class CreateMenuAdd: NSObject {
     
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
 
-    let fontButton = [NSAttributedStringKey.font:UIFont(name: "HelveticaNeue", size: 16)!, NSAttributedStringKey.foregroundColor: UIColor.black]
-    let fontEncrypted = [NSAttributedStringKey.font:UIFont(name: "HelveticaNeue", size: 16)!, NSAttributedStringKey.foregroundColor: NCBrandColor.sharedInstance.encrypted as UIColor]
-    let fontCancel = [NSAttributedStringKey.font:UIFont(name: "HelveticaNeue-Bold", size: 17)!, NSAttributedStringKey.foregroundColor: UIColor.black]
-    let fontDisable = [NSAttributedStringKey.font:UIFont(name: "HelveticaNeue", size: 16)!, NSAttributedStringKey.foregroundColor: UIColor.darkGray]
+    let fontButton = [NSAttributedString.Key.font:UIFont(name: "HelveticaNeue", size: 16)!, NSAttributedString.Key.foregroundColor: UIColor.black]
+    let fontEncrypted = [NSAttributedString.Key.font:UIFont(name: "HelveticaNeue", size: 16)!, NSAttributedString.Key.foregroundColor: NCBrandColor.sharedInstance.encrypted as UIColor]
+    let fontCancel = [NSAttributedString.Key.font:UIFont(name: "HelveticaNeue-Bold", size: 17)!, NSAttributedString.Key.foregroundColor: UIColor.black]
+    let fontDisable = [NSAttributedString.Key.font:UIFont(name: "HelveticaNeue", size: 16)!, NSAttributedString.Key.foregroundColor: UIColor.darkGray]
 
     let colorLightGray = UIColor(red: 250.0/255.0, green: 250.0/255.0, blue: 250.0/255.0, alpha: 1)
     let colorGray = UIColor(red: 150.0/255.0, green: 150.0/255.0, blue: 150.0/255.0, alpha: 1)
@@ -308,8 +308,8 @@ class CreateFormUploadAssets: XLFormViewController, CCMoveDelegate {
         
         super.viewDidLoad()
         
-        let cancelButton : UIBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_cancel_", comment: ""), style: UIBarButtonItemStyle.plain, target: self, action: #selector(cancel))
-        let saveButton : UIBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_save_", comment: ""), style: UIBarButtonItemStyle.plain, target: self, action: #selector(save))
+        let cancelButton : UIBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_cancel_", comment: ""), style: UIBarButtonItem.Style.plain, target: self, action: #selector(cancel))
+        let saveButton : UIBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_save_", comment: ""), style: UIBarButtonItem.Style.plain, target: self, action: #selector(save))
         
         self.navigationItem.leftBarButtonItem = cancelButton
         self.navigationItem.rightBarButtonItem = saveButton
@@ -317,9 +317,9 @@ class CreateFormUploadAssets: XLFormViewController, CCMoveDelegate {
         self.navigationController?.navigationBar.isTranslucent = false
         self.navigationController?.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand
         self.navigationController?.navigationBar.tintColor = NCBrandColor.sharedInstance.brandText
-        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor: NCBrandColor.sharedInstance.brandText]
+        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: NCBrandColor.sharedInstance.brandText]
         
-        self.tableView.separatorStyle = UITableViewCellSeparatorStyle.none
+        self.tableView.separatorStyle = UITableViewCell.SeparatorStyle.none
         
         self.reloadForm()
     }
@@ -530,7 +530,7 @@ class CreateFormUploadFileText: XLFormViewController, CCMoveDelegate {
             self.form.delegate = nil
             
             if let fileNameNew = formRow.value {
-                 self.fileName = CCUtility.removeForbiddenCharactersServer(fileNameNew as! String)
+                 self.fileName = CCUtility.removeForbiddenCharactersServer(fileNameNew as? String)
             }
         
             formRow.value = self.fileName
@@ -548,15 +548,15 @@ class CreateFormUploadFileText: XLFormViewController, CCMoveDelegate {
         
         super.viewDidLoad()
         
-        let saveButton : UIBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_save_", comment: ""), style: UIBarButtonItemStyle.plain, target: self, action: #selector(save))
+        let saveButton : UIBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_save_", comment: ""), style: UIBarButtonItem.Style.plain, target: self, action: #selector(save))
         self.navigationItem.rightBarButtonItem = saveButton
         
         self.navigationController?.navigationBar.isTranslucent = false
         self.navigationController?.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand
         self.navigationController?.navigationBar.tintColor = NCBrandColor.sharedInstance.brandText
-        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor: NCBrandColor.sharedInstance.brandText]
+        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: NCBrandColor.sharedInstance.brandText]
         
-        self.tableView.separatorStyle = UITableViewCellSeparatorStyle.none
+        self.tableView.separatorStyle = UITableViewCell.SeparatorStyle.none
     }
     
     // MARK: - Action
@@ -905,15 +905,15 @@ class CreateFormUploadScanDocument: XLFormViewController, CCMoveDelegate {
         
         super.viewDidLoad()
         
-        let saveButton : UIBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_save_", comment: ""), style: UIBarButtonItemStyle.plain, target: self, action: #selector(save))
+        let saveButton : UIBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_save_", comment: ""), style: UIBarButtonItem.Style.plain, target: self, action: #selector(save))
         self.navigationItem.rightBarButtonItem = saveButton
         
         self.navigationController?.navigationBar.isTranslucent = false
         self.navigationController?.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand
         self.navigationController?.navigationBar.tintColor = NCBrandColor.sharedInstance.brandText
-        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor: NCBrandColor.sharedInstance.brandText]
+        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: NCBrandColor.sharedInstance.brandText]
         
-        self.tableView.separatorStyle = UITableViewCellSeparatorStyle.none
+        self.tableView.separatorStyle = UITableViewCell.SeparatorStyle.none
 //        self.tableView.sectionHeaderHeight = 10
 //        self.tableView.sectionFooterHeight = 10
 //        self.tableView.backgroundColor = NCBrandColor.sharedInstance.backgroundView
@@ -1005,7 +1005,7 @@ class CreateFormUploadScanDocument: XLFormViewController, CCMoveDelegate {
 
             //Generate PDF
             for image in self.arrayImages {
-                guard let data = UIImageJPEGRepresentation(image, CGFloat(compressionQuality)) else {
+                guard let data = image.jpegData(compressionQuality: CGFloat(compressionQuality)) else {
                     self.appDelegate.messageNotification("_error_", description: "_error_creation_file_", visible: true, delay: TimeInterval(k_dismissAfterSecond), type: TWMessageBarMessageType.info, errorCode: 0)
                     return
                 }
@@ -1023,7 +1023,7 @@ class CreateFormUploadScanDocument: XLFormViewController, CCMoveDelegate {
         
         if fileType == "JPG" {
             
-            guard let data = UIImageJPEGRepresentation(self.arrayImages[0], CGFloat(compressionQuality)) else {
+            guard let data = self.arrayImages[0].jpegData(compressionQuality: CGFloat(compressionQuality)) else {
                 self.appDelegate.messageNotification("_error_", description: "_error_creation_file_", visible: true, delay: TimeInterval(k_dismissAfterSecond), type: TWMessageBarMessageType.info, errorCode: 0)
                 return
             }
@@ -1123,7 +1123,7 @@ class NCCreateScanDocument : NSObject, ImageScannerControllerDelegate {
         }
         
         do {
-            try UIImagePNGRepresentation(image)?.write(to: NSURL.fileURL(withPath: fileNamePath), options: .atomic)
+            try image.pngData()?.write(to: NSURL.fileURL(withPath: fileNamePath), options: .atomic)
         } catch { }
         
         scanner.dismiss(animated: true, completion: {

+ 1 - 1
iOSClient/Library/SwiftWebVC/SwiftModalWebVC.swift

@@ -54,7 +54,7 @@ public class SwiftModalWebVC: UINavigationController {
         super.init(rootViewController: webViewController)
 
         let doneButton = UIBarButtonItem(image: SwiftWebVC.bundledImage(named: "SwiftWebVCDismiss"),
-                                         style: UIBarButtonItemStyle.plain,
+                                         style: UIBarButtonItem.Style.plain,
                                          target: webViewController,
                                          action: #selector(SwiftWebVC.doneButtonTapped))
     

+ 8 - 8
iOSClient/Library/SwiftWebVC/SwiftWebVC.swift

@@ -27,7 +27,7 @@ public class SwiftWebVC: UIViewController {
     
     lazy var backBarButtonItem: UIBarButtonItem =  {
         var tempBackBarButtonItem = UIBarButtonItem(image: SwiftWebVC.bundledImage(named: "SwiftWebVCBack"),
-                                                    style: UIBarButtonItemStyle.plain,
+                                                    style: UIBarButtonItem.Style.plain,
                                                     target: self,
                                                     action: #selector(SwiftWebVC.goBackTapped(_:)))
         tempBackBarButtonItem.width = 18.0
@@ -37,7 +37,7 @@ public class SwiftWebVC: UIViewController {
     
     lazy var forwardBarButtonItem: UIBarButtonItem =  {
         var tempForwardBarButtonItem = UIBarButtonItem(image: SwiftWebVC.bundledImage(named: "SwiftWebVCNext"),
-                                                       style: UIBarButtonItemStyle.plain,
+                                                       style: UIBarButtonItem.Style.plain,
                                                        target: self,
                                                        action: #selector(SwiftWebVC.goForwardTapped(_:)))
         tempForwardBarButtonItem.width = 18.0
@@ -46,7 +46,7 @@ public class SwiftWebVC: UIViewController {
     }()
     
     lazy var refreshBarButtonItem: UIBarButtonItem = {
-        var tempRefreshBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.refresh,
+        var tempRefreshBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.refresh,
                                                        target: self,
                                                        action: #selector(SwiftWebVC.reloadTapped(_:)))
         tempRefreshBarButtonItem.tintColor = self.buttonColor
@@ -54,7 +54,7 @@ public class SwiftWebVC: UIViewController {
     }()
     
     lazy var stopBarButtonItem: UIBarButtonItem = {
-        var tempStopBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.stop,
+        var tempStopBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.stop,
                                                     target: self,
                                                     action: #selector(SwiftWebVC.stopTapped(_:)))
         tempStopBarButtonItem.tintColor = self.buttonColor
@@ -62,7 +62,7 @@ public class SwiftWebVC: UIViewController {
     }()
     
     lazy var actionBarButtonItem: UIBarButtonItem = {
-        var tempActionBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.action,
+        var tempActionBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.action,
                                                       target: self,
                                                       action: #selector(SwiftWebVC.actionButtonTapped(_:)))
         tempActionBarButtonItem.tintColor = self.buttonColor
@@ -138,7 +138,7 @@ public class SwiftWebVC: UIViewController {
         navBarTitle.backgroundColor = UIColor.clear
         if presentingViewController == nil {
             if let titleAttributes = navigationController!.navigationBar.titleTextAttributes {
-                navBarTitle.textColor = titleAttributes[NSAttributedStringKey.foregroundColor] as! UIColor //[titleAttributes:"NSColor"] // ["NSColor"] as! UIColor
+                navBarTitle.textColor = titleAttributes[NSAttributedString.Key.foregroundColor] as? UIColor //[titleAttributes:"NSColor"] // ["NSColor"] as! UIColor
             }
         }
         else {
@@ -192,8 +192,8 @@ public class SwiftWebVC: UIViewController {
         
         let refreshStopBarButtonItem: UIBarButtonItem = webView.isLoading ? stopBarButtonItem : refreshBarButtonItem
         
-        let fixedSpace: UIBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.fixedSpace, target: nil, action: nil)
-        let flexibleSpace: UIBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.flexibleSpace, target: nil, action: nil)
+        let fixedSpace: UIBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.fixedSpace, target: nil, action: nil)
+        let flexibleSpace: UIBarButtonItem = UIBarButtonItem(barButtonSystemItem: UIBarButtonItem.SystemItem.flexibleSpace, target: nil, action: nil)
         
         if (UIDevice.current.userInterfaceIdiom == UIUserInterfaceIdiom.pad) {
             

+ 2 - 2
iOSClient/Library/SwiftWebVC/SwiftWebVCActivity.swift

@@ -14,10 +14,10 @@ class SwiftWebVCActivity: UIActivity {
     var URLToOpen: URL?
     var schemePrefix: String?
     
-    override var activityType : UIActivityType? {
+    override var activityType : UIActivity.ActivityType? {
         let typeArray = "\(Swift.type(of: self))".components(separatedBy: ".")
         let type: String = typeArray[typeArray.count-1]
-        return UIActivityType(rawValue: type)
+        return UIActivity.ActivityType(rawValue: type)
     }
         
     override var activityImage : UIImage {

+ 1 - 1
iOSClient/Main/CCMore.swift

@@ -324,7 +324,7 @@ class CCMore: UIViewController, UITableViewDelegate, UITableViewDataSource, CCLo
         selectionColor.backgroundColor = NCBrandColor.sharedInstance.getColorSelectBackgrond()
         cell.selectedBackgroundView = selectionColor
         
-        cell.accessoryType = UITableViewCellAccessoryType.disclosureIndicator
+        cell.accessoryType = UITableViewCell.AccessoryType.disclosureIndicator
         
         // Menu Normal
         if (indexPath.section == 0) {

+ 7 - 7
iOSClient/Main/NCMainCommon.swift

@@ -199,8 +199,8 @@ class NCMainCommon: NSObject {
             // NORMAL
             
             let cell = tableView.dequeueReusableCell(withIdentifier: "CellMain", for: indexPath) as! CCCellMain
-            cell.separatorInset = UIEdgeInsetsMake(0, 60, 0, 0)
-            cell.accessoryType = UITableViewCellAccessoryType.none
+            cell.separatorInset = UIEdgeInsets.init(top: 0, left: 60, bottom: 0, right: 0)
+            cell.accessoryType = UITableViewCell.AccessoryType.none
             cell.file.image = nil
             cell.status.image = nil
             cell.favorite.image = nil
@@ -327,8 +327,8 @@ class NCMainCommon: NSObject {
             // TRASNFER
             
             let cell = tableView.dequeueReusableCell(withIdentifier: "CellMainTransfer", for: indexPath) as! CCCellMainTransfer
-            cell.separatorInset = UIEdgeInsetsMake(0, 60, 0, 0)
-            cell.accessoryType = UITableViewCellAccessoryType.none
+            cell.separatorInset = UIEdgeInsets.init(top: 0, left: 60, bottom: 0, right: 0)
+            cell.accessoryType = UITableViewCell.AccessoryType.none
             cell.file.image = nil
             cell.status.image = nil
             
@@ -653,7 +653,7 @@ class CCMainTabBarController : UITabBarController, UITabBarControllerDelegate {
         // Disable interaction during animation
         view.isUserInteractionEnabled = false
             
-        UIView.animate(withDuration: 0.3, delay: 0.0, usingSpringWithDamping: 1, initialSpringVelocity: 0, options: UIViewAnimationOptions.curveEaseOut, animations: {
+        UIView.animate(withDuration: 0.3, delay: 0.0, usingSpringWithDamping: 1, initialSpringVelocity: 0, options: UIView.AnimationOptions.curveEaseOut, animations: {
                 
             // Slide the views by -offset
             fromView.center = CGPoint(x: fromView.center.x - offset, y: fromView.center.y);
@@ -716,7 +716,7 @@ class NCNetworkingMain: NSObject, CCNetworkingDelegate {
             }
             
             // open View File
-            if selector == selectorLoadFileView && UIApplication.shared.applicationState == UIApplicationState.active {
+            if selector == selectorLoadFileView && UIApplication.shared.applicationState == UIApplication.State.active {
             
                 if metadata.typeFile == k_metadataTypeFile_compress || metadata.typeFile == k_metadataTypeFile_unknown {
                 
@@ -741,7 +741,7 @@ class NCNetworkingMain: NSObject, CCNetworkingDelegate {
             }
             
             // Open in...
-            if selector == selectorOpenIn && UIApplication.shared.applicationState == UIApplicationState.active {
+            if selector == selectorOpenIn && UIApplication.shared.applicationState == UIApplication.State.active {
 
                 if appDelegate.activeMain.view.window != nil {
                     appDelegate.activeMain.open(in: metadata)

+ 2 - 2
iOSClient/Networking/NCService.swift

@@ -164,7 +164,7 @@ class NCService: NSObject, OCNetworkingDelegate {
                             return
                         }
                     
-                        if let data = UIImagePNGRepresentation(image) {
+                        if let data = image.pngData() {
                             try? data.write(to: URL(fileURLWithPath: fileNamePath))
                         }
                     
@@ -282,7 +282,7 @@ class NCService: NSObject, OCNetworkingDelegate {
                         return
                     }
                 
-                    if let data = UIImagePNGRepresentation(image) {
+                    if let data = image.pngData() {
                         try? data.write(to: URL(fileURLWithPath: fileNamePath))
                     }
                 

+ 2 - 2
iOSClient/Notification/CCNotification.swift

@@ -35,14 +35,14 @@ class CCNotification: UITableViewController, OCNetworkingDelegate {
         self.navigationController?.navigationBar.topItem?.title = NSLocalizedString("_notification_", comment: "")
         self.navigationController?.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand
         self.navigationController?.navigationBar.tintColor = NCBrandColor.sharedInstance.brandText
-        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor: NCBrandColor.sharedInstance.brandText]
+        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: NCBrandColor.sharedInstance.brandText]
         self.navigationController?.navigationBar.isTranslucent = false
 
         self.navigationItem.setRightBarButton(UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(viewClose)), animated: true)
         
         self.tableView.separatorColor = NCBrandColor.sharedInstance.seperator
         self.tableView.tableFooterView = UIView()
-        self.tableView.rowHeight = UITableViewAutomaticDimension
+        self.tableView.rowHeight = UITableView.automaticDimension
         self.tableView.estimatedRowHeight = 50.0
 
         // Register to receive notification reload data

+ 2 - 2
iOSClient/Scan/ScanCollectionView.swift

@@ -281,7 +281,7 @@ class DragDropViewController: UIViewController {
     
     @objc func handleLongPressGesture(recognizer: UIGestureRecognizer) {
         
-        if recognizer.state == UIGestureRecognizerState.began {
+        if recognizer.state == UIGestureRecognizer.State.began {
         
             self.becomeFirstResponder()
             
@@ -326,7 +326,7 @@ class DragDropViewController: UIViewController {
             }
             
             do {
-                try UIImagePNGRepresentation(image)?.write(to: NSURL.fileURL(withPath: fileNamePath), options: .atomic)
+                try image.pngData()?.write(to: NSURL.fileURL(withPath: fileNamePath), options: .atomic)
             } catch {
                 return
             }

+ 1 - 1
iOSClient/Scan/WeScan/Common/QuadrilateralView.swift

@@ -60,7 +60,7 @@ final class QuadrilateralView: UIView {
                 return
             }
             quadLayer.fillColor = isHighlighted ? UIColor.clear.cgColor : UIColor(white: 0.0, alpha: 0.6).cgColor
-            isHighlighted ? bringSubview(toFront: quadView) : sendSubview(toBack: quadView)
+            isHighlighted ? bringSubviewToFront(quadView) : sendSubviewToBack(quadView)
         }
     }
     

+ 1 - 1
iOSClient/Scan/WeScan/Extensions/CGPoint+Utils.swift

@@ -26,7 +26,7 @@ extension CGPoint {
     ///   - point: The second point to compare this instance with.
     /// - Returns: True if the given `CGPoint` is within the given distance of this instance of `CGPoint`.
     func isWithin(delta: CGFloat, ofPoint point: CGPoint) -> Bool {
-        return (fabs(x - point.x) <= delta) && (fabs(y - point.y) <= delta)
+        return (abs(x - point.x) <= delta) && (abs(y - point.y) <= delta)
     }
     
     /// Returns the same `CGPoint` in the cartesian coordinate system.

+ 1 - 1
iOSClient/Scan/WeScan/ImageScannerController.swift

@@ -93,7 +93,7 @@ public final class ImageScannerController: UINavigationController {
     }
     
     internal func flashToBlack() {
-        view.bringSubview(toFront: blackFlashView)
+        view.bringSubviewToFront(blackFlashView)
         blackFlashView.isHidden = false
         let flashDuration = DispatchTime.now() + 0.05
         DispatchQueue.main.asyncAfter(deadline: flashDuration) {

+ 2 - 2
iOSClient/Scan/WeScan/Scan/CloseButton.swift

@@ -18,7 +18,7 @@ final class CloseButton: UIControl {
         layer.addSublayer(xLayer)
         backgroundColor = .clear
         isAccessibilityElement = true
-        accessibilityTraits = UIAccessibilityTraitButton
+        accessibilityTraits = UIAccessibilityTraits.button
     }
     
     required init?(coder aDecoder: NSCoder) {
@@ -32,7 +32,7 @@ final class CloseButton: UIControl {
         xLayer.path = pathForX(inRect: rect.insetBy(dx: xLayer.lineWidth / 2, dy: xLayer.lineWidth / 2)).cgPath
         xLayer.fillColor = UIColor.clear.cgColor
         xLayer.strokeColor = NCBrandColor.sharedInstance.brandText.cgColor
-        xLayer.lineCap = kCALineCapRound
+        xLayer.lineCap = CAShapeLayerLineCap.round
     }
     
     private func pathForX(inRect rect: CGRect) -> UIBezierPath {

+ 2 - 2
iOSClient/Scan/WeScan/Scan/ScannerViewController.swift

@@ -28,7 +28,7 @@ final class ScannerViewController: UIViewController {
     }()
     
     lazy private var activityIndicator: UIActivityIndicatorView = {
-        let activityIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray)
+        let activityIndicator = UIActivityIndicatorView(style: .gray)
         activityIndicator.hidesWhenStopped = true
         activityIndicator.translatesAutoresizingMaskIntoConstraints = false
         return activityIndicator
@@ -61,7 +61,7 @@ final class ScannerViewController: UIViewController {
         captureSessionManager?.start()
         UIApplication.shared.isIdleTimerDisabled = true
         
-        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor: NCBrandColor.sharedInstance.brandText]
+        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: NCBrandColor.sharedInstance.brandText]
         self.navigationController?.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand
     }
     

+ 2 - 2
iOSClient/Scan/WeScan/Scan/ShutterButton.swift

@@ -37,7 +37,7 @@ final class ShutterButton: UIControl {
         layer.addSublayer(innerCircleLayer)
         backgroundColor = .clear
         isAccessibilityElement = true
-        accessibilityTraits = UIAccessibilityTraitButton
+        accessibilityTraits = UIAccessibilityTraits.button
         impactFeedbackGenerator.prepare()
     }
     
@@ -71,7 +71,7 @@ final class ShutterButton: UIControl {
         }
         animation.values = values
         animation.isRemovedOnCompletion = false
-        animation.fillMode = kCAFillModeForwards
+        animation.fillMode = CAMediaTimingFillMode.forwards
         animation.duration = isHighlighted ? 0.35 : 0.10
         
         innerCircleLayer.add(animation, forKey: "transform")

+ 2 - 2
iOSClient/Settings/NCManageAutoUploadFileName.swift

@@ -154,9 +154,9 @@ class NCManageAutoUploadFileName: XLFormViewController {
         self.navigationController?.navigationBar.isTranslucent = false
         self.navigationController?.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand
         self.navigationController?.navigationBar.tintColor = NCBrandColor.sharedInstance.brandText
-        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor: NCBrandColor.sharedInstance.brandText]
+        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: NCBrandColor.sharedInstance.brandText]
         
-        self.tableView.separatorStyle = UITableViewCellSeparatorStyle.none
+        self.tableView.separatorStyle = UITableViewCell.SeparatorStyle.none
                 
         self.reloadForm()
     }

+ 4 - 4
iOSClient/Text/NCText.swift

@@ -46,13 +46,13 @@ class NCText: UIViewController, UITextViewDelegate {
         
         super.viewDidLoad()
         
-        NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardWillShowHandle(info:)), name: .UIKeyboardWillShow, object: nil)
-        NotificationCenter.default.addObserver(self, selector:#selector(self.keyboardWillHideHandle), name: .UIKeyboardWillHide, object: nil)
+        NotificationCenter.default.addObserver(self, selector: #selector(self.keyboardWillShowHandle(info:)), name: UIResponder.keyboardWillShowNotification, object: nil)
+        NotificationCenter.default.addObserver(self, selector:#selector(self.keyboardWillHideHandle), name: UIResponder.keyboardWillHideNotification, object: nil)
 
         self.navigationController?.navigationBar.topItem?.title = NSLocalizedString("_untitled_txt_", comment: "")
         self.navigationController?.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand
         self.navigationController?.navigationBar.tintColor = NCBrandColor.sharedInstance.brandText
-        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor: NCBrandColor.sharedInstance.brandText]
+        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor: NCBrandColor.sharedInstance.brandText]
         self.navigationController?.navigationBar.isTranslucent = false
 
         self.navigationController?.toolbar.barTintColor = NCBrandColor.sharedInstance.brandText
@@ -99,7 +99,7 @@ class NCText: UIViewController, UITextViewDelegate {
         let frameView = self.view.convert(self.view.bounds, to: self.view.window)
         let endView = frameView.origin.y + frameView.size.height
         
-        if let keyboardSize = (info.userInfo?[UIKeyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue, let _ = self.view.window?.frame {
+        if let keyboardSize = (info.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue, let _ = self.view.window?.frame {
             
             if endView - keyboardSize.origin.y > 0 {
                 bottomConstraint.constant = endView - keyboardSize.origin.y

Some files were not shown because too many files changed in this diff