Skip to content

Instantly share code, notes, and snippets.

@kostapappas
Last active July 18, 2019 05:35
Show Gist options
  • Save kostapappas/d1f9adc6b8c980d3a749f8284df3ea5c to your computer and use it in GitHub Desktop.
Save kostapappas/d1f9adc6b8c980d3a749f8284df3ea5c to your computer and use it in GitHub Desktop.
customView for hotreload
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