Name: LiipKit
Owner: Liip
Description: LiipKit regroups usefull classes/extensions used in many applications
Created: 2016-11-07 15:57:33.0
Updated: 2017-01-12 11:04:18.0
Pushed: 2016-11-15 07:31:05.0
Size: 35
Language: Swift
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Requires Swift3.
LiipKit is available through the Liip CocoaPods repo. To install it, simply add the following lines to your Podfile:
"LiipKit"
To run the example project, clone the repo, and run pod install
from the Example directory first.
Convert seconds (Int) to hours:minutes:seconds (String)
secondsToHoursMinutesSeconds() // => == "0:02:00"
Transform a date to a string
.toString() // => "08-03-2016
.toString("dd.MM.yyyy") // => "08.03.2016"
.toString("yyyy") // => "2016"
Prefix tilde for localized string
st" // => == NSLocalizedString("test", comment: "No comment")
Method which return true if a string is empty or whitespace(s)
sEmptyOrWhitespace() // true
.isEmptyOrWhitespace() // true
t".isEmptyOrWhitespace() // false
Convert string to DateTime object with .toDateTime
6-03-08T00:00:00.000+01:00".toDateTime()
Method show
to allow to show the alert without knowing the top view controller required to present an alert.
alert = UIAlertController(title: "Alert", message: "Alert message", preferredStyle: UIAlertControllerStyle.alert)
t.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.default, handler: nil))
t.show(animated: true, completion: nil)
Provide a property localizedTitle
which is available in Interface Builder (see Main.storyboard in Example project).
Provide a property localizedTitleForNormal
and localizedTitleForHighlighted
which are available in Interface Builder (see Main.storyboard in Example project).
Hex initializers
lor(hex: 0x0099FF)
lor(hex: 0x0099FF, alpha: 0.3)
lor(hexString: "0x0099FF")
lor(hexString: "#0099FF")
lor(hexString: "0x0099FF", alpha: 0.3)
lor(hexString: "#0099FF", alpha: 0.3)
Simplified initializers
lor(r: 0, g: 127.5, b: 255)
lor(r: 0, g: 127.5, b: 255, a: 0.5)
Provide a property localizedText
which is available in Interface Builder (see Main.storyboard in Example project).
LiipKit is available under the MIT license. See the LICENSE file for more info.