Skip to content

Instantly share code, notes, and snippets.

@moaible
Created November 13, 2017 23:36
Show Gist options
  • Select an option

  • Save moaible/1584adc20ad0a1b57f92a9c89a4df0b6 to your computer and use it in GitHub Desktop.

Select an option

Save moaible/1584adc20ad0a1b57f92a9c89a4df0b6 to your computer and use it in GitHub Desktop.
[WIP]BlinkView.swift
class BlinkView: UIView {
// MARK: - Property
private var contentViews: [UIView] = []
private(set) var displayView: UIView? {
willSet {
displayView?.removeFromSuperview()
if let displayView = newValue {
addSubview(displayView)
}
}
}
private var displayIndex: Int = 0
// MARK: - Initialize
required convenience init(with views: [UIView]) {
self.init(frame: CGRect.zero)
self.contentViews = views
}
override init(frame: CGRect) {
super.init(frame: frame)
}
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
// MARK: - Layout
override func layoutSubviews() {
super.layoutSubviews()
displayView?.frame = bounds
}
// MARK: -
private func configure() {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment