/ExtenSwift

Swift extensions community repository

Primary LanguageSwiftMIT LicenseMIT

ExtenSwift

Swift extensions community repository ! Contribute now ! :)

Extensions

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.

Array

  • Instance methods
    • get(Int) -> Element? - Retrieve an element at index as optional.

Dictionary

  • Instance methods
    • exclude([Key]) - (mutating) Remove the provided keys of the dictionary.
    • excluded([Key]) -> Dictionary - Returns the current dictionary without the provided keys.

NSDate

  • 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.

UIColor

  • Class methods
    • colorFromHex(UInt32, Double) -> UIColor - Create an UIColor from a hexadecimal value.

Pull requests rules

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

Installation

To install ExtenSwift, just drag and drop the .xcodeproj in your project.

Cocoapods will be available soon.

Don't know Swift ?

If you want to contribute otherwise than code, you can make sure that the english of the README is (still) correct !

Thanks

All contributors are listed here ! Don't be shy and submit your pull request ;)