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
| // сущность Core Data | |
| // CDEntry: NSManagedObject | |
| class CDFolder: CDEntry { | |
| @NSManaged var name: String? | |
| @NSManaged var messages: [CDMessage]? | |
| //... | |
| } | |
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 UIKit | |
| // MARK: - Сущность БД | |
| class Entry { | |
| let entryId: String | |
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
| shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>com.apple.actool.catalog-contents</key> | |
| <array> | |
| <dict> | |
| <key>children</key> | |
| <array> |
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
| class UserParser: JSONParser<User> { | |
| func parseObject(_ data: JSON) -> User? | |
| } | |
| class UserSerializer: JSONSerializer<User> { | |
| func serializeObject(_ object: User) -> Data? | |
| } |
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
| /* | |
| Deal | |
| @model | |
| */ | |
| class Deal: Entity { | |
| /* | |
| Title | |
| @json | |
| */ |
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
| class DealParser: JSONParser<Deal> { | |
| override func parseObject(_ data: JSON) -> Deal? { | |
| guard | |
| let title: String = data["title"]?.string, | |
| let endDateString: String = data["end_date"]?.string | |
| else { return nil } | |
| let subtitle: String? = data["subtitle"]?.string |
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
| class DBDeal: RLMEntry { | |
| @objc dynamic var title = "" | |
| @objc dynamic var subtitle: String? = nil | |
| @objc dynamic var endDateString = "" | |
| } |
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
| class DealTranslator: RealmTranslator<Deal, DBDeal> { | |
| override func fill(_ entity: Deal, fromEntry: DBDeal) { | |
| entity.entityId = fromEntry.entryId | |
| entity.title = fromEntry.title | |
| entity.subtitle = fromEntry.subtitle | |
| entity.endDateString = fromEntry.endDateString | |
| } | |
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
| let videoOutput = AVCaptureVideoDataOutput() | |
| videoOutput.videoSettings = [ | |
| kCVPixelBufferPixelFormatTypeKey as String: | |
| kCVPixelFormatType_32BGRA | |
| ] | |
| videoOutput.setSampleBufferDelegate(self, queue: DispatchQueue.global(qos: .background)) | |
| captureSession.addOutput(videoOutput) // your session previously configured for capturing still image |