This file contains 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 | |
import Rswift | |
struct NibResource: NibResourceType { | |
let name: String | |
let bundle: NSBundle | |
init(name: String, bundle: NSBundle = NSBundle.mainBundle()) { | |
self.name = name | |
self.bundle = bundle |
This file contains 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 UIView { | |
/// Convenience API to query iOS 11's `UIView.safeAreaInsets`'s insets (also known as "#NotEmbraceTheNotch") | |
/// in a backwards compatible API. | |
/// It also differs slightly from `UIView.safeAreaInsets` in that it only takes the "Notch" into account | |
/// and not the status bar. This allows you to inset content so that the notch doesn't clip it, but you can still | |
/// lay it out below the status bar. | |
/// Note: This won't be as versitile as the UIKit version because it won't take into account things like navigation bars, | |
/// but it should be correct for views in "full-screen" view controllers, where the UIKit `safeAreaInsets` API falls short. | |
var twSafeAreaInsets: UIEdgeInsets { | |
guard #available(iOS 11.0, *) else { |
This file contains 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
// | |
// DataLoadState.swift | |
// Fabric | |
// | |
// Created by Javier Soto on 3/16/16. | |
// Copyright © 2016 Fabric. All rights reserved. | |
// | |
import Foundation | |
import ReactiveCocoa |
This file contains 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 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 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() | |
} |
You can do it like this:
In your main view controller:
func showModal() {
let modalViewController = ModalViewController()
modalViewController.modalPresentationStyle = .OverCurrentContext
presentViewController(modalViewController, animated: true, completion: nil)
}
This file contains 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 NibInstantiatable { | |
static var NibName: String { get } | |
} | |
extension NibInstantiatable { | |
static var NibName: String { return String(Self) } | |
static func instantiate() -> Self { | |
return instantiateWithName(NibName) |
NewerOlder