diff --git a/CHANGES.md b/CHANGES.md index a9e708f354..404ac4b973 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,8 @@ +## Changes in 0.27.6 (2024-02-07) + +No significant changes. + + ## Changes in 0.27.5 (2024-01-09) 🐛 Bugfixes diff --git a/MatrixSDK.podspec b/MatrixSDK.podspec index c0ccd57631..84c8b1b3df 100644 --- a/MatrixSDK.podspec +++ b/MatrixSDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "MatrixSDK" - s.version = "0.27.5" + s.version = "0.27.6" s.summary = "The iOS SDK to build apps compatible with Matrix (https://www.matrix.org)" s.description = <<-DESC diff --git a/MatrixSDK.xcodeproj/project.pbxproj b/MatrixSDK.xcodeproj/project.pbxproj index e24eca391a..f87c534481 100644 --- a/MatrixSDK.xcodeproj/project.pbxproj +++ b/MatrixSDK.xcodeproj/project.pbxproj @@ -8346,7 +8346,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; - OTHER_SWIFT_FLAGS = "-D DEBUG"; + OTHER_SWIFT_FLAGS = "-D DEBUG -D IS_TEST_RUN"; SDKROOT = ""; SWIFT_SWIFT3_OBJC_INFERENCE = On; SWIFT_VERSION = 5.0; diff --git a/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXBeaconInfoSummaryRealmStore.swift b/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXBeaconInfoSummaryRealmStore.swift index a67ca8d1d5..5545ad8478 100644 --- a/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXBeaconInfoSummaryRealmStore.swift +++ b/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXBeaconInfoSummaryRealmStore.swift @@ -15,7 +15,7 @@ // import Foundation -import Realm +@_implementationOnly import Realm @objcMembers public class MXBeaconInfoSummaryRealmStore: NSObject { @@ -155,10 +155,11 @@ public class MXBeaconInfoSummaryRealmStore: NSObject { private func beaconInfoSummaries(from realmBeaconInfoSummaryResults: RLMResults) -> [MXBeaconInfoSummary] { var summaries: [MXBeaconInfoSummary] = [] - - for realmSummary in realmBeaconInfoSummaryResults { + + var iterator = NSFastEnumerationIterator(realmBeaconInfoSummaryResults) + while let realmSummary = iterator.next() as? MXRealmBeaconInfoSummary { - if let realmBeaconInfoSummary = realmSummary as? MXRealmBeaconInfoSummary, let summary = self.mapper.beaconInfoSummary(from: realmBeaconInfoSummary) { + if let summary = self.mapper.beaconInfoSummary(from: realmSummary) { summaries.append(summary) } } diff --git a/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeacon.swift b/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeacon.swift index df77263b9b..e31e3efd66 100644 --- a/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeacon.swift +++ b/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeacon.swift @@ -15,7 +15,7 @@ // import Foundation -import Realm +@_implementationOnly import Realm class MXRealmBeacon: RLMObject { diff --git a/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeaconInfo.swift b/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeaconInfo.swift index 5774fa584b..0ffc19fcb8 100644 --- a/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeaconInfo.swift +++ b/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeaconInfo.swift @@ -15,7 +15,7 @@ // import Foundation -import Realm +@_implementationOnly import Realm class MXRealmBeaconInfo: RLMObject { diff --git a/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeaconInfoSummary.swift b/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeaconInfoSummary.swift index 74a23a7974..f57a9ede9e 100644 --- a/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeaconInfoSummary.swift +++ b/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeaconInfoSummary.swift @@ -15,7 +15,7 @@ // import Foundation -import Realm +@_implementationOnly import Realm class MXRealmBeaconInfoSummary: RLMObject { diff --git a/MatrixSDK/Background/Crypto/MXBackgroundCryptoV2.swift b/MatrixSDK/Background/Crypto/MXBackgroundCryptoV2.swift index a785fb0168..c3a22a8b0d 100644 --- a/MatrixSDK/Background/Crypto/MXBackgroundCryptoV2.swift +++ b/MatrixSDK/Background/Crypto/MXBackgroundCryptoV2.swift @@ -16,7 +16,7 @@ import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// An implementation of `MXBackgroundCrypto` which uses [matrix-rust-sdk](https://github.com/matrix-org/matrix-rust-sdk/tree/main/crates/matrix-sdk-crypto) /// under the hood. diff --git a/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventDecryption.swift b/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventDecryption.swift index 39545956db..7ba577845b 100644 --- a/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventDecryption.swift +++ b/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventDecryption.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// Object responsible for decrypting room events and dealing with undecryptable events protocol MXRoomEventDecrypting: Actor { diff --git a/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventEncryption.swift b/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventEncryption.swift index fe9fa93268..cd6f91d9e5 100644 --- a/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventEncryption.swift +++ b/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventEncryption.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// Object responsible for encrypting room events and ensuring that room keys are distributed to room members protocol MXRoomEventEncrypting { diff --git a/MatrixSDK/Crypto/CrossSigning/Data/MXCryptoUserIdentityWrapper.swift b/MatrixSDK/Crypto/CrossSigning/Data/MXCryptoUserIdentityWrapper.swift index fe8df357e7..aa42d7e32f 100644 --- a/MatrixSDK/Crypto/CrossSigning/Data/MXCryptoUserIdentityWrapper.swift +++ b/MatrixSDK/Crypto/CrossSigning/Data/MXCryptoUserIdentityWrapper.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// Convenience wrapper around `MatrixSDKCrypto`'s `UserIdentity` /// which can be used to create `MatrixSDK`s `MXCrossSigningInfo` diff --git a/MatrixSDK/Crypto/CryptoMachine/Extensions/EventEncryptionAlgorithm+String.swift b/MatrixSDK/Crypto/CryptoMachine/Extensions/EventEncryptionAlgorithm+String.swift index 21f5919733..f022605b4c 100644 --- a/MatrixSDK/Crypto/CryptoMachine/Extensions/EventEncryptionAlgorithm+String.swift +++ b/MatrixSDK/Crypto/CryptoMachine/Extensions/EventEncryptionAlgorithm+String.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto extension EventEncryptionAlgorithm { enum Error: Swift.Error { diff --git a/MatrixSDK/Crypto/CryptoMachine/Extensions/MXDeviceVerification+LocalTrust.swift b/MatrixSDK/Crypto/CryptoMachine/Extensions/MXDeviceVerification+LocalTrust.swift index e5287ce91d..ffae8e5323 100644 --- a/MatrixSDK/Crypto/CryptoMachine/Extensions/MXDeviceVerification+LocalTrust.swift +++ b/MatrixSDK/Crypto/CryptoMachine/Extensions/MXDeviceVerification+LocalTrust.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto extension MXDeviceVerification { var localTrust: LocalTrust { diff --git a/MatrixSDK/Crypto/CryptoMachine/Extensions/MXEventDecryptionResult+DecryptedEvent.swift b/MatrixSDK/Crypto/CryptoMachine/Extensions/MXEventDecryptionResult+DecryptedEvent.swift index b7d0249262..8f715e6bb6 100644 --- a/MatrixSDK/Crypto/CryptoMachine/Extensions/MXEventDecryptionResult+DecryptedEvent.swift +++ b/MatrixSDK/Crypto/CryptoMachine/Extensions/MXEventDecryptionResult+DecryptedEvent.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto extension MXEventDecryptionResult { enum Error: Swift.Error { diff --git a/MatrixSDK/Crypto/CryptoMachine/Extensions/MXRoomHistoryVisibility+HistoryVisibility.swift b/MatrixSDK/Crypto/CryptoMachine/Extensions/MXRoomHistoryVisibility+HistoryVisibility.swift index a073deddb6..4a92183a32 100644 --- a/MatrixSDK/Crypto/CryptoMachine/Extensions/MXRoomHistoryVisibility+HistoryVisibility.swift +++ b/MatrixSDK/Crypto/CryptoMachine/Extensions/MXRoomHistoryVisibility+HistoryVisibility.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto extension MXRoomHistoryVisibility { var visibility: HistoryVisibility { diff --git a/MatrixSDK/Crypto/CryptoMachine/MXCryptoMachine.swift b/MatrixSDK/Crypto/CryptoMachine/MXCryptoMachine.swift index 370cf71aff..faae806bd1 100644 --- a/MatrixSDK/Crypto/CryptoMachine/MXCryptoMachine.swift +++ b/MatrixSDK/Crypto/CryptoMachine/MXCryptoMachine.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto typealias GetRoomAction = (String) -> MXRoom? diff --git a/MatrixSDK/Crypto/CryptoMachine/MXCryptoProtocols.swift b/MatrixSDK/Crypto/CryptoMachine/MXCryptoProtocols.swift index b9b4dabc75..1366842ec6 100644 --- a/MatrixSDK/Crypto/CryptoMachine/MXCryptoProtocols.swift +++ b/MatrixSDK/Crypto/CryptoMachine/MXCryptoProtocols.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// A set of protocols defining the functionality in `MatrixSDKCrypto` and separating them into logical units diff --git a/MatrixSDK/Crypto/CryptoMachine/MXCryptoRequests.swift b/MatrixSDK/Crypto/CryptoMachine/MXCryptoRequests.swift index 5703725543..e4d111aba3 100644 --- a/MatrixSDK/Crypto/CryptoMachine/MXCryptoRequests.swift +++ b/MatrixSDK/Crypto/CryptoMachine/MXCryptoRequests.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// Convenience class to delegate network requests originating in Rust crypto module /// to the native REST API client diff --git a/MatrixSDK/Crypto/CryptoMachine/MXCryptoSDKLogger.swift b/MatrixSDK/Crypto/CryptoMachine/MXCryptoSDKLogger.swift index 9c84ce7d78..57fff5b941 100644 --- a/MatrixSDK/Crypto/CryptoMachine/MXCryptoSDKLogger.swift +++ b/MatrixSDK/Crypto/CryptoMachine/MXCryptoSDKLogger.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// Redirects logs originating in `MatrixSDKCrypto` into `MXLog` class MXCryptoSDKLogger: Logger { diff --git a/MatrixSDK/Crypto/Dehydration/DehydrationService.swift b/MatrixSDK/Crypto/Dehydration/DehydrationService.swift index 6f4ccb9c77..0c2902a28d 100644 --- a/MatrixSDK/Crypto/Dehydration/DehydrationService.swift +++ b/MatrixSDK/Crypto/Dehydration/DehydrationService.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto enum DehydrationServiceError: Error { case failedDehydration(Error) diff --git a/MatrixSDK/Crypto/Devices/Data/MXCryptoDeviceWrapper.swift b/MatrixSDK/Crypto/Devices/Data/MXCryptoDeviceWrapper.swift index d85be87c63..28c432f35f 100644 --- a/MatrixSDK/Crypto/Devices/Data/MXCryptoDeviceWrapper.swift +++ b/MatrixSDK/Crypto/Devices/Data/MXCryptoDeviceWrapper.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// Convenience wrapper around `MatrixSDKCrypto`'s `Device` /// which can be used to create `MatrixSDK`s `MXDeviceInfo` diff --git a/MatrixSDK/Crypto/KeyBackup/Engine/MXCryptoKeyBackupEngine.swift b/MatrixSDK/Crypto/KeyBackup/Engine/MXCryptoKeyBackupEngine.swift index c7338e8bdc..8d62a63630 100644 --- a/MatrixSDK/Crypto/KeyBackup/Engine/MXCryptoKeyBackupEngine.swift +++ b/MatrixSDK/Crypto/KeyBackup/Engine/MXCryptoKeyBackupEngine.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXCryptoKeyBackupEngine: NSObject, MXKeyBackupEngine { // Batch size chosen arbitrarily, will be moved to CryptoSDK diff --git a/MatrixSDK/Crypto/MXCryptoV2.swift b/MatrixSDK/Crypto/MXCryptoV2.swift index 2e5c642b7d..dc1ea06d21 100644 --- a/MatrixSDK/Crypto/MXCryptoV2.swift +++ b/MatrixSDK/Crypto/MXCryptoV2.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// An implementation of `MXCrypto` which uses [matrix-rust-sdk](https://github.com/matrix-org/matrix-rust-sdk/tree/main/crates/matrix-sdk-crypto) /// under the hood. diff --git a/MatrixSDK/Crypto/Migration/Data/MXCryptoMigrationStore.swift b/MatrixSDK/Crypto/Migration/Data/MXCryptoMigrationStore.swift index 741ea8ed56..0db0770235 100644 --- a/MatrixSDK/Crypto/Migration/Data/MXCryptoMigrationStore.swift +++ b/MatrixSDK/Crypto/Migration/Data/MXCryptoMigrationStore.swift @@ -15,8 +15,8 @@ // import Foundation -import OLMKit -import MatrixSDKCrypto +@_implementationOnly import OLMKit +@_implementationOnly import MatrixSDKCrypto struct MXCryptoMigrationStore { struct GlobalSettings { diff --git a/MatrixSDK/Crypto/Migration/MXCryptoMigrationV2.swift b/MatrixSDK/Crypto/Migration/MXCryptoMigrationV2.swift index 4368ad68ea..32d96c36a4 100644 --- a/MatrixSDK/Crypto/Migration/MXCryptoMigrationV2.swift +++ b/MatrixSDK/Crypto/Migration/MXCryptoMigrationV2.swift @@ -15,8 +15,8 @@ // import Foundation -import OLMKit -import MatrixSDKCrypto +@_implementationOnly import OLMKit +@_implementationOnly import MatrixSDKCrypto class MXCryptoMigrationV2: NSObject { enum Error: Swift.Error { diff --git a/MatrixSDK/Crypto/Verification/MXKeyVerificationManagerV2.swift b/MatrixSDK/Crypto/Verification/MXKeyVerificationManagerV2.swift index 42291c59a5..e68978e205 100644 --- a/MatrixSDK/Crypto/Verification/MXKeyVerificationManagerV2.swift +++ b/MatrixSDK/Crypto/Verification/MXKeyVerificationManagerV2.swift @@ -6,7 +6,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXKeyVerificationManagerV2: NSObject, MXKeyVerificationManager { enum Error: Swift.Error { diff --git a/MatrixSDK/Crypto/Verification/Requests/MXKeyVerificationRequestV2.swift b/MatrixSDK/Crypto/Verification/Requests/MXKeyVerificationRequestV2.swift index 24c701fc8d..9f54c3d5a9 100644 --- a/MatrixSDK/Crypto/Verification/Requests/MXKeyVerificationRequestV2.swift +++ b/MatrixSDK/Crypto/Verification/Requests/MXKeyVerificationRequestV2.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// Verification request originating from `MatrixSDKCrypto` class MXKeyVerificationRequestV2: NSObject, MXKeyVerificationRequest { diff --git a/MatrixSDK/Crypto/Verification/Transactions/QRCode/MXQRCodeTransactionV2.swift b/MatrixSDK/Crypto/Verification/Transactions/QRCode/MXQRCodeTransactionV2.swift index 183c75504e..3750802965 100644 --- a/MatrixSDK/Crypto/Verification/Transactions/QRCode/MXQRCodeTransactionV2.swift +++ b/MatrixSDK/Crypto/Verification/Transactions/QRCode/MXQRCodeTransactionV2.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// QR transaction originating from `MatrixSDKCrypto` class MXQRCodeTransactionV2: NSObject, MXQRCodeTransaction { diff --git a/MatrixSDK/Crypto/Verification/Transactions/SAS/MXSASTransactionV2.swift b/MatrixSDK/Crypto/Verification/Transactions/SAS/MXSASTransactionV2.swift index f1d42a68d9..4468ae8f19 100644 --- a/MatrixSDK/Crypto/Verification/Transactions/SAS/MXSASTransactionV2.swift +++ b/MatrixSDK/Crypto/Verification/Transactions/SAS/MXSASTransactionV2.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// SAS transaction originating from `MatrixSDKCrypto` class MXSASTransactionV2: NSObject, MXSASTransaction { diff --git a/MatrixSDK/MatrixSDKVersion.m b/MatrixSDK/MatrixSDKVersion.m index 79f6a20957..3f16e20dca 100644 --- a/MatrixSDK/MatrixSDKVersion.m +++ b/MatrixSDK/MatrixSDKVersion.m @@ -16,4 +16,4 @@ #import -NSString *const MatrixSDKVersion = @"0.27.5"; +NSString *const MatrixSDKVersion = @"0.27.6"; diff --git a/MatrixSDK/Utils/Logs/MXAnalyticsDestination.swift b/MatrixSDK/Utils/Logs/MXAnalyticsDestination.swift index e3615dc3ce..601ad5b00e 100644 --- a/MatrixSDK/Utils/Logs/MXAnalyticsDestination.swift +++ b/MatrixSDK/Utils/Logs/MXAnalyticsDestination.swift @@ -6,7 +6,11 @@ // import Foundation +#if IS_TEST_RUN import SwiftyBeaver +#else +@_implementationOnly import SwiftyBeaver +#endif /// SwiftyBeaver log destination that sends errors to analytics tracker class MXAnalyticsDestination: BaseDestination { diff --git a/MatrixSDK/Utils/Logs/MXLog.swift b/MatrixSDK/Utils/Logs/MXLog.swift index c36bbc446d..acfa33bd96 100644 --- a/MatrixSDK/Utils/Logs/MXLog.swift +++ b/MatrixSDK/Utils/Logs/MXLog.swift @@ -15,7 +15,11 @@ // import Foundation +#if IS_TEST_RUN import SwiftyBeaver +#else +@_implementationOnly import SwiftyBeaver +#endif /// Various MXLog configuration options. Used in conjunction with `MXLog.configure()` @objc public class MXLogConfiguration: NSObject { diff --git a/MatrixSDK/Utils/Realm/RLMSupport.swift b/MatrixSDK/Utils/Realm/RLMSupport.swift index ab3c840ab9..e855317795 100644 --- a/MatrixSDK/Utils/Realm/RLMSupport.swift +++ b/MatrixSDK/Utils/Realm/RLMSupport.swift @@ -16,7 +16,7 @@ // //////////////////////////////////////////////////////////////////////////// -import Realm +@_implementationOnly import Realm extension RLMRealm { /** @@ -24,7 +24,7 @@ extension RLMRealm { - see: `+ [RLMRealm schemaVersionAtURL:encryptionKey:error:]` */ - @nonobjc public class func schemaVersion(at url: URL, usingEncryptionKey key: Data? = nil) throws -> UInt64 { + @nonobjc class func schemaVersion(at url: URL, usingEncryptionKey key: Data? = nil) throws -> UInt64 { var error: NSError? let version = __schemaVersion(at: url, encryptionKey: key, error: &error) guard version != RLMNotVersioned else { throw error! } @@ -38,7 +38,7 @@ extension RLMRealm { - see `- [RLMRealm resolveThreadSafeReference:]` */ - @nonobjc public func resolve(reference: RLMThreadSafeReference) -> Confined? { + @nonobjc func resolve(reference: RLMThreadSafeReference) -> Confined? { return __resolve(reference as! RLMThreadSafeReference) as! Confined? } } @@ -49,7 +49,7 @@ extension RLMObject { - see `+ [RLMObject objectsWithPredicate:]` */ - public class func objects(where predicateFormat: String, _ args: CVarArg...) -> RLMResults { + class func objects(where predicateFormat: String, _ args: CVarArg...) -> RLMResults { return objects(with: NSPredicate(format: predicateFormat, arguments: getVaList(args))) as! RLMResults } @@ -58,7 +58,7 @@ extension RLMObject { - see `+ [RLMObject objectsInRealm:withPredicate:]` */ - public class func objects(in realm: RLMRealm, + class func objects(in realm: RLMRealm, where predicateFormat: String, _ args: CVarArg...) -> RLMResults { return objects(in: realm, with: NSPredicate(format: predicateFormat, arguments: getVaList(args))) as! RLMResults @@ -66,7 +66,7 @@ extension RLMObject { } /// A protocol defining iterator support for RLMArray, RLMSet & RLMResults. -public protocol _RLMCollectionIterator { +protocol _RLMCollectionIterator { /** Returns a `RLMCollectionIterator` that yields successive elements in the collection. This enables support for sequence-style enumeration of `RLMObject` subclasses in Swift. @@ -76,43 +76,44 @@ public protocol _RLMCollectionIterator { extension _RLMCollectionIterator where Self: RLMCollection { /// :nodoc: - public func makeIterator() -> RLMCollectionIterator { + func makeIterator() -> RLMCollectionIterator { return RLMCollectionIterator(self) } } /// :nodoc: -public typealias RLMDictionarySingleEntry = (key: String, value: RLMObject) +typealias RLMDictionarySingleEntry = (key: String, value: RLMObject) /// A protocol defining iterator support for RLMDictionary -public protocol _RLMDictionaryIterator { +protocol _RLMDictionaryIterator { /// :nodoc: func makeIterator() -> RLMDictionaryIterator } extension _RLMDictionaryIterator where Self: RLMCollection { /// :nodoc: - public func makeIterator() -> RLMDictionaryIterator { + func makeIterator() -> RLMDictionaryIterator { return RLMDictionaryIterator(self) } } // Sequence conformance for RLMArray, RLMDictionary, RLMSet and RLMResults is provided by RLMCollection's // `makeIterator()` implementation. -extension RLMArray: Sequence, _RLMCollectionIterator { } -extension RLMDictionary: Sequence, _RLMDictionaryIterator {} -extension RLMSet: Sequence, _RLMCollectionIterator {} -extension RLMResults: Sequence, _RLMCollectionIterator {} +// Disabled since `@_implementationOnly`-importing Realm prevents these extensions. Note that this makes this whole file basically useless. +//extension RLMArray: Sequence, _RLMCollectionIterator { } +//extension RLMDictionary: Sequence, _RLMDictionaryIterator {} +//extension RLMSet: Sequence, _RLMCollectionIterator {} +//extension RLMResults: Sequence, _RLMCollectionIterator {} /** This struct enables sequence-style enumeration for RLMObjects in Swift via `RLMCollection.makeIterator` */ -public struct RLMCollectionIterator: IteratorProtocol { +struct RLMCollectionIterator: IteratorProtocol { private var iteratorBase: NSFastEnumerationIterator internal init(_ collection: RLMCollection) { iteratorBase = NSFastEnumerationIterator(collection) } - public mutating func next() -> RLMObject? { + mutating func next() -> RLMObject? { return iteratorBase.next() as! RLMObject? } } @@ -120,7 +121,7 @@ public struct RLMCollectionIterator: IteratorProtocol { /** This struct enables sequence-style enumeration for RLMDictionary in Swift via `RLMDictionary.makeIterator` */ -public struct RLMDictionaryIterator: IteratorProtocol { +struct RLMDictionaryIterator: IteratorProtocol { private var iteratorBase: NSFastEnumerationIterator private let dictionary: RLMDictionary @@ -129,7 +130,7 @@ public struct RLMDictionaryIterator: IteratorProtocol { iteratorBase = NSFastEnumerationIterator(collection) } - public mutating func next() -> RLMDictionarySingleEntry? { + mutating func next() -> RLMDictionarySingleEntry? { let key = iteratorBase.next() if let key = key { return (key: key as Any, value: dictionary[key as AnyObject]) as? RLMDictionarySingleEntry @@ -146,7 +147,7 @@ extension RLMCollection { /** Returns the index of the first object in the collection matching the predicate. */ - public func indexOfObject(where predicateFormat: String, _ args: CVarArg...) -> UInt { + func indexOfObject(where predicateFormat: String, _ args: CVarArg...) -> UInt { guard let index = indexOfObject?(with: NSPredicate(format: predicateFormat, arguments: getVaList(args))) else { fatalError("This RLMCollection does not support indexOfObject(where:)") } @@ -156,14 +157,14 @@ extension RLMCollection { /** Returns all objects matching the given predicate in the collection. */ - public func objects(where predicateFormat: String, _ args: CVarArg...) -> RLMResults { + func objects(where predicateFormat: String, _ args: CVarArg...) -> RLMResults { return objects(with: NSPredicate(format: predicateFormat, arguments: getVaList(args))) as! RLMResults } } extension RLMCollection { /// Allows for subscript support with RLMDictionary. - public subscript(_ key: String) -> AnyObject? { + subscript(_ key: String) -> AnyObject? { get { (self as! RLMDictionary).object(forKey: key as NSString) } diff --git a/MatrixSDK/Utils/Realm/Realm+MatrixSDK.swift b/MatrixSDK/Utils/Realm/Realm+MatrixSDK.swift index 434aa6782d..45e1f18678 100644 --- a/MatrixSDK/Utils/Realm/Realm+MatrixSDK.swift +++ b/MatrixSDK/Utils/Realm/Realm+MatrixSDK.swift @@ -14,7 +14,7 @@ // limitations under the License. // -import Realm +@_implementationOnly import Realm extension RLMRealm { diff --git a/MatrixSDKTests/Crypto/Algorithms/Megolm/MXMegolmDecryptionUnitTests.swift b/MatrixSDKTests/Crypto/Algorithms/Megolm/MXMegolmDecryptionUnitTests.swift index 344f49e0d2..ccd66c9715 100644 --- a/MatrixSDKTests/Crypto/Algorithms/Megolm/MXMegolmDecryptionUnitTests.swift +++ b/MatrixSDKTests/Crypto/Algorithms/Megolm/MXMegolmDecryptionUnitTests.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto @testable import MatrixSDK class MXMegolmDecryptionUnitTests: XCTestCase { diff --git a/MatrixSDKTests/Crypto/Algorithms/RoomEvents/MXRoomEventDecryptionUnitTests.swift b/MatrixSDKTests/Crypto/Algorithms/RoomEvents/MXRoomEventDecryptionUnitTests.swift index f2eb25723b..d28626cef2 100644 --- a/MatrixSDKTests/Crypto/Algorithms/RoomEvents/MXRoomEventDecryptionUnitTests.swift +++ b/MatrixSDKTests/Crypto/Algorithms/RoomEvents/MXRoomEventDecryptionUnitTests.swift @@ -17,7 +17,7 @@ import Foundation @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXRoomEventDecryptionUnitTests: XCTestCase { class DecryptorStub: CryptoIdentityStub, MXCryptoRoomEventDecrypting { diff --git a/MatrixSDKTests/Crypto/Algorithms/RoomEvents/MXRoomEventEncryptionUnitTests.swift b/MatrixSDKTests/Crypto/Algorithms/RoomEvents/MXRoomEventEncryptionUnitTests.swift index 8dc292a901..5812aa554b 100644 --- a/MatrixSDKTests/Crypto/Algorithms/RoomEvents/MXRoomEventEncryptionUnitTests.swift +++ b/MatrixSDKTests/Crypto/Algorithms/RoomEvents/MXRoomEventEncryptionUnitTests.swift @@ -16,7 +16,7 @@ import Foundation @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXRoomEventEncryptionUnitTests: XCTestCase { class StateStub: MXRoomState { diff --git a/MatrixSDKTests/Crypto/CrossSigning/Data/MXCrossSigningInfoUnitTests.swift b/MatrixSDKTests/Crypto/CrossSigning/Data/MXCrossSigningInfoUnitTests.swift index 2f1e386e2e..37d1872d61 100644 --- a/MatrixSDKTests/Crypto/CrossSigning/Data/MXCrossSigningInfoUnitTests.swift +++ b/MatrixSDKTests/Crypto/CrossSigning/Data/MXCrossSigningInfoUnitTests.swift @@ -17,7 +17,7 @@ import Foundation import XCTest @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXCrossSigningInfoUnitTests: XCTestCase { func makeKey(type: String, user: String) -> MXCrossSigningKey { diff --git a/MatrixSDKTests/Crypto/CrossSigning/MXCrossSigningInfoSourceUnitTests.swift b/MatrixSDKTests/Crypto/CrossSigning/MXCrossSigningInfoSourceUnitTests.swift index c01a7d2a0f..4a56572c4f 100644 --- a/MatrixSDKTests/Crypto/CrossSigning/MXCrossSigningInfoSourceUnitTests.swift +++ b/MatrixSDKTests/Crypto/CrossSigning/MXCrossSigningInfoSourceUnitTests.swift @@ -17,7 +17,7 @@ import Foundation import XCTest @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXCrossSigningInfoSourceUnitTests: XCTestCase { var cryptoSource: UserIdentitySourceStub! diff --git a/MatrixSDKTests/Crypto/CrossSigning/MXCrossSigningV2UnitTests.swift b/MatrixSDKTests/Crypto/CrossSigning/MXCrossSigningV2UnitTests.swift index d1935e7ae9..def69d0f05 100644 --- a/MatrixSDKTests/Crypto/CrossSigning/MXCrossSigningV2UnitTests.swift +++ b/MatrixSDKTests/Crypto/CrossSigning/MXCrossSigningV2UnitTests.swift @@ -17,7 +17,7 @@ import Foundation import XCTest @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXCrossSigningV2UnitTests: XCTestCase { diff --git a/MatrixSDKTests/Crypto/CryptoMachine/DecryptedEvent+Stub.swift b/MatrixSDKTests/Crypto/CryptoMachine/DecryptedEvent+Stub.swift index 5c77c80896..52edc33f3f 100644 --- a/MatrixSDKTests/Crypto/CryptoMachine/DecryptedEvent+Stub.swift +++ b/MatrixSDKTests/Crypto/CryptoMachine/DecryptedEvent+Stub.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto extension DecryptedEvent { static func stub( diff --git a/MatrixSDKTests/Crypto/CryptoMachine/Device+Stub.swift b/MatrixSDKTests/Crypto/CryptoMachine/Device+Stub.swift index 29ba42e3be..a9c7e74385 100644 --- a/MatrixSDKTests/Crypto/CryptoMachine/Device+Stub.swift +++ b/MatrixSDKTests/Crypto/CryptoMachine/Device+Stub.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto extension Device { static func stub( diff --git a/MatrixSDKTests/Crypto/CryptoMachine/Extensions/EventEncryptionAlgorithmUnitTests.swift b/MatrixSDKTests/Crypto/CryptoMachine/Extensions/EventEncryptionAlgorithmUnitTests.swift index 8bcae0ddf4..f26a068c15 100644 --- a/MatrixSDKTests/Crypto/CryptoMachine/Extensions/EventEncryptionAlgorithmUnitTests.swift +++ b/MatrixSDKTests/Crypto/CryptoMachine/Extensions/EventEncryptionAlgorithmUnitTests.swift @@ -16,7 +16,7 @@ import Foundation import XCTest -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto @testable import MatrixSDK class EventEncryptionAlgorithmUnitTests: XCTestCase { diff --git a/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoMachineUnitTests.swift b/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoMachineUnitTests.swift index 9456290585..8980051a77 100644 --- a/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoMachineUnitTests.swift +++ b/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoMachineUnitTests.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto @testable import MatrixSDK class MXCryptoMachineUnitTests: XCTestCase { diff --git a/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoProtocolStubs.swift b/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoProtocolStubs.swift index 171d3b6bab..ae9dde6408 100644 --- a/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoProtocolStubs.swift +++ b/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoProtocolStubs.swift @@ -16,7 +16,7 @@ import Foundation @testable import MatrixSDK -@testable import MatrixSDKCrypto +@_implementationOnly @testable import MatrixSDKCrypto class CryptoIdentityStub: MXCryptoIdentity { var userId: String = "Alice" diff --git a/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoRequestsUnitTests.swift b/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoRequestsUnitTests.swift index 16d697fe4a..384d9346d8 100644 --- a/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoRequestsUnitTests.swift +++ b/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoRequestsUnitTests.swift @@ -16,7 +16,7 @@ import Foundation @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXCryptoRequestsUnitTests: XCTestCase { func test_canCreateToDeviceRequest() { diff --git a/MatrixSDKTests/Crypto/Data/Store/MXMemoryCryptoStore.swift b/MatrixSDKTests/Crypto/Data/Store/MXMemoryCryptoStore.swift index 2b1c240c56..97c53ba0e0 100644 --- a/MatrixSDKTests/Crypto/Data/Store/MXMemoryCryptoStore.swift +++ b/MatrixSDKTests/Crypto/Data/Store/MXMemoryCryptoStore.swift @@ -15,7 +15,7 @@ // import Foundation -import OLMKit +@_implementationOnly import OLMKit public class MXMemoryCryptoStore: NSObject, MXCryptoStore { diff --git a/MatrixSDKTests/Crypto/Devices/Data/MXDeviceInfoUnitTests.swift b/MatrixSDKTests/Crypto/Devices/Data/MXDeviceInfoUnitTests.swift index abdf3ba911..44e0c1a5cd 100644 --- a/MatrixSDKTests/Crypto/Devices/Data/MXDeviceInfoUnitTests.swift +++ b/MatrixSDKTests/Crypto/Devices/Data/MXDeviceInfoUnitTests.swift @@ -17,7 +17,7 @@ import Foundation import XCTest @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXDeviceInfoUnitTests: XCTestCase { func test_canCreateInfo_withDevice() { diff --git a/MatrixSDKTests/Crypto/Devices/MXDeviceInfoSourceUnitTests.swift b/MatrixSDKTests/Crypto/Devices/MXDeviceInfoSourceUnitTests.swift index 163ce55228..1a65e652d2 100644 --- a/MatrixSDKTests/Crypto/Devices/MXDeviceInfoSourceUnitTests.swift +++ b/MatrixSDKTests/Crypto/Devices/MXDeviceInfoSourceUnitTests.swift @@ -17,7 +17,7 @@ import Foundation import XCTest @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXDeviceInfoSourceUnitTests: XCTestCase { var cryptoSource: DevicesSourceStub! diff --git a/MatrixSDKTests/Crypto/KeyBackup/Engine/MXCryptoKeyBackupEngineUnitTests.swift b/MatrixSDKTests/Crypto/KeyBackup/Engine/MXCryptoKeyBackupEngineUnitTests.swift index ba9271fe0b..196c8ac7d1 100644 --- a/MatrixSDKTests/Crypto/KeyBackup/Engine/MXCryptoKeyBackupEngineUnitTests.swift +++ b/MatrixSDKTests/Crypto/KeyBackup/Engine/MXCryptoKeyBackupEngineUnitTests.swift @@ -16,7 +16,7 @@ import Foundation @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXCryptoKeyBackupEngineUnitTests: XCTestCase { actor DecryptorSpy: MXRoomEventDecrypting { diff --git a/MatrixSDKTests/Crypto/Migration/Data/MXCryptoMigrationStoreUnitTests.swift b/MatrixSDKTests/Crypto/Migration/Data/MXCryptoMigrationStoreUnitTests.swift index 1197fc26ff..09998e6cdb 100644 --- a/MatrixSDKTests/Crypto/Migration/Data/MXCryptoMigrationStoreUnitTests.swift +++ b/MatrixSDKTests/Crypto/Migration/Data/MXCryptoMigrationStoreUnitTests.swift @@ -16,7 +16,7 @@ import Foundation import XCTest -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto @testable import MatrixSDK class MXCryptoMigrationStoreUnitTests: XCTestCase { diff --git a/MatrixSDKTests/Crypto/Migration/LegacyRealmStore/LegacyRealmStore.swift b/MatrixSDKTests/Crypto/Migration/LegacyRealmStore/LegacyRealmStore.swift index 4510c3a782..4c337d57ff 100644 --- a/MatrixSDKTests/Crypto/Migration/LegacyRealmStore/LegacyRealmStore.swift +++ b/MatrixSDKTests/Crypto/Migration/LegacyRealmStore/LegacyRealmStore.swift @@ -15,7 +15,7 @@ // import Foundation -import Realm +@_implementationOnly import Realm /// Class simulating legacy crypto store associated with the now-deprecated native crypto module /// diff --git a/MatrixSDKTests/Crypto/Migration/MXCryptoMigrationV2UnitTests.swift b/MatrixSDKTests/Crypto/Migration/MXCryptoMigrationV2UnitTests.swift index 88b5cfc676..ddea7c1834 100644 --- a/MatrixSDKTests/Crypto/Migration/MXCryptoMigrationV2UnitTests.swift +++ b/MatrixSDKTests/Crypto/Migration/MXCryptoMigrationV2UnitTests.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto @testable import MatrixSDK class MXCryptoMigrationV2UnitTests: XCTestCase { diff --git a/MatrixSDKTests/Crypto/Trust/MXTrustLevelSourceUnitTests.swift b/MatrixSDKTests/Crypto/Trust/MXTrustLevelSourceUnitTests.swift index dc53091a9f..04e704c52c 100644 --- a/MatrixSDKTests/Crypto/Trust/MXTrustLevelSourceUnitTests.swift +++ b/MatrixSDKTests/Crypto/Trust/MXTrustLevelSourceUnitTests.swift @@ -17,7 +17,7 @@ import Foundation import XCTest @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXTrustLevelSourceUnitTests: XCTestCase { var userIdentitySource: UserIdentitySourceStub! diff --git a/MatrixSDKTests/Crypto/Verification/Requests/MXKeyVerificationRequestV2UnitTests.swift b/MatrixSDKTests/Crypto/Verification/Requests/MXKeyVerificationRequestV2UnitTests.swift index 1af4801107..6e8c94a416 100644 --- a/MatrixSDKTests/Crypto/Verification/Requests/MXKeyVerificationRequestV2UnitTests.swift +++ b/MatrixSDKTests/Crypto/Verification/Requests/MXKeyVerificationRequestV2UnitTests.swift @@ -16,7 +16,7 @@ import Foundation import XCTest -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto @testable import MatrixSDK class MXKeyVerificationRequestV2UnitTests: XCTestCase { diff --git a/MatrixSDKTests/Crypto/Verification/Requests/VerificationRequestStub.swift b/MatrixSDKTests/Crypto/Verification/Requests/VerificationRequestStub.swift index 730eaeb6d9..5a48049af1 100644 --- a/MatrixSDKTests/Crypto/Verification/Requests/VerificationRequestStub.swift +++ b/MatrixSDKTests/Crypto/Verification/Requests/VerificationRequestStub.swift @@ -16,7 +16,7 @@ import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class VerificationRequestStub: VerificationRequestProtocol { diff --git a/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/MXQRCodeTransactionV2UnitTests.swift b/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/MXQRCodeTransactionV2UnitTests.swift index 1ed48469fd..6ae7e0ed2c 100644 --- a/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/MXQRCodeTransactionV2UnitTests.swift +++ b/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/MXQRCodeTransactionV2UnitTests.swift @@ -16,7 +16,7 @@ import Foundation import XCTest -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto @testable import MatrixSDK class MXQRCodeTransactionV2UnitTests: XCTestCase { diff --git a/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/QrCodeStub.swift b/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/QrCodeStub.swift index 15fe3df825..29c1c88b3b 100644 --- a/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/QrCodeStub.swift +++ b/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/QrCodeStub.swift @@ -16,7 +16,7 @@ import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto struct QrCodeStub: QrCodeProtocol { private let _otherUserId: String diff --git a/MatrixSDKTests/Crypto/Verification/Transactions/SAS/MXSASTransactionV2UnitTests.swift b/MatrixSDKTests/Crypto/Verification/Transactions/SAS/MXSASTransactionV2UnitTests.swift index ad1ba7166f..88f36af03e 100644 --- a/MatrixSDKTests/Crypto/Verification/Transactions/SAS/MXSASTransactionV2UnitTests.swift +++ b/MatrixSDKTests/Crypto/Verification/Transactions/SAS/MXSASTransactionV2UnitTests.swift @@ -16,7 +16,7 @@ import Foundation import XCTest -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto @testable import MatrixSDK class MXSASTransactionV2UnitTests: XCTestCase { diff --git a/MatrixSDKTests/Crypto/Verification/Transactions/SAS/SasStub.swift b/MatrixSDKTests/Crypto/Verification/Transactions/SAS/SasStub.swift index ed81168ef1..1a738ecc44 100644 --- a/MatrixSDKTests/Crypto/Verification/Transactions/SAS/SasStub.swift +++ b/MatrixSDKTests/Crypto/Verification/Transactions/SAS/SasStub.swift @@ -16,7 +16,7 @@ import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto struct SasStub: SasProtocol { diff --git a/changelog.d/sdk-1497.build b/changelog.d/sdk-1497.build new file mode 100644 index 0000000000..2f7fc863ad --- /dev/null +++ b/changelog.d/sdk-1497.build @@ -0,0 +1 @@ +Build: Makes distributing the SDK as a binary Swift package possible again. Contributed by Christopher Kobusch (@Topheee).