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
| final class ToolbarController, NSObject, NSToolbarDelegate { | |
| var isBackButtonEnabled = false { | |
| didSet { | |
| if isBackButtonEnabled != oldValue { | |
| reloadBackItem() | |
| } | |
| } | |
| } | |
| func toolbar(_ toolbar: NSToolbar, itemForItemIdentifier itemIdentifier: NSToolbarItem.Identifier, willBeInsertedIntoToolbar flag: Bool) -> NSToolbarItem? { |
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 RealmSwift | |
| import Realm | |
| protocol CascadeDeleting { | |
| func delete<S: Sequence>(_ objects: S, cascading: Bool) where S.Iterator.Element: Object | |
| func delete<Entity: Object>(_ entity: Entity, cascading: Bool) | |
| } | |
| extension Realm: CascadeDeleting { | |
| func delete<S: Sequence>(_ objects: S, cascading: Bool) where S.Iterator.Element: Object { |
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 | |
| extension UIColor { | |
| convenience init(hex: String, alpha: CGFloat = 1) { | |
| assert(hex[hex.startIndex] == "#", "Expected hex string of format #RRGGBB") | |
| let scanner = NSScanner(string: hex) | |
| scanner.scanLocation = 1 // skip # | |
| var rgb: UInt32 = 0 |