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
| extension Result { | |
| var value: Success? { | |
| guard case .success(let value) = self else { return nil } | |
| return value | |
| } | |
| /// Returns the associated error value if the result is a failure, `nil` otherwise. | |
| var error: Failure? { | |
| guard case .failure(let error) = self else { return nil } |
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
| http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_hd_intermediate_swift.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_sd_intermediate_swift.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_intermediate_swift.pdf?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_hd_advanced_graphics_and_animation_performance.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_sd_advanced_graphics_and_animation_performance.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_advanced_graphics_and_animation_performance.pdf?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2014/101xx36lr6smzjo/101/101_hd.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2014/101xx36lr6smzjo/101/101_sd.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2014/236xxwk3fv82sx2/236/236_hd_building_interruptible_and_responsive_interactions.mov?dl=1 | |
| http://devstreaming.apple.com/videos/wwdc/2 |
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
| find . -name Pods -type d -exec rm -rf {} \; |
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
| git rm -r --cached . | |
| git add . | |
| git commit -m ".gitignore fix" |
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
| protocol PersistenceKey { | |
| var key:String { get } | |
| } | |
| enum User:String, PersistenceKey { | |
| var key: String { | |
| return self.rawValue | |
| } |
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
| $ curl -o .gitignore https://raw.githubusercontent.com/github/gitignore/master/Swift.gitignore |
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
| // in App Delegate Call self.changeBackBarButtonImage() | |
| @UIApplicationMain | |
| class AppDelegate: UIResponder, UIApplicationDelegate { | |
| var window: UIWindow? | |
| func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
| // customize Navigation back Button Image | |
| self.changeBackBarButtonImage() |
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
| // | |
| // AsynchronousOperation.swift | |
| // | |
| // Created by Vasily Ulianov on 09.02.17. | |
| // Copyright © 2017 Vasily Ulianov. All rights reserved. | |
| // | |
| import Foundation | |
| /// Subclass of `Operation` that add support of asynchronous operations. |
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 MyApplication: UIApplication { | |
| override init() { | |
| let notFirstOpenKey = "notFirstOpen" | |
| let notFirstOpen = UserDefaults.standard.bool(forKey: notFirstOpenKey) | |
| if notFirstOpen == false { | |
| UserDefaults.standard.set(["ar"], forKey: "AppleLanguages") | |
| UserDefaults.standard.set(true, forKey: notFirstOpenKey) | |
| } | |
| super.init() | |
| } |