Last active
July 18, 2019 05:35
-
-
Save kostapappas/d1f9adc6b8c980d3a749f8284df3ea5c to your computer and use it in GitHub Desktop.
customView for hotreload
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 UIKit | |
import Stevia | |
final class ContactUsView: UIView { | |
private var container = UIView() | |
@objc func injected() { | |
initialSetup() | |
} | |
override init(frame: CGRect) { | |
super.init(frame: frame) | |
self.initialSetup() | |
} | |
required init?(coder aDecoder: NSCoder) { | |
super.init(coder: aDecoder) | |
self.initialSetup() | |
} | |
private func initialSetup() { | |
setupViews() | |
configureAutolayoutConstrains() | |
styleView() | |
} | |
private func setupViews() { | |
self.svh([container]) | |
} | |
//put here your initial autoLayout Setup | |
private func configureAutolayoutConstrains() { | |
container.centerInContainer().fillContainer() | |
} | |
private func styleView() { | |
self.container.style { (view) in | |
view.backgroundColor = .white | |
} | |
} | |
} | |
extension UIView { | |
func svh(_ array: [UIView]) { | |
for view in array { | |
view.removeFromSuperview() | |
} | |
self.sv(array) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment