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 Foundation | |
class ViewWithDynamicWidthScrollingView: UIView { | |
convenience init() { | |
self.init(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height)) | |
} | |
override init(frame: CGRect) { | |
super.init(frame: frame) |
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 Foundation | |
import UIKit | |
class CustomView: UIView { | |
convenience init() { | |
// Size doesn't matter if your widget is scalable | |
// and you are going to use Autolayout constraints | |
// on it | |
self.init(frame: CGRectZero) |
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
// | |
// MYCustomView.swift | |
// StatWidget | |
import UIKit | |
/** | |
Custom view which can be rendered by Interface Builder | |
and a running iOS app alike. It uses autolayout for the |
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
let start = Date() | |
print("Elapsed time: \(start.timeIntervalSinceNow) seconds") |