GNCheckView 0.1.8

GNCheckView 0.1.8

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Sep 2015
SPMSupports SPM

Maintained by Gonzalo Nunez.



  • By
  • Gonzalo Nunez

GNCheckView

GNCheckView is a UIView subclass that neatly animates between a checked and an unchecked state. Serves as a nice alternative to UITableViewAccessoryTypeCheckmark or for any other of your check-marking needs!

Screenshot

Usage

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

Using GNCheckView is incredibly simple! It all comes down to one function:

public func check(shouldCheck:Bool, animated:Bool)

For the lazier people in life, here are a couple convenience functions!

public func checkAnimated(animated:Bool)

public func uncheckAnimated(animated:Bool)

For the nitpickier people in life, GNCheckView also comes with several properties that each change the behavior.

@IBInspectable public var primaryColor = UIColor.blackColor() {

This is the color that the checkmark is drawn in.

@IBInspectable public var secondaryColor = UIColor.whiteColor() {

This is what serves as the backgroundColor of the view. See -invertsOnCheck for more.

@IBInspectable public var initiallyDrawn = false

This determines if the checkmark is initially drawn or not.

@IBInspectable public var showsBorder = true

If true, the view automatically has a border around it with a cornerRadius of 5, borderWidth of 2, and a borderColor that matches the primaryColor

@IBInspectable public var invertsOnCheck = true

If true, once checked the view that switches the check to the secondaryColor and the background to the primaryColor, providing for a nice little effect.

Finally, there’s a boolean for you to check the state!

public var checked : Bool {

Installation

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

pod "GNCheckView"

Author

Gonzalo Nunez, [email protected]

License

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