Created
November 4, 2018 22:58
-
-
Save GeneralD/e92ee9c5a66cd7cd9ba47e9370590752 to your computer and use it in GitHub Desktop.
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 | |
@IBDesignable class __CustomView__: UIView { | |
@IBInspectable var labelText: String = "" { | |
didSet { | |
label.text = labelText | |
} | |
} | |
let label = UILabel() | |
required init?(coder aDecoder: NSCoder) { | |
super.init(coder: aDecoder) | |
commonInit() | |
} | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
commonInit() | |
} | |
fileprivate func commonInit() { | |
label.frame = CGRect(x: 0, y: 0, width: 1000, height: 300) | |
addSubview(label) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment