This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// DatabaseConfigurable all defines which you must conform according | |
public protocol DatabaseConfigurable { | |
var realmMemoryType: RealmMemoryType { get } | |
// This property you must assign the database name that you want. | |
// If you want to use legacy architecture you can assign nil for it. | |
// If you want to use legacy architecture you can assign nil for it. | |
var schemaName: String? { get } | |
// This property you must assign the database version according to the migration count. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public init(fileURL: URL? = URL(fileURLWithPath: RLMRealmPathForFile("default.realm"), isDirectory: false), | |
inMemoryIdentifier: String? = nil, | |
syncConfiguration: SyncConfiguration? = nil, | |
encryptionKey: Data? = nil, | |
readOnly: Bool = false, | |
schemaVersion: UInt64 = 0, | |
migrationBlock: MigrationBlock? = nil, | |
deleteRealmIfMigrationNeeded: Bool = false, | |
shouldCompactOnLaunch: ((Int, Int) -> Bool)? = nil, | |
objectTypes: [ObjectBase.Type]? = nil, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let numbers = [0, 2, 4, 6] | |
let allEven = numbers.filter { $0 % 2 != 0 }.isEmpty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let numbers = [0, 2, 4, 6] | |
let allEven = numbers.allSatisfy { $0 % 2 == 0 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let numbers = [0, 4, 2, 8] | |
let minNumber = numbers.sorted().first | |
let maxNumber = numbers.sorted().last |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let numbers = [0, 4, 2, 8] | |
let minNumber = numbers.min() | |
let maxNumber = numbers.max() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let numbers = [3, 7, 4, -2, 9, -6, 10, 1] | |
let firstNegative = numbers.filter { $0 < 0 }.first |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let numbers = [3, 7, 4, -2, 9, -6, 10, 1] | |
let firstNegative = numbers.first(where: { $0 < 0 }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let numbers = [] | |
numbers.count == 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let numbers = [] | |
numbers.isEmpty |