One Paragraph of project description goes here
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
import UIKit | |
open class LayerView<Layer: CALayer>: UIView { | |
public final override class var layerClass: Swift.AnyClass { | |
return Layer.self | |
} | |
public final var concreteLayer: Layer { | |
return layer as! Layer | |
} |
// Since we are unable to extend ObjC protocols in swift, we wrap this around a custom NSObject subclass | |
// that deals exclusive with handling the image picker delegate methods and chaining the response down to | |
// the MediaPickerPresenter conforming delegate | |
class ImagePickerHandler: NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate { | |
var delegate: MediaPickerPresenter? | |
let sourceType: UIImagePickerControllerSourceType | |
let picker = UIImagePickerController() | |
let styles: [UIFont.TextStyle] = [ | |
// iOS 17 | |
.extraLargeTitle, .extraLargeTitle2, | |
// iOS 11 | |
.largeTitle, | |
// iOS 9 | |
.title1, .title2, .title3, .callout, | |
// iOS 7 | |
.headline, .subheadline, .body, .footnote, .caption1, .caption2, | |
] |
import QuartzCore | |
func executionTimeInterval(block: () -> ()) -> CFTimeInterval { | |
let start = CACurrentMediaTime() | |
block(); | |
let end = CACurrentMediaTime() | |
return end - start | |
} | |