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 viewDidLoad() { | |
| super.viewDidLoad() | |
| // Do any additional setup after loading the view, typically from a nib. | |
| view.backgroundColor = UIColor.lightGrayColor() | |
| let vLayout = VerticalLayout(width: view.frame.width) | |
| vLayout.backgroundColor = UIColor.cyanColor() | |
| view.addSubview(vLayout) |
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 | |
| class VerticalLayout: UIView { | |
| var yOffsets: [CGFloat] = [] | |
| init(width: CGFloat) { | |
| super.init(frame: CGRectMake(0, 0, width, 0)) | |
| } |
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
| body { | |
| font-family: Helvetica, Verdana | |
| } | |
| p { | |
| padding: 7px 10px; | |
| } | |
| #demo { | |
| border: 1px solid #999; | |
| } |