Created
November 13, 2017 23:36
-
-
Save moaible/1584adc20ad0a1b57f92a9c89a4df0b6 to your computer and use it in GitHub Desktop.
[WIP]BlinkView.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 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