marinofaggiana 5 years ago
parent
commit
e7ba4fd974
33 changed files with 326 additions and 461 deletions
  1. 1 1
      Cartfile
  2. 1 1
      Cartfile.resolved
  3. 83 244
      Carthage/Checkouts/realm-cocoa/.jenkins.yml
  4. 47 0
      Carthage/Checkouts/realm-cocoa/CHANGELOG.md
  5. 3 3
      Carthage/Checkouts/realm-cocoa/Jenkinsfile.releasability
  6. 41 0
      Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/SwiftObjectServerTests.swift
  7. 2 0
      Carthage/Checkouts/realm-cocoa/Realm/RLMRealm.mm
  8. 4 0
      Carthage/Checkouts/realm-cocoa/Realm/RLMRealmConfiguration+Sync.mm
  9. 2 2
      Carthage/Checkouts/realm-cocoa/Realm/RLMRealmConfiguration.h
  10. 1 2
      Carthage/Checkouts/realm-cocoa/Realm/RLMRealmConfiguration.mm
  11. 2 2
      Carthage/Checkouts/realm-cocoa/Realm/Realm-Info.plist
  12. 0 37
      Carthage/Checkouts/realm-cocoa/RealmSwift/List.swift
  13. 9 12
      Carthage/Checkouts/realm-cocoa/RealmSwift/Object.swift
  14. 6 2
      Carthage/Checkouts/realm-cocoa/RealmSwift/Realm.swift
  15. 2 2
      Carthage/Checkouts/realm-cocoa/RealmSwift/RealmCollection.swift
  16. 6 7
      Carthage/Checkouts/realm-cocoa/RealmSwift/RealmConfiguration.swift
  17. 2 2
      Carthage/Checkouts/realm-cocoa/RealmSwift/Results.swift
  18. 23 7
      Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/KVOTests.swift
  19. 0 12
      Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/ListTests.swift
  20. 1 1
      Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/MigrationTests.swift
  21. 0 36
      Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/PerformanceTests.swift
  22. 0 18
      Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/PrimitiveListTests.swift
  23. 0 30
      Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/RealmCollectionTypeTests.swift
  24. 8 0
      Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/RealmTests.swift
  25. 12 12
      Carthage/Checkouts/realm-cocoa/RealmSwift/Util.swift
  26. 12 17
      Carthage/Checkouts/realm-cocoa/build.sh
  27. 2 2
      Carthage/Checkouts/realm-cocoa/dependencies.list
  28. 1 1
      Carthage/Checkouts/realm-cocoa/scripts/package_examples.rb
  29. 3 0
      iOSClient/AppDelegate.h
  30. 3 1
      iOSClient/AppDelegate.m
  31. 2 2
      iOSClient/CCGlobal.h
  32. 42 0
      iOSClient/Main/CCMain.m
  33. 5 5
      iOSClient/Networking/NCNetworking.swift

+ 1 - 1
Cartfile

@@ -5,7 +5,7 @@ github "MortimerGoro/MGSwipeTableCell" "1.6.8"
 github "dzenbot/DZNEmptyDataSet" "v1.8.1"
 github "ChangbaDevs/KTVHTTPCache" "2.0.1"
 github "jdg/MBProgressHUD" "1.1.0"
-github "realm/realm-cocoa" "v4.3.1"
+github "realm/realm-cocoa"
 github "SVGKit/SVGKit" "3.x"
 github "WeTransfer/WeScan" "1.2.0"
 github "malcommac/SwiftRichString"

+ 1 - 1
Cartfile.resolved

@@ -18,7 +18,7 @@ github "malcommac/SwiftRichString" "3.7.1"
 github "marinofaggiana/AFNetworking" "2967678c3e0e98c9b8d7e06222ad12d1f49c26f2"
 github "marinofaggiana/FastScroll" "81967c2309d29bc2c330d422da612160a30bade8"
 github "nextcloud/ios-communication-library" "527fad964134f3cd8d12948f6f767a38ea9df4d6"
-github "realm/realm-cocoa" "v4.3.1"
+github "realm/realm-cocoa" "v4.4.0"
 github "rechsteiner/Parchment" "v1.7.0"
 github "scenee/FloatingPanel" "v1.7.4"
 github "tilltue/TLPhotoPicker" "2.0.7"

+ 83 - 244
Carthage/Checkouts/realm-cocoa/.jenkins.yml

@@ -4,12 +4,11 @@
 # This is a generated file produced by scripts/pr-ci-matrix.rb.
 
 xcode_version: 
- - 10.0
- - 10.1
  - 10.3
  - 11.1
  - 11.2.1
  - 11.3
+ - 11.4
 target: 
  - docs
  - swiftlint
@@ -38,22 +37,6 @@ configuration:
 
 exclude:
 
-  - xcode_version: 10.0
-    target: docs
-    configuration: Debug
-
-  - xcode_version: 10.0
-    target: docs
-    configuration: Release
-
-  - xcode_version: 10.1
-    target: docs
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: docs
-    configuration: Release
-
   - xcode_version: 10.3
     target: docs
     configuration: Debug
@@ -82,22 +65,14 @@ exclude:
     target: docs
     configuration: Debug
 
-  - xcode_version: 10.0
-    target: swiftlint
-    configuration: Debug
-
-  - xcode_version: 10.0
-    target: swiftlint
+  - xcode_version: 11.3
+    target: docs
     configuration: Release
 
-  - xcode_version: 10.1
-    target: swiftlint
+  - xcode_version: 11.4
+    target: docs
     configuration: Debug
 
-  - xcode_version: 10.1
-    target: swiftlint
-    configuration: Release
-
   - xcode_version: 10.3
     target: swiftlint
     configuration: Debug
@@ -126,25 +101,17 @@ exclude:
     target: swiftlint
     configuration: Debug
 
-  - xcode_version: 10.0
-    target: osx-encryption
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: osx-encryption
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: osx-encryption
+  - xcode_version: 11.3
+    target: swiftlint
     configuration: Release
 
-  - xcode_version: 10.3
-    target: osx-encryption
+  - xcode_version: 11.4
+    target: swiftlint
     configuration: Debug
 
   - xcode_version: 10.3
     target: osx-encryption
-    configuration: Release
+    configuration: Debug
 
   - xcode_version: 11.1
     target: osx-encryption
@@ -166,25 +133,17 @@ exclude:
     target: osx-encryption
     configuration: Debug
 
-  - xcode_version: 10.0
-    target: osx-object-server
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: osx-object-server
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: osx-object-server
+  - xcode_version: 11.3
+    target: osx-encryption
     configuration: Release
 
-  - xcode_version: 10.3
-    target: osx-object-server
+  - xcode_version: 11.4
+    target: osx-encryption
     configuration: Debug
 
   - xcode_version: 10.3
     target: osx-object-server
-    configuration: Release
+    configuration: Debug
 
   - xcode_version: 11.1
     target: osx-object-server
@@ -206,25 +165,17 @@ exclude:
     target: osx-object-server
     configuration: Debug
 
-  - xcode_version: 10.0
-    target: ios-static
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: ios-static
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: ios-static
+  - xcode_version: 11.3
+    target: osx-object-server
     configuration: Release
 
-  - xcode_version: 10.3
-    target: ios-static
+  - xcode_version: 11.4
+    target: osx-object-server
     configuration: Debug
 
   - xcode_version: 10.3
     target: ios-static
-    configuration: Release
+    configuration: Debug
 
   - xcode_version: 11.1
     target: ios-static
@@ -246,25 +197,17 @@ exclude:
     target: ios-static
     configuration: Debug
 
-  - xcode_version: 10.0
-    target: ios-dynamic
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: ios-dynamic
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: ios-dynamic
+  - xcode_version: 11.3
+    target: ios-static
     configuration: Release
 
-  - xcode_version: 10.3
-    target: ios-dynamic
+  - xcode_version: 11.4
+    target: ios-static
     configuration: Debug
 
   - xcode_version: 10.3
     target: ios-dynamic
-    configuration: Release
+    configuration: Debug
 
   - xcode_version: 11.1
     target: ios-dynamic
@@ -286,25 +229,17 @@ exclude:
     target: ios-dynamic
     configuration: Debug
 
-  - xcode_version: 10.0
-    target: watchos
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: watchos
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: watchos
+  - xcode_version: 11.3
+    target: ios-dynamic
     configuration: Release
 
-  - xcode_version: 10.3
-    target: watchos
+  - xcode_version: 11.4
+    target: ios-dynamic
     configuration: Debug
 
   - xcode_version: 10.3
     target: watchos
-    configuration: Release
+    configuration: Debug
 
   - xcode_version: 11.1
     target: watchos
@@ -326,25 +261,17 @@ exclude:
     target: watchos
     configuration: Debug
 
-  - xcode_version: 10.0
-    target: tvos
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: tvos
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: tvos
+  - xcode_version: 11.3
+    target: watchos
     configuration: Release
 
-  - xcode_version: 10.3
-    target: tvos
+  - xcode_version: 11.4
+    target: watchos
     configuration: Debug
 
   - xcode_version: 10.3
     target: tvos
-    configuration: Release
+    configuration: Debug
 
   - xcode_version: 11.1
     target: tvos
@@ -366,25 +293,17 @@ exclude:
     target: tvos
     configuration: Debug
 
-  - xcode_version: 10.0
-    target: ios-swift
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: ios-swift
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: ios-swift
+  - xcode_version: 11.3
+    target: tvos
     configuration: Release
 
-  - xcode_version: 10.3
-    target: ios-swift
+  - xcode_version: 11.4
+    target: tvos
     configuration: Debug
 
   - xcode_version: 10.3
     target: ios-swift
-    configuration: Release
+    configuration: Debug
 
   - xcode_version: 11.1
     target: ios-swift
@@ -406,25 +325,17 @@ exclude:
     target: ios-swift
     configuration: Debug
 
-  - xcode_version: 10.0
-    target: tvos-swift
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: tvos-swift
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: tvos-swift
+  - xcode_version: 11.3
+    target: ios-swift
     configuration: Release
 
-  - xcode_version: 10.3
-    target: tvos-swift
+  - xcode_version: 11.4
+    target: ios-swift
     configuration: Debug
 
   - xcode_version: 10.3
     target: tvos-swift
-    configuration: Release
+    configuration: Debug
 
   - xcode_version: 11.1
     target: tvos-swift
@@ -446,22 +357,14 @@ exclude:
     target: tvos-swift
     configuration: Debug
 
-  - xcode_version: 10.0
-    target: catalyst
-    configuration: Debug
-
-  - xcode_version: 10.0
-    target: catalyst
+  - xcode_version: 11.3
+    target: tvos-swift
     configuration: Release
 
-  - xcode_version: 10.1
-    target: catalyst
+  - xcode_version: 11.4
+    target: tvos-swift
     configuration: Debug
 
-  - xcode_version: 10.1
-    target: catalyst
-    configuration: Release
-
   - xcode_version: 10.3
     target: catalyst
     configuration: Debug
@@ -478,22 +381,10 @@ exclude:
     target: catalyst
     configuration: Debug
 
-  - xcode_version: 10.0
-    target: catalyst-swift
-    configuration: Debug
-
-  - xcode_version: 10.0
-    target: catalyst-swift
-    configuration: Release
-
-  - xcode_version: 10.1
-    target: catalyst-swift
+  - xcode_version: 11.3
+    target: catalyst
     configuration: Debug
 
-  - xcode_version: 10.1
-    target: catalyst-swift
-    configuration: Release
-
   - xcode_version: 10.3
     target: catalyst-swift
     configuration: Debug
@@ -510,12 +401,8 @@ exclude:
     target: catalyst-swift
     configuration: Debug
 
-  - xcode_version: 10.0
-    target: cocoapods-osx
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: cocoapods-osx
+  - xcode_version: 11.3
+    target: catalyst-swift
     configuration: Debug
 
   - xcode_version: 10.3
@@ -534,26 +421,14 @@ exclude:
     target: cocoapods-osx
     configuration: Debug
 
-  - xcode_version: 10.0
-    target: cocoapods-ios
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: cocoapods-ios
+  - xcode_version: 11.4
+    target: cocoapods-osx
     configuration: Debug
 
-  - xcode_version: 10.1
-    target: cocoapods-ios
-    configuration: Release
-
   - xcode_version: 10.3
     target: cocoapods-ios
     configuration: Debug
 
-  - xcode_version: 10.3
-    target: cocoapods-ios
-    configuration: Release
-
   - xcode_version: 11.1
     target: cocoapods-ios
     configuration: Debug
@@ -574,25 +449,17 @@ exclude:
     target: cocoapods-ios
     configuration: Debug
 
-  - xcode_version: 10.0
-    target: cocoapods-ios-dynamic
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: cocoapods-ios-dynamic
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: cocoapods-ios-dynamic
+  - xcode_version: 11.3
+    target: cocoapods-ios
     configuration: Release
 
-  - xcode_version: 10.3
-    target: cocoapods-ios-dynamic
+  - xcode_version: 11.4
+    target: cocoapods-ios
     configuration: Debug
 
   - xcode_version: 10.3
     target: cocoapods-ios-dynamic
-    configuration: Release
+    configuration: Debug
 
   - xcode_version: 11.1
     target: cocoapods-ios-dynamic
@@ -614,25 +481,17 @@ exclude:
     target: cocoapods-ios-dynamic
     configuration: Debug
 
-  - xcode_version: 10.0
-    target: cocoapods-watchos
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: cocoapods-watchos
-    configuration: Debug
-
-  - xcode_version: 10.1
-    target: cocoapods-watchos
+  - xcode_version: 11.3
+    target: cocoapods-ios-dynamic
     configuration: Release
 
-  - xcode_version: 10.3
-    target: cocoapods-watchos
+  - xcode_version: 11.4
+    target: cocoapods-ios-dynamic
     configuration: Debug
 
   - xcode_version: 10.3
     target: cocoapods-watchos
-    configuration: Release
+    configuration: Debug
 
   - xcode_version: 11.1
     target: cocoapods-watchos
@@ -654,22 +513,14 @@ exclude:
     target: cocoapods-watchos
     configuration: Debug
 
-  - xcode_version: 10.0
-    target: swiftpm
-    configuration: Debug
-
-  - xcode_version: 10.0
-    target: swiftpm
+  - xcode_version: 11.3
+    target: cocoapods-watchos
     configuration: Release
 
-  - xcode_version: 10.1
-    target: swiftpm
+  - xcode_version: 11.4
+    target: cocoapods-watchos
     configuration: Debug
 
-  - xcode_version: 10.1
-    target: swiftpm
-    configuration: Release
-
   - xcode_version: 10.3
     target: swiftpm
     configuration: Debug
@@ -686,22 +537,10 @@ exclude:
     target: swiftpm
     configuration: Debug
 
-  - xcode_version: 10.0
-    target: swiftpm-address
-    configuration: Debug
-
-  - xcode_version: 10.0
-    target: swiftpm-address
-    configuration: Release
-
-  - xcode_version: 10.1
-    target: swiftpm-address
+  - xcode_version: 11.3
+    target: swiftpm
     configuration: Debug
 
-  - xcode_version: 10.1
-    target: swiftpm-address
-    configuration: Release
-
   - xcode_version: 10.3
     target: swiftpm-address
     configuration: Debug
@@ -730,22 +569,14 @@ exclude:
     target: swiftpm-address
     configuration: Debug
 
-  - xcode_version: 10.0
-    target: swiftpm-thread
-    configuration: Debug
-
-  - xcode_version: 10.0
-    target: swiftpm-thread
+  - xcode_version: 11.3
+    target: swiftpm-address
     configuration: Release
 
-  - xcode_version: 10.1
-    target: swiftpm-thread
+  - xcode_version: 11.4
+    target: swiftpm-address
     configuration: Debug
 
-  - xcode_version: 10.1
-    target: swiftpm-thread
-    configuration: Release
-
   - xcode_version: 10.3
     target: swiftpm-thread
     configuration: Debug
@@ -773,3 +604,11 @@ exclude:
   - xcode_version: 11.3
     target: swiftpm-thread
     configuration: Debug
+
+  - xcode_version: 11.3
+    target: swiftpm-thread
+    configuration: Release
+
+  - xcode_version: 11.4
+    target: swiftpm-thread
+    configuration: Debug

+ 47 - 0
Carthage/Checkouts/realm-cocoa/CHANGELOG.md

@@ -1,3 +1,50 @@
+4.4.0 Release notes (2020-03-26)
+=============================================================
+
+Swift 4.0 and Xcode 10.3 are now the minimum supported versions.
+
+### Enhancements
+
+* Allow setting the `fileUrl` for synchronized Realms. An appropriate local
+  path based on the sync URL will still be used if it is not overridden.
+  ([PR #6454](https://github.com/realm/realm-cocoa/pull/6454)).
+* Add Xcode 11.4 binaries to the release package.
+
+### Fixed
+
+* None.
+
+### Compatibility
+
+* File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
+* Realm Object Server: 3.21.0 or later.
+* Carthage release for Swift is built with Xcode 11.4.
+
+4.3.2 Release notes (2020-02-06)
+=============================================================
+
+### Enhancements
+
+* Similar to `autoreleasepool()`, `realm.write()` now returns the value which
+  the block passed to it returns. Returning `Void` from the block is still allowed.
+
+### Fixed
+
+* Fix a memory leak attributed to `property_copyAttributeList` the first time a
+  Realm is opened when using Realm Swift. ([#6409](https://github.com/realm/realm-cocoa/issues/6409), since 4.0.0).
+* Connecting to a `realms:` sync URL would crash at runtime on iOS 11 (and no
+  other iOS versions) inside the SSL validation code. (Since 4.3.1).
+
+### Compatibility
+
+* File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
+* Realm Object Server: 3.21.0 or later.
+* Carthage release for Swift is built with Xcode 11.3.
+
+### Internal
+
+* Upgraded realm-sync from 4.9.4 to 4.9.5.
+
 4.3.1 Release notes (2020-01-16)
 =============================================================
 

+ 3 - 3
Carthage/Checkouts/realm-cocoa/Jenkinsfile.releasability

@@ -1,9 +1,9 @@
-xcodeVersions = ['10.0', '10.1', '10.3', '11.1', '11.2.1', '11.3']
+xcodeVersions = ['10.3', '11.1', '11.2.1', '11.3', '11.4']
 platforms = ['osx', 'ios', 'watchos', 'tvos', 'catalyst']
 carthagePlatforms = ['osx', 'ios', 'watchos', 'tvos']
 platformNames = ['osx': 'macOS', 'ios': 'iOS', 'watchos': 'watchOS', 'tvos': 'tvOS', 'catalyst': 'Catalyst']
-carthageXcodeVersion = '11.3'
-objcXcodeVersion = '10.1'
+carthageXcodeVersion = '11.4'
+objcXcodeVersion = '10.3'
 docsSwiftVersion = '5.1.2'
 
 def installationTest(platform, test, language) {

+ 41 - 0
Carthage/Checkouts/realm-cocoa/Realm/ObjectServerTests/SwiftObjectServerTests.swift

@@ -302,6 +302,41 @@ class SwiftObjectServerTests: SwiftSyncTestCase {
         XCTAssertFalse(RLMHasCachedRealmForPath(pathOnDisk))
     }
 
+    func testDownloadRealmToCustomPath() {
+        let user = try! synchronouslyLogInUser(for: basicCredentials(register: isParent), server: authURL)
+        if !isParent {
+            populateRealm(user: user, url: realmURL)
+            return
+        }
+
+        // Wait for the child process to upload everything.
+        executeChild()
+
+        let ex = expectation(description: "download-realm")
+        let customFileURL = realmURLForFile("copy")
+        var config = user.configuration(realmURL: realmURL, fullSynchronization: true)
+        config.fileURL = customFileURL
+        let pathOnDisk = ObjectiveCSupport.convert(object: config).pathOnDisk
+        XCTAssertEqual(pathOnDisk, customFileURL.path)
+        XCTAssertFalse(FileManager.default.fileExists(atPath: pathOnDisk))
+        Realm.asyncOpen(configuration: config) { realm, error in
+            XCTAssertNil(error)
+            self.checkCount(expected: self.bigObjectCount, realm!, SwiftHugeSyncObject.self)
+            ex.fulfill()
+        }
+        func fileSize(path: String) -> Int {
+            if let attr = try? FileManager.default.attributesOfItem(atPath: path) {
+                return attr[.size] as! Int
+            }
+            return 0
+        }
+        XCTAssertFalse(RLMHasCachedRealmForPath(pathOnDisk))
+        waitForExpectations(timeout: 10.0, handler: nil)
+        XCTAssertGreaterThan(fileSize(path: pathOnDisk), 0)
+        XCTAssertFalse(RLMHasCachedRealmForPath(pathOnDisk))
+    }
+
+
     func testCancelDownloadRealm() {
         let user = try! synchronouslyLogInUser(for: basicCredentials(register: isParent), server: authURL)
         if !isParent {
@@ -578,4 +613,10 @@ class SwiftObjectServerTests: SwiftSyncTestCase {
         _ = try! Realm(configuration: config)
         self.waitForExpectations(timeout: 4.0)
     }
+
+    private func realmURLForFile(_ fileName: String) -> URL {
+        let testDir = RLMRealmPathForFile("realm-object-server")
+        let directory = URL(fileURLWithPath: testDir, isDirectory: true)
+        return directory.appendingPathComponent(fileName, isDirectory: false)
+    }
 }

+ 2 - 0
Carthage/Checkouts/realm-cocoa/Realm/RLMRealm.mm

@@ -29,6 +29,7 @@
 #import "RLMProperty.h"
 #import "RLMProperty_Private.h"
 #import "RLMQueryUtil.hpp"
+#import "RLMRealmConfiguration+Sync.h"
 #import "RLMRealmConfiguration_Private.hpp"
 #import "RLMRealmUtil.hpp"
 #import "RLMSchema_Private.hpp"
@@ -402,6 +403,7 @@ REALM_NOINLINE static void translateSharedGroupOpenException(RLMRealmConfigurati
             case RealmFileException::Kind::IncompatibleSyncedRealm: {
                 RLMRealmConfiguration *configuration = [originalConfiguration copy];
                 configuration.fileURL = [NSURL fileURLWithPath:@(ex.path().data())];
+                configuration.syncConfiguration = nil;
                 configuration.readOnly = YES;
 
                 NSError *intermediateError = RLMMakeError(RLMErrorIncompatibleSyncedFile, ex);

+ 4 - 0
Carthage/Checkouts/realm-cocoa/Realm/RLMRealmConfiguration+Sync.mm

@@ -33,6 +33,10 @@
 #pragma mark - API
 
 - (void)setSyncConfiguration:(RLMSyncConfiguration *)syncConfiguration {
+    if (syncConfiguration == nil) {
+        self.config.sync_config = nullptr;
+        return;
+    }
     if (self.config.should_compact_on_launch_function) {
         @throw RLMException(@"Cannot set `syncConfiguration` when `shouldCompactOnLaunch` is set.");
     }

+ 2 - 2
Carthage/Checkouts/realm-cocoa/Realm/RLMRealmConfiguration.h

@@ -66,8 +66,8 @@ typedef BOOL (^RLMShouldCompactOnLaunchBlock)(NSUInteger totalBytes, NSUInteger
 
 #pragma mark - Properties
 
-/// The local URL of the Realm file. Mutually exclusive with `inMemoryIdentifier` and `syncConfiguration`;
-/// setting any one of the three properties will automatically nil out the other two.
+/// The local URL of the Realm file. Mutually exclusive with `inMemoryIdentifier`;
+/// setting one of the two properties will automatically nil out the other.
 @property (nonatomic, copy, nullable) NSURL *fileURL;
 
 /// A string used to identify a particular in-memory Realm. Mutually exclusive with `fileURL` and `syncConfiguration`;

+ 1 - 2
Carthage/Checkouts/realm-cocoa/Realm/RLMRealmConfiguration.mm

@@ -153,7 +153,7 @@ static void RLMNSStringToStdString(std::string &out, NSString *in) {
 }
 
 - (NSURL *)fileURL {
-    if (_config.in_memory || _config.sync_config) {
+    if (_config.in_memory) {
         return nil;
     }
     return [NSURL fileURLWithPath:@(_config.path.c_str())];
@@ -164,7 +164,6 @@ static void RLMNSStringToStdString(std::string &out, NSString *in) {
     if (path.length == 0) {
         @throw RLMException(@"Realm path must not be empty");
     }
-    _config.sync_config = nullptr;
 
     RLMNSStringToStdString(_config.path, path);
     _config.in_memory = false;

+ 2 - 2
Carthage/Checkouts/realm-cocoa/Realm/Realm-Info.plist

@@ -17,11 +17,11 @@
 	<key>CFBundlePackageType</key>
 	<string>FMWK</string>
 	<key>CFBundleShortVersionString</key>
-	<string>4.3.1</string>
+	<string>4.4.0</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>4.3.1</string>
+	<string>4.4.0</string>
 	<key>NSHumanReadableCopyright</key>
 	<string>Copyright © 2014 Realm. All rights reserved.</string>
 	<key>NSPrincipalClass</key>

+ 0 - 37
Carthage/Checkouts/realm-cocoa/RealmSwift/List.swift

@@ -494,7 +494,6 @@ extension List: RealmCollection {
         return _rlmArray
     }
 
-#if swift(>=4)
     /**
      Replace the given `subRange` of elements with `newElements`.
 
@@ -511,23 +510,6 @@ extension List: RealmCollection {
                 insert(x, at: subrange.lowerBound)
             }
     }
-#else
-    /**
-     Replace the given `subRange` of elements with `newElements`.
-
-     - parameter subrange:    The range of elements to be replaced.
-     - parameter newElements: The new elements to be inserted into the List.
-     */
-    public func replaceSubrange<C: Collection>(_ subrange: Range<Int>, with newElements: C)
-        where C.Iterator.Element == Element {
-            for _ in subrange.lowerBound..<subrange.upperBound {
-                remove(at: subrange.lowerBound)
-            }
-            for x in newElements.reversed() {
-                insert(x, at: subrange.lowerBound)
-            }
-    }
-#endif
 
     /// The position of the first element in a non-empty collection.
     /// Identical to endIndex in an empty collection.
@@ -550,7 +532,6 @@ extension List: RealmCollection {
     }
 }
 
-#if swift(>=4.0)
 // MARK: - MutableCollection conformance, range replaceable collection emulation
 extension List: MutableCollection {
 #if swift(>=4.1)
@@ -698,24 +679,6 @@ extension List: MutableCollection {
     }
 #endif
 }
-#else
-// MARK: - RangeReplaceableCollection support
-extension List: RangeReplaceableCollection {
-    /**
-     Removes the last object in the list. The object is not removed from the Realm that manages it.
-
-     - warning: This method may only be called during a write transaction.
-     */
-    public func removeLast() {
-        guard _rlmArray.count > 0 else {
-            throwRealmException("It is not possible to remove an object from an empty list.")
-            return
-        }
-        _rlmArray.removeLastObject()
-    }
-
-}
-#endif
 
 // MARK: - Codable
 

+ 9 - 12
Carthage/Checkouts/realm-cocoa/RealmSwift/Object.swift

@@ -650,18 +650,12 @@ internal class ObjectUtil {
         // one named 'x', and another that is optional and is named 'x.storage'. Note
         // that '.' is illegal in either a Swift or Objective-C property name.
         if let storageRange = name.range(of: ".storage", options: [.anchored, .backwards]) {
-            #if swift(>=4.0)
-                return String(name[..<storageRange.lowerBound])
-            #else
-                return name.substring(to: storageRange.lowerBound)
-            #endif
+            return String(name[..<storageRange.lowerBound])
         }
         // Xcode 11 changed the name of the storage property to "$__lazy_storage_$_propName"
-        #if swift(>=4.0)
-            if let storageRange = name.range(of: "$__lazy_storage_$_", options: [.anchored]) {
-                return String(name[storageRange.upperBound...])
-            }
-        #endif
+        if let storageRange = name.range(of: "$__lazy_storage_$_", options: [.anchored]) {
+            return String(name[storageRange.upperBound...])
+        }
         return nil
     }
 
@@ -736,6 +730,9 @@ internal class ObjectUtil {
             if let objcProp = class_getProperty(cls, label) {
                 var count: UInt32 = 0
                 let attrs = property_copyAttributeList(objcProp, &count)!
+                defer {
+                    free(attrs)
+                }
                 var computed = true
                 for i in 0..<Int(count) {
                     let attr = attrs[i]
@@ -780,11 +777,11 @@ private func forceCastToInferred<T, V>(_ x: T) -> V {
 }
 
 extension Object: AssistedObjectiveCBridgeable {
-    static func bridging(from objectiveCValue: Any, with metadata: Any?) -> Self {
+    internal static func bridging(from objectiveCValue: Any, with metadata: Any?) -> Self {
         return forceCastToInferred(objectiveCValue)
     }
 
-    var bridged: (objectiveCValue: Any, metadata: Any?) {
+    internal var bridged: (objectiveCValue: Any, metadata: Any?) {
         return (objectiveCValue: unsafeCastToRLMObject(), metadata: nil)
     }
 }

+ 6 - 2
Carthage/Checkouts/realm-cocoa/RealmSwift/Realm.swift

@@ -203,19 +203,23 @@ public struct Realm {
                          notified for the changes made in this write transaction.
 
      - parameter block: The block containing actions to perform.
+     - returns: The value returned from the block, if any.
 
      - throws: An `NSError` if the transaction could not be completed successfully.
                If `block` throws, the function throws the propagated `ErrorType` instead.
      */
-    public func write(withoutNotifying tokens: [NotificationToken] = [], _ block: (() throws -> Void)) throws {
+    @discardableResult
+    public func write<Result>(withoutNotifying tokens: [NotificationToken] = [], _ block: (() throws -> Result)) throws -> Result {
         beginWrite()
+        var ret: Result!
         do {
-            try block()
+            ret = try block()
         } catch let error {
             if isInWriteTransaction { cancelWrite() }
             throw error
         }
         if isInWriteTransaction { try commitWrite(withoutNotifying: tokens) }
+        return ret
     }
 
     /**

+ 2 - 2
Carthage/Checkouts/realm-cocoa/RealmSwift/RealmCollection.swift

@@ -1022,12 +1022,12 @@ private struct AnyRealmCollectionBridgingMetadata<T: RealmCollectionValue> {
 }
 
 extension AnyRealmCollection: AssistedObjectiveCBridgeable {
-    static func bridging(from objectiveCValue: Any, with metadata: Any?) -> AnyRealmCollection {
+    internal static func bridging(from objectiveCValue: Any, with metadata: Any?) -> AnyRealmCollection {
         guard let metadata = metadata as? AnyRealmCollectionBridgingMetadata<Element> else { preconditionFailure() }
         return AnyRealmCollection(base: metadata.baseType.bridging(from: objectiveCValue, with: metadata.baseMetadata))
     }
 
-    var bridged: (objectiveCValue: Any, metadata: Any?) {
+    internal var bridged: (objectiveCValue: Any, metadata: Any?) {
         return (
             objectiveCValue: base.bridged.objectiveCValue,
             metadata: AnyRealmCollectionBridgingMetadata(baseMetadata: base.bridged.metadata, baseType: type(of: base))

+ 6 - 7
Carthage/Checkouts/realm-cocoa/RealmSwift/RealmConfiguration.swift

@@ -112,11 +112,10 @@ extension Realm {
 
         /**
          A configuration value used to configure a Realm for synchronization with the Realm Object Server. Mutually
-         exclusive with `inMemoryIdentifier` and `fileURL`.
+         exclusive with `inMemoryIdentifier`.
          */
         public var syncConfiguration: SyncConfiguration? {
             set {
-                _path = nil
                 _inMemoryIdentifier = nil
                 _syncConfiguration = newValue
             }
@@ -127,11 +126,10 @@ extension Realm {
 
         private var _syncConfiguration: SyncConfiguration?
 
-        /// The local URL of the Realm file. Mutually exclusive with `inMemoryIdentifier` and `syncConfiguration`.
+        /// The local URL of the Realm file. Mutually exclusive with `inMemoryIdentifier`.
         public var fileURL: URL? {
             set {
                 _inMemoryIdentifier = nil
-                _syncConfiguration = nil
                 _path = newValue?.path
             }
             get {
@@ -217,13 +215,14 @@ extension Realm {
 
         internal var rlmConfiguration: RLMRealmConfiguration {
             let configuration = RLMRealmConfiguration()
+            if let syncConfiguration = syncConfiguration {
+                configuration.syncConfiguration = syncConfiguration.asConfig()
+            }
             if let fileURL = fileURL {
                 configuration.fileURL = fileURL
             } else if let inMemoryIdentifier = inMemoryIdentifier {
                 configuration.inMemoryIdentifier = inMemoryIdentifier
-            } else if let syncConfiguration = syncConfiguration {
-                configuration.syncConfiguration = syncConfiguration.asConfig()
-            } else {
+            } else if syncConfiguration == nil {
                 fatalError("A Realm Configuration must specify a path or an in-memory identifier.")
             }
             configuration.encryptionKey = self.encryptionKey

+ 2 - 2
Carthage/Checkouts/realm-cocoa/RealmSwift/Results.swift

@@ -408,11 +408,11 @@ extension Results: RealmCollection {
 // MARK: AssistedObjectiveCBridgeable
 
 extension Results: AssistedObjectiveCBridgeable {
-    static func bridging(from objectiveCValue: Any, with metadata: Any?) -> Results {
+    internal static func bridging(from objectiveCValue: Any, with metadata: Any?) -> Results {
         return Results(objectiveCValue as! RLMResults)
     }
 
-    var bridged: (objectiveCValue: Any, metadata: Any?) {
+    internal var bridged: (objectiveCValue: Any, metadata: Any?) {
         return (objectiveCValue: rlmResults, metadata: nil)
     }
 }

+ 23 - 7
Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/KVOTests.swift

@@ -123,20 +123,36 @@ class KVOTests: TestCase {
         changeDictionary = nil
     }
 
-    func observeChange<T: Equatable>(_ obj: SwiftKVOObject, _ keyPath: KeyPath<SwiftKVOObject, T>, _ old: Any?, _ new: Any?,
+    func observeChange<T: Equatable>(_ obj: SwiftKVOObject, _ keyPath: KeyPath<SwiftKVOObject, T>, _ old: T, _ new: T,
                                      fileName: StaticString = #file, lineNumber: UInt = #line, _ block: () -> Void) {
         let kvoOptions: NSKeyValueObservingOptions = [.old, .new]
         var gotNotification = false
         let observation = obj.observe(keyPath, options: kvoOptions) { _, change in
-            if let old = old {
-                XCTAssertEqual(change.oldValue, (old as! T), file: fileName, line: lineNumber)
+            XCTAssertEqual(change.oldValue, old, file: fileName, line: lineNumber)
+            XCTAssertEqual(change.newValue, new, file: fileName, line: lineNumber)
+            gotNotification = true
+        }
+
+        block()
+        observation.invalidate()
+
+        XCTAssertTrue(gotNotification, file: fileName, line: lineNumber)
+    }
+
+    func observeChange<T: Equatable>(_ obj: SwiftKVOObject, _ keyPath: KeyPath<SwiftKVOObject, T?>, _ old: T?, _ new: T?,
+                                     fileName: StaticString = #file, lineNumber: UInt = #line, _ block: () -> Void) {
+        let kvoOptions: NSKeyValueObservingOptions = [.old, .new]
+        var gotNotification = false
+        let observation = obj.observe(keyPath, options: kvoOptions) { _, change in
+            if let oldValue = change.oldValue {
+                XCTAssertEqual(oldValue, old, file: fileName, line: lineNumber)
             } else {
-                XCTAssertNil(change.oldValue, file: fileName, line: lineNumber)
+                XCTAssertNil(old, file: fileName, line: lineNumber)
             }
-            if let new = new {
-                XCTAssertEqual(change.newValue, (new as! T), file: fileName, line: lineNumber)
+            if let newValue = change.newValue {
+                XCTAssertEqual(newValue, new, file: fileName, line: lineNumber)
             } else {
-                XCTAssertNil(change.newValue, file: fileName, line: lineNumber)
+                XCTAssertNil(new, file: fileName, line: lineNumber)
             }
             gotNotification = true
         }

+ 0 - 12
Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/ListTests.swift

@@ -75,7 +75,6 @@ class ListTests: TestCase {
         super.tearDown()
     }
 
-#if swift(>=4)
     override class var defaultTestSuite: XCTestSuite {
         // Don't run tests for the base class
         if isEqual(ListTests.self) {
@@ -83,15 +82,6 @@ class ListTests: TestCase {
         }
         return super.defaultTestSuite
     }
-#else
-    override class func defaultTestSuite() -> XCTestSuite {
-        // Don't run tests for the base class
-        if isEqual(ListTests.self) {
-            return XCTestSuite(name: "empty")
-        }
-        return super.defaultTestSuite()
-    }
-#endif
 
     func testPrimitive() {
         let obj = SwiftListObject()
@@ -723,7 +713,6 @@ class ListRRCMethodsTests: XCTestCase {
         array = makeArray(from: list)
     }
 
-#if swift(>=4.0)
     func testSubscript() {
         list[1..<4] = createListObject([10, 11, 12]).intArray[0..<2]
         array[1..<4] = [10, 11]
@@ -741,7 +730,6 @@ class ListRRCMethodsTests: XCTestCase {
         list.removeSubrange(list.indices)
         XCTAssertTrue(list.isEmpty)
     }
-#endif
 
     func testRemoveFirst() {
         list.removeFirst()

+ 1 - 1
Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/MigrationTests.swift

@@ -194,7 +194,7 @@ class MigrationTests: TestCase {
             XCTAssertEqual(count, 1)
         }
 
-        autoreleasepool {
+        _ = autoreleasepool {
             try! Realm().write {
                 try! Realm().create(SwiftArrayPropertyObject.self, value: ["string", [["array"]], [[2]]])
             }

+ 0 - 36
Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/PerformanceTests.swift

@@ -37,7 +37,6 @@ private var largeRealm: Realm!
 private let isRunningOnDevice = TARGET_IPHONE_SIMULATOR == 0
 
 class SwiftPerformanceTests: TestCase {
-#if swift(>=4)
     override class var defaultTestSuite: XCTestSuite {
         #if !DEBUG && os(iOS)
             if isRunningOnDevice {
@@ -46,16 +45,6 @@ class SwiftPerformanceTests: TestCase {
         #endif
         return XCTestSuite(name: "SwiftPerformanceTests")
     }
-#else
-    override class func defaultTestSuite() -> XCTestSuite {
-#if !DEBUG && os(iOS) && !TARGET_OS_MACCATALYST
-        if isRunningOnDevice {
-            return super.defaultTestSuite()
-        }
-#endif
-        return XCTestSuite(name: "SwiftPerformanceTests")
-    }
-#endif
 
     override class func setUp() {
         super.setUp()
@@ -77,7 +66,6 @@ class SwiftPerformanceTests: TestCase {
         // Do nothing, as we need to keep our in-memory realms around between tests
     }
 
-#if swift(>=4)
     override func measure(_ block: (() -> Void)) {
         super.measure {
             autoreleasepool {
@@ -100,30 +88,6 @@ class SwiftPerformanceTests: TestCase {
         }
     }
 
-#else
-    override func measure(_ block: @escaping (() -> Void)) {
-        super.measure {
-            autoreleasepool {
-                block()
-            }
-        }
-    }
-
-    override func measureMetrics(_ metrics: [String], automaticallyStartMeasuring: Bool, for block: @escaping () -> Void) {
-        super.measureMetrics(metrics, automaticallyStartMeasuring: automaticallyStartMeasuring) {
-            autoreleasepool {
-                block()
-            }
-        }
-    }
-
-    func inMeasureBlock(block: @escaping () -> Void) {
-        measureMetrics(type(of: self).defaultPerformanceMetrics(), automaticallyStartMeasuring: false) {
-            _ = block()
-        }
-    }
-#endif
-
     private func copyRealmToTestPath(_ realm: Realm) -> Realm {
         do {
             try FileManager.default.removeItem(at: testRealmURL())

+ 0 - 18
Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/PrimitiveListTests.swift

@@ -265,15 +265,9 @@ class PrimitiveListTestsBase<O: ObjectFactory, V: ValueFactory>: TestCase {
     var array: List<V.T>!
     var values: [V.T]!
 
-#if swift(>=4)
     class func _defaultTestSuite() -> XCTestSuite {
         return defaultTestSuite
     }
-#else
-    class func _defaultTestSuite() -> XCTestSuite {
-        return defaultTestSuite()
-    }
-#endif
 
     override func setUp() {
         obj = SwiftListObject()
@@ -685,15 +679,9 @@ class UnmanagedPrimitiveListTests: TestCase {
         return suite
     }
 
-#if swift(>=4)
     override class var defaultTestSuite: XCTestSuite {
         return _defaultTestSuite()
     }
-#else
-    override class func defaultTestSuite() -> XCTestSuite {
-        return _defaultTestSuite()
-    }
-#endif
 }
 
 class ManagedPrimitiveListTests: TestCase {
@@ -724,13 +712,7 @@ class ManagedPrimitiveListTests: TestCase {
         return suite
     }
 
-#if swift(>=4)
     override class var defaultTestSuite: XCTestSuite {
         return _defaultTestSuite()
     }
-#else
-    override class func defaultTestSuite() -> XCTestSuite {
-        return _defaultTestSuite()
-    }
-#endif
 }

+ 0 - 30
Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/RealmCollectionTypeTests.swift

@@ -145,7 +145,6 @@ class RealmCollectionTypeTests: TestCase {
         super.tearDown()
     }
 
-#if swift(>=4)
     override class var defaultTestSuite: XCTestSuite {
         // Don't run tests for the base class
         if isEqual(RealmCollectionTypeTests.self) {
@@ -153,15 +152,6 @@ class RealmCollectionTypeTests: TestCase {
         }
         return super.defaultTestSuite
     }
-#else
-    override class func defaultTestSuite() -> XCTestSuite {
-        // Don't run tests for the base class
-        if isEqual(RealmCollectionTypeTests.self) {
-            return XCTestSuite(name: "empty")
-        }
-        return super.defaultTestSuite()
-    }
-#endif
 
     func testRealm() {
         guard let collection = collection else {
@@ -566,7 +556,6 @@ class RealmCollectionTypeTests: TestCase {
 // MARK: Results
 
 class ResultsTests: RealmCollectionTypeTests {
-#if swift(>=4)
     override class var defaultTestSuite: XCTestSuite {
         // Don't run tests for the base class
         if isEqual(ResultsTests.self) {
@@ -574,15 +563,6 @@ class ResultsTests: RealmCollectionTypeTests {
         }
         return super.defaultTestSuite
     }
-#else
-    override class func defaultTestSuite() -> XCTestSuite {
-        // Don't run tests for the base class
-        if isEqual(ResultsTests.self) {
-            return XCTestSuite(name: "empty")
-        }
-        return super.defaultTestSuite()
-    }
-#endif
 
     func collectionBaseInWriteTransaction() -> Results<CTTNullableStringObjectWithLink> {
         fatalError("abstract")
@@ -808,7 +788,6 @@ class ResultsFromLinkViewTests: ResultsTests {
 // MARK: List
 
 class ListRealmCollectionTypeTests: RealmCollectionTypeTests {
-#if swift(>=4)
     override class var defaultTestSuite: XCTestSuite {
         // Don't run tests for the base class
         if isEqual(ListRealmCollectionTypeTests.self) {
@@ -816,15 +795,6 @@ class ListRealmCollectionTypeTests: RealmCollectionTypeTests {
         }
         return super.defaultTestSuite
     }
-#else
-    override class func defaultTestSuite() -> XCTestSuite {
-        // Don't run tests for the base class
-        if isEqual(ListRealmCollectionTypeTests.self) {
-            return XCTestSuite(name: "empty")
-        }
-        return super.defaultTestSuite()
-    }
-#endif
 
     func collectionBaseInWriteTransaction() -> List<CTTNullableStringObjectWithLink> {
         fatalError("abstract")

+ 8 - 0
Carthage/Checkouts/realm-cocoa/RealmSwift/Tests/RealmTests.swift

@@ -249,6 +249,14 @@ class RealmTests: TestCase {
         XCTAssertEqual(try! Realm().objects(SwiftStringObject.self).count, 1)
     }
 
+    func testWriteReturning() {
+        let realm = try! Realm()
+        let object = try! realm.write {
+            return realm.create(SwiftStringObject.self, value: ["1"])
+        }
+        XCTAssertEqual(object.stringCol, "1")
+    }
+
     func testCommitWrite() {
         try! Realm().beginWrite()
         try! Realm().create(SwiftStringObject.self, value: ["1"])

+ 12 - 12
Carthage/Checkouts/realm-cocoa/RealmSwift/Util.swift

@@ -117,55 +117,55 @@ internal protocol CustomObjectiveCBridgeable {
 // FIXME: needed with swift 3.2
 // Double isn't though?
 extension Float: CustomObjectiveCBridgeable {
-    static func bridging(objCValue: Any) -> Float {
+    internal static func bridging(objCValue: Any) -> Float {
         return (objCValue as! NSNumber).floatValue
     }
-    var objCValue: Any {
+    internal var objCValue: Any {
         return NSNumber(value: self)
     }
 }
 
 extension Int8: CustomObjectiveCBridgeable {
-    static func bridging(objCValue: Any) -> Int8 {
+    internal static func bridging(objCValue: Any) -> Int8 {
         return (objCValue as! NSNumber).int8Value
     }
-    var objCValue: Any {
+    internal var objCValue: Any {
         return NSNumber(value: self)
     }
 }
 extension Int16: CustomObjectiveCBridgeable {
-    static func bridging(objCValue: Any) -> Int16 {
+    internal static func bridging(objCValue: Any) -> Int16 {
         return (objCValue as! NSNumber).int16Value
     }
-    var objCValue: Any {
+    internal var objCValue: Any {
         return NSNumber(value: self)
     }
 }
 extension Int32: CustomObjectiveCBridgeable {
-    static func bridging(objCValue: Any) -> Int32 {
+    internal static func bridging(objCValue: Any) -> Int32 {
         return (objCValue as! NSNumber).int32Value
     }
-    var objCValue: Any {
+    internal var objCValue: Any {
         return NSNumber(value: self)
     }
 }
 extension Int64: CustomObjectiveCBridgeable {
-    static func bridging(objCValue: Any) -> Int64 {
+    internal static func bridging(objCValue: Any) -> Int64 {
         return (objCValue as! NSNumber).int64Value
     }
-    var objCValue: Any {
+    internal var objCValue: Any {
         return NSNumber(value: self)
     }
 }
 extension Optional: CustomObjectiveCBridgeable {
-    static func bridging(objCValue: Any) -> Optional {
+    internal static func bridging(objCValue: Any) -> Optional {
         if objCValue is NSNull {
             return nil
         } else {
             return .some(dynamicBridgeCast(fromObjectiveC: objCValue))
         }
     }
-    var objCValue: Any {
+    internal var objCValue: Any {
         if let value = self {
             return dynamicBridgeCast(fromSwift: value)
         } else {

+ 12 - 17
Carthage/Checkouts/realm-cocoa/build.sh

@@ -154,7 +154,7 @@ build_combined() {
         destination="iPhone 8"
     elif [[ "$os" == "watchos"  ]]; then
         os_name="$os"
-        destination="Apple Watch Series 3 - 42mm"
+        destination="Apple Watch Series 4 - 40mm"
     elif [[ "$os" == "appletvos"  ]]; then
         os_name="tvos"
         destination="Apple TV"
@@ -175,21 +175,7 @@ build_combined() {
 
     # Combine .swiftmodule
     if [ -d $simulator_path/Modules/$module_name.swiftmodule ]; then
-      cp $simulator_path/Modules/$module_name.swiftmodule/* $os_path/Modules/$module_name.swiftmodule/
-    fi
-
-    # Xcode 10.2 merges the generated headers together with ifdef guards for
-    # each of the target platforms. This doesn't handle merging
-    # device/simulator builds, so we need to take care of that ourselves.
-    # Currently all platforms have identical headers, so we just pick one and
-    # use that rather than merging, but this may change in the future.
-    if [ -f $os_path/Headers/$module_name-Swift.h ]; then
-      unique_headers=$(find $build_intermediates_path -name $module_name-Swift.h -exec shasum {} \; | cut -d' ' -f 1 | uniq | grep -c '^')
-      if [ $unique_headers != "1" ]; then
-        echo "Platform-specific Swift generated headers are not identical. Merging them is required and is not yet implemented."
-        exit 1
-      fi
-      find $build_intermediates_path -name $module_name-Swift.h -exec cp {} $os_path/Headers \; -quit
+      cp -R $simulator_path/Modules/$module_name.swiftmodule/* $os_path/Modules/$module_name.swiftmodule/
     fi
 
     # Copy *.bcsymbolmap to .framework for submitting app with bitcode
@@ -202,6 +188,13 @@ build_combined() {
     LIPO_OUTPUT="$out_path/$product_name/$module_name"
     xcrun lipo -create "$simulator_path/$binary_path" "$os_path/$binary_path" -output "$LIPO_OUTPUT"
 
+    # The generated headers for Swift libraries have #ifdef checks to only
+    # define symbols for the applicable platforms, so we need to merge them as
+    # well.
+    if [ -f "$out_path/$product_name/Headers/$module_name-Swift.h" ]; then
+        cat "$simulator_path/Headers/$module_name-Swift.h" >> "$out_path/$product_name/Headers/$module_name-Swift.h"
+    fi
+
     # Verify that the combined library has bitcode and we didn't accidentally
     # remove it somewhere along the line
     if [[ "$destination" != "" && "$config" == "Release" ]]; then
@@ -1164,6 +1157,8 @@ case "$COMMAND" in
         sed -i '' "s/^VERSION=.*/VERSION=$realm_version/" dependencies.list
         sed -i '' "s/^let coreVersionStr =.*/let coreVersionStr = \"$REALM_CORE_VERSION\"/" Package.swift
         sed -i '' "s/^let cocoaVersionStr =.*/let cocoaVersionStr = \"$realm_version\"/" Package.swift
+        sed -i '' "s/x.y.z Release notes (yyyy-MM-dd)/$realm_version Release notes ($(date '+%Y-%m-%d'))/" CHANGELOG.md
+
         exit 0
         ;;
 
@@ -1550,7 +1545,7 @@ x.y.z Release notes (yyyy-MM-dd)
 * File format: Generates Realms with format v9 (Reads and upgrades all previous formats)
 * Realm Object Server: 3.21.0 or later.
 * APIs are backwards compatible with all previous releases in the 4.x.y series.
-* Carthage release for Swift is built with Xcode 11.3.
+* Carthage release for Swift is built with Xcode 11.4.
 
 ### Internal
 Upgraded realm-core from ? to ?

+ 2 - 2
Carthage/Checkouts/realm-cocoa/dependencies.list

@@ -1,4 +1,4 @@
-VERSION=4.3.1
+VERSION=4.4.0
 REALM_CORE_VERSION=5.23.8
-REALM_SYNC_VERSION=4.9.4
+REALM_SYNC_VERSION=4.9.5
 REALM_OBJECT_SERVER_VERSION=3.23.1

+ 1 - 1
Carthage/Checkouts/realm-cocoa/scripts/package_examples.rb

@@ -41,7 +41,7 @@ base_examples = [
   "examples/tvos/swift",
 ]
 
-xcode_versions = %w(10.0 10.1 10.3 11.1 11.2.1 11.3)
+xcode_versions = %w(10.3 11.1 11.2.1 11.3 11.4)
 
 # Remove reference to Realm.xcodeproj from all example workspaces.
 base_examples.each do |example|

+ 3 - 0
iOSClient/AppDelegate.h

@@ -107,7 +107,10 @@
 @property (nonatomic, strong) NSMutableDictionary *listMainVC;
 @property (nonatomic, strong) NSMutableDictionary *listProgressMetadata;
 @property (nonatomic, strong) NSMutableArray *filterocId;
+
 @property (nonatomic, strong) NSMutableArray *arrayDeleteMetadata;
+@property (nonatomic, strong) NSMutableArray *arrayCopyMoveMetadata;
+@property (nonatomic, strong) NSMutableArray *arrayCopyMoveServerUrlTo;
 
 @property (nonatomic) UIUserInterfaceStyle preferredUserInterfaceStyle API_AVAILABLE(ios(12.0));
 

+ 3 - 1
iOSClient/AppDelegate.m

@@ -84,7 +84,9 @@
     self.listProgressMetadata = [[NSMutableDictionary alloc] init];
     self.listMainVC = [[NSMutableDictionary alloc] init];
     self.arrayDeleteMetadata = [NSMutableArray new];
-    
+    self.arrayCopyMoveMetadata = [NSMutableArray new];
+    self.arrayCopyMoveServerUrlTo = [NSMutableArray new];
+
     // Push Notification
     [application registerForRemoteNotifications];
     

+ 2 - 2
iOSClient/CCGlobal.h

@@ -340,8 +340,8 @@
 #define k_notificationCenter_createFolder               @"createFolder"                     // userInfo: fileName, serverUrl, errorCode, errorDescription
 #define k_notificationCenter_deleteFile                 @"deleteFile"                       // userInfo: metadata, errorCode, errorDescription
 #define k_notificationCenter_renameFile                 @"renameFile"                       // userInfo: metadata, errorCode, errorDescription
-#define k_notificationCenter_moveFile                   @"moveFile"                         // userInfo: metadata, errorCode, errorDescription
-#define k_notificationCenter_copyFile                   @"copyFile"                         // userInfo: metadata, errorCode, errorDescription
+#define k_notificationCenter_moveFile                   @"moveFile"                         // userInfo: metadata, errorCode, serverUrlTo, errorDescription
+#define k_notificationCenter_copyFile                   @"copyFile"                         // userInfo: metadata, errorCode, serverUrlTo, errorDescription
 #define k_notificationCenter_favoriteFile               @"favoriteFile"                     // userInfo: metadata, favorite, errorCode, errorDescription
 #define k_notificationCenter_menuSearchTextPDF          @"menuSearchTextPDF"
 #define k_notificationCenter_menuDownloadImage          @"menuDownloadImage"

+ 42 - 0
iOSClient/Main/CCMain.m

@@ -132,6 +132,7 @@
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deleteFile:) name:k_notificationCenter_deleteFile object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(favoriteFile:) name:k_notificationCenter_favoriteFile object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(renameFile:) name:k_notificationCenter_renameFile object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moveFile:) name:k_notificationCenter_moveFile object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(createFolder:) name:k_notificationCenter_createFolder object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeTheming) name:k_notificationCenter_changeTheming object:nil];
     
@@ -462,6 +463,25 @@
     }
 }
 
+- (void)moveFile:(NSNotification *)notification
+{
+    if (self.view.window == nil) { return; }
+    
+    NSDictionary *userInfo = notification.userInfo;
+    tableMetadata *metadata = userInfo[@"metadata"];
+    NSString *serverUrlTo = userInfo[@"serverUrlTo"];
+    NSInteger errorCode = [userInfo[@"errorCode"] integerValue];
+    NSString *errorDescription = userInfo[@"errorDescription"];
+    
+    if (errorCode == 0) {
+        if ([metadata.serverUrl isEqualToString:self.serverUrl] || [serverUrlTo isEqualToString:self.serverUrl]) {
+            [[NCMainCommon sharedInstance] reloadDatasourceWithServerUrl:self.serverUrl ocId:nil action:k_action_NULL];
+        }
+    } else {
+        [[NCContentPresenter shared] messageNotification:@"_error_" description:errorDescription delay:k_dismissAfterSecond type:messageTypeError errorCode:errorCode];
+    }
+}
+
 - (void)favoriteFile:(NSNotification *)notification
 {
     if (self.view.window == nil) { return; }
@@ -1545,6 +1565,27 @@
 
 - (void)moveFileOrFolderMetadata:(tableMetadata *)metadata serverUrlTo:(NSString *)serverUrlTo numFile:(NSInteger)numFile ofFile:(NSInteger)ofFile
 {
+    if (_isSelectedMode && [_selectedocIdsMetadatas count] == 0)
+        return;
+     
+    if ([_selectedocIdsMetadatas count] > 0) {
+        for (tableMetadata *metadataSelect in _selectedocIdsMetadatas) {
+            [appDelegate.arrayCopyMoveMetadata addObject:metadataSelect];
+            [appDelegate.arrayCopyMoveServerUrlTo addObject:serverUrlTo];
+        }
+        [appDelegate.arrayCopyMoveMetadata addObjectsFromArray:[_selectedocIdsMetadatas allValues]];
+    } else {
+        [appDelegate.arrayCopyMoveMetadata addObject:self.metadata];
+        [appDelegate.arrayCopyMoveServerUrlTo addObject:serverUrlTo];
+    }
+    
+    [[NCNetworking sharedInstance] moveMetadata:metadata serverUrlTo:serverUrlTo overwrite:true completion:^(NSInteger errorCode, NSString * errorDesctiption) { }];
+    
+    [appDelegate.arrayCopyMoveMetadata removeObjectAtIndex:0];
+    [appDelegate.arrayCopyMoveServerUrlTo removeObjectAtIndex:0];
+
+    
+    /*
     // verify permission
     BOOL permission = [[NCUtility sharedInstance] permissionsContainsString:metadata.permissions permissions:k_permission_can_move];
     if (![metadata.permissions isEqualToString:@""] && permission == false) {
@@ -1648,6 +1689,7 @@
             NSLog(@"[LOG] It has been changed user during networking process, error.");
         }
     }];
+    */
 }
 
 // DELEGATE : Select

+ 5 - 5
iOSClient/Networking/NCNetworking.swift

@@ -459,11 +459,11 @@ import NCCommunication
         }
     }
     
-    private func moveMetadata(_ metadata: tableMetadata, serverUrlTo: String, overwrite: Bool, completion: @escaping (_ errorCode: Int, _ errorDescription: String?)->()) {
+    @objc func moveMetadata(_ metadata: tableMetadata, serverUrlTo: String, overwrite: Bool, completion: @escaping (_ errorCode: Int, _ errorDescription: String?)->()) {
     
         let permission = NCUtility.sharedInstance.permissionsContainsString(metadata.permissions, permissions: k_permission_can_rename)
         if !(metadata.permissions == "") && !permission {
-            self.NotificationPost(name: k_notificationCenter_renameFile, userInfo: ["metadata": metadata, "errorCode": Int(k_CCErrorInternalError)], errorDescription: "_no_permission_modify_file_", completion: completion)
+            self.NotificationPost(name: k_notificationCenter_renameFile, userInfo: ["metadata": metadata, "serverUrlTo": serverUrlTo, "errorCode": Int(k_CCErrorInternalError)], errorDescription: "_no_permission_modify_file_", completion: completion)
             return
         }
         
@@ -485,15 +485,15 @@ import NCCommunication
                 NCManageDatabase.sharedInstance.clearDateRead(serverUrl: serverUrlTo, account: account)
             }
                     
-            self.NotificationPost(name: k_notificationCenter_moveFile, userInfo: ["metadata": metadata, "errorCode": errorCode], errorDescription: errorDescription, completion: completion)
+            self.NotificationPost(name: k_notificationCenter_moveFile, userInfo: ["metadata": metadata, "serverUrlTo": serverUrlTo, "errorCode": errorCode], errorDescription: errorDescription, completion: completion)
         }
     }
     
-    private func copyMetadata(_ metadata: tableMetadata, serverUrlTo: String, overwrite: Bool, completion: @escaping (_ errorCode: Int, _ errorDescription: String?)->()) {
+    @objc func copyMetadata(_ metadata: tableMetadata, serverUrlTo: String, overwrite: Bool, completion: @escaping (_ errorCode: Int, _ errorDescription: String?)->()) {
     
         let permission = NCUtility.sharedInstance.permissionsContainsString(metadata.permissions, permissions: k_permission_can_rename)
         if !(metadata.permissions == "") && !permission {
-            self.NotificationPost(name: k_notificationCenter_renameFile, userInfo: ["metadata": metadata, "errorCode": Int(k_CCErrorInternalError)], errorDescription: "_no_permission_modify_file_", completion: completion)
+            self.NotificationPost(name: k_notificationCenter_renameFile, userInfo: ["metadata": metadata, "serverUrlTo": serverUrlTo, "errorCode": Int(k_CCErrorInternalError)], errorDescription: "_no_permission_modify_file_", completion: completion)
             return
         }