buribae / Hidden

Hide and show views easily in Swift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hidden

Version License Platform Swift 3.0

A UIView extension to hide and show views easily in Swift. Traditional way of setting isHidden individually is not only tedious but counterintuitive.

Usage

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
}

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Swift 3.0+
  • iOS 8 or later

Installation

Hidden is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "Hidden"

Author

buribae, buribae@gmail.com

License

Hidden is available under the MIT license. See the LICENSE file for more info.

About

Hide and show views easily in Swift

License:MIT License


Languages

Language:Swift 100.0%