This file contains hidden or 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
| // | |
| // RealmSwift+Codable.swift | |
| // | |
| // Created by Anson Yao on 7/25/18. | |
| // | |
| //Adding this file can make your classes inherited from Realm Object comfirm to Codable easily | |
| //Inspired by @mishagray https://gist.github.com/mishagray/3ee82a3a82f357bfbf8ff3b3d9eca5cd |
This file contains hidden or 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
| import Foundation | |
| struct EquatableValueSequence<T: Equatable> { | |
| static func ==(lhs: EquatableValueSequence<T>, rhs: T) -> Bool { | |
| return lhs.values.contains(rhs) | |
| } | |
| static func ==(lhs: T, rhs: EquatableValueSequence<T>) -> Bool { | |
| return rhs == lhs | |
| } |
This file contains hidden or 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
| // | |
| // RealmSwift+Codable.swift | |
| // | |
| // Created by Michael Gray on 8/16/17. | |
| // | |
| import Foundation | |
| import RealmSwift | |
| // swiftlint:disable line_length identifier_name |
This file contains hidden or 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
| var fetchedResultsProcessingOperations: [NSBlockOperation] = [] | |
| private func addFetchedResultsProcessingBlock(processingBlock:(Void)->Void) { | |
| fetchedResultsProcessingOperations.append(NSBlockOperation(block: processingBlock)) | |
| } | |
| func controller(controller: NSFetchedResultsController, didChangeObject anObject: AnyObject, atIndexPath indexPath: NSIndexPath?, forChangeType type: NSFetchedResultsChangeType, newIndexPath: NSIndexPath?) { | |
| switch type { | |
| case .Insert: |
This file contains hidden or 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
| i386 : iPhone Simulator | |
| x86_64 : iPhone Simulator | |
| arm64 : iPhone Simulator | |
| iPhone1,1 : iPhone | |
| iPhone1,2 : iPhone 3G | |
| iPhone2,1 : iPhone 3GS | |
| iPhone3,1 : iPhone 4 | |
| iPhone3,2 : iPhone 4 GSM Rev A | |
| iPhone3,3 : iPhone 4 CDMA | |
| iPhone4,1 : iPhone 4S |
NewerOlder