Skip to content

buribae/Hidden

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.