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 | |
| /// A property wrapper that ensures the wrapped `UIView`'s | |
| /// `translatesAutoresizingMaskIntoConstraints` property is | |
| /// set to `false` | |
| @propertyWrapper | |
| public struct AutoLayout<T: UIView> { | |
| public var wrappedValue: T { | |
| didSet { |
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 Foundation | |
| internal protocol Groupable { | |
| associatedtype GroupingType : Hashable | |
| var groupingKey : GroupingType? { get } | |
| } | |
| extension Array where Element : Groupable { | |
| typealias GroupingType = Element.GroupingType |
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
| //: Playground - noun: a place where people can play | |
| import UIKit | |
| import PlaygroundSupport | |
| var container = UIView(frame: CGRect(x: 0, y: 0, width: 400, height: 400)) | |
| container.backgroundColor = UIColor.green | |
| PlaygroundPage.current.liveView = container | |
| // First label - centered |