Hidden
A UIView extension to hide and show views easily in Swift. Traditional way of setting isHidden individually is not only tedious but counterintuitive.
Do this.
import Hidden
if !isDateHidden {
show(dateLabel, contentLabel)
hide(contentTextView)
} else {
hide(dateLabel, contentLabel)
show(contentTextView)
}
instead
if !isDateHidden {
dateLabel.isHidden = false
contentLabel.isHidden = false
contentTextView.isHidden = true
} else {
dateLabel.isHidden = true
contentLabel.isHidden = true
contentTextView.isHidden = false
}
To run the example project, clone the repo, and run pod install
from the Example directory first.
- Swift 3.0+
- iOS 8 or later
Hidden is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "Hidden"
buribae, [email protected]
Hidden is available under the MIT license. See the LICENSE file for more info.