Created
August 16, 2017 08:31
-
-
Save SuperShinyEyes/241895e2a66550eeb1ded6df4c484b54 to your computer and use it in GitHub Desktop.
Subclassing UIView swift
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
class MyView: UIView { | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
addBehavior() | |
} | |
convenience init() { | |
self.init(frame: CGRect.zero) | |
} | |
required init(coder aDecoder: NSCoder) { | |
fatalError("This class does not support NSCoding") | |
} | |
func addBehavior() { | |
print("Add all the behavior here") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment