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 Alamofire | |
| enum NetworkRouter: URLRequestConvertible { | |
| static let baseURLString = "xxx" | |
| case UserLogin(Int) | |
| var URLRequest: NSMutableURLRequest { | |
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 MyTransitionDelegate : NSObject, UIViewControllerTransitioningDelegate { | |
| func animationControllerForPresentedController(presented: UIViewController, presentingController presenting: UIViewController, sourceController source: UIViewController) -> UIViewControllerAnimatedTransitioning? { | |
| return MyAnimatedTransitioning(isPresented: true) | |
| } | |
| func animationControllerForDismissedController(dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { | |
| return MyAnimatedTransitioning(isPresented: false) | |
| } | |
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
| func backgroundBlurSetup() { | |
| // for clear background also need to set a modal segue to this controller into "OverCurrentContext" | |
| self.view.backgroundColor = UIColor.clearColor() | |
| let blurEffect = UIBlurEffect(style: .Light) | |
| let effectView = UIVisualEffectView(effect: blurEffect) | |
| effectView.frame = self.view.frame | |
| self.tableView.backgroundView = effectView | |
| } |
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 ExcutableQueue { | |
| var queue: dispatch_queue_t { get } | |
| } | |
| extension ExcutableQueue { | |
| func execute(closure: () -> Void) { | |
| dispatch_async(queue, closure) | |
| } | |
| } |
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
| dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (Int64)(UInt64(<#delayInSeconds#>) * NSEC_PER_SEC)), dispatch_get_main_queue()) { | |
| <#code to be executed after a specified delay#> | |
| } |
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
| if let shortVersion = NSBundle.mainBundle().infoDictionary?["CFBundleShortVersionString"] as? String, build = NSBundle.mainBundle().infoDictionary?["CFBundleVersion"] as? 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
| if let shortVersion = NSBundle.mainBundle().infoDictionary?["CFBundleShortVersionString"] as? String, build = NSBundle.mainBundle().infoDictionary?["CFBundleVersion"] as? 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
| override func viewWillAppear(animated: Bool) { | |
| super.viewWillAppear(animated) | |
| self.extendedLayoutIncludesOpaqueBars = true | |
| self.edgesForExtendedLayout = .Top | |
| } |
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
| func pinnedConstraints(view: UIView) -> [NSLayoutConstraint] { | |
| let topConstraint = NSLayoutConstraint(item: view, attribute: NSLayoutAttribute.Top, relatedBy: NSLayoutRelation.Equal, toItem: self.topLayoutGuide, attribute: NSLayoutAttribute.Bottom, multiplier: 1, constant: 0) | |
| let leftConstraint = NSLayoutConstraint(item: view, attribute: NSLayoutAttribute.Left, relatedBy: NSLayoutRelation.Equal, toItem: self.view, attribute: NSLayoutAttribute.Left, multiplier: 1, constant: 0) | |
| let rightConstraint = NSLayoutConstraint(item: view, attribute: NSLayoutAttribute.Right, relatedBy: NSLayoutRelation.Equal, toItem: self.view, attribute: NSLayoutAttribute.Right, multiplier: 1, constant: 0) | |
| let bottomConstraint = NSLayoutConstraint(item: view, attribute: NSLayoutAttribute.Bottom, relatedBy: NSLayoutRelation.Equal, toItem: self.bottomLayoutGuide, attribute: NSLayoutAttribute.Top, multiplier: 1, constant: 0) | |
| return [topConstraint, leftConstraint, bottomConstraint, rightConst |
OlderNewer