Swift extensions community repository ! Contribute now ! :)
Here you can see all the currently available extensions. If you want to add yours, you just have to make a pull request. Before it, just make sure that you respect all the Pull requests rules listed below.
- Instance methods
get(Int) -> Element?
- Retrieve an element at index as optional.
- Instance methods
exclude([Key])
- (mutating) Remove the provided keys of the dictionary.excluded([Key]) -> Dictionary
- Returns the current dictionary without the provided keys.
-
Instance methods
isAnteriorToDate(NSDate) -> Bool
- Check if a date is anterior to another.isPosteriorToDate(NSDate) -> Bool
- Check if a date is posterior to another.toString(String) -> String
- Convert date to string using format.
-
Class methods
dateFromString(String, String) -> NSDate!
- Convert a string to date using format.stringFromDate(NSDate, String) -> String!
- Convert a date to string using format.
-
Class methods
isValidEmail -> Bool
- Check if the string is an email.
-
Class attributs
localized
- Allow to localize the string very fast.
- Class methods
colorFromHex(UInt32, Double) -> UIColor
- Create an UIColor from a hexadecimal value.
- Class attributs
deviceType
- Get name of the device (iPhone / iPad).
- Class methods
downloadedFrom(String, UIViewContentMode)
- Download image from link and set the image on UIImageView.
- Class methods
setCornerBorder(CGFloat, UIColor, CGFloat = 0, Bool = true)
- Download image from link and set the image on UIImageView.
- Class methods
initFromStoryBoard(String, String) -> UIViewController?
- Instantiate a storyboard UIViewController using its identifier.
To keep this repository clean and safe, you must ensure that your code respects the following rules :
- All the code you provide must be added into the
ExtenSwift.swift
file. - All the code you provide must conform to the Swift 2 syntax.
- You must add a (brief) documentation to your function(s) like (at least) :
/// Describe your function here (required)
///
/// - author: Louis BODART (optional)
/// - parameters: (required if exists)
/// - Int: First parameter description
/// - String: Another parameter description
/// - throws: (required if exists)
/// What kind of error is thrown
/// - returns: (required if exists)
/// The return of your function goes here
- You must add your function(s) prototype and description into the README.md file.
- All your adds must be in the alphabetical order. That includes :
- Adds into the
ExtenSwift.swift
file - Adds into the README.md
- Adds into the
To install ExtenSwift, just drag and drop the .xcodeproj
in your project.
Cocoapods will be available soon.
If you want to contribute otherwise than code, you can make sure that the english of the README is (still) correct !
All contributors are listed here ! Don't be shy and submit your pull request ;)