All Projects → khoi-backyard → Swiftlyext

khoi-backyard / Swiftlyext

Licence: mit
SwiftlyExt is a collection of useful extensions for Swift 3 standard classes and types 🚀

Programming Languages

swift
15916 projects
swift3
66 projects

Projects that are alternatives of or similar to Swiftlyext

Swifterswift
A handy collection of more than 500 native Swift extensions to boost your productivity.
Stars: ✭ 10,706 (+34435.48%)
Mutual labels:  xcode, extensions, cocoapods, carthage, swift-package-manager
Loadingshimmer
An easy way to add a shimmering effect to any view with just one line of code. It is useful as an unobtrusive loading indicator.
Stars: ✭ 1,180 (+3706.45%)
Mutual labels:  swift-framework, xcode, cocoapods, carthage, swift-package-manager
Alamofire
Elegant HTTP Networking in Swift
Stars: ✭ 36,896 (+118919.35%)
Mutual labels:  xcode, cocoapods, carthage, swift-package-manager
Swiftinstagram
Instagram API client written in Swift
Stars: ✭ 570 (+1738.71%)
Mutual labels:  swift-framework, xcode, cocoapods, carthage
Xmlmapper
A simple way to map XML to Objects written in Swift
Stars: ✭ 90 (+190.32%)
Mutual labels:  xcode, cocoapods, carthage, swift-package-manager
Cdmarkdownkit
An extensive Swift framework providing simple and customizable markdown parsing.
Stars: ✭ 158 (+409.68%)
Mutual labels:  xcode, cocoapods, carthage, swift-package-manager
Bfkit Swift
BFKit-Swift is a collection of useful classes, structs and extensions to develop Apps faster.
Stars: ✭ 963 (+3006.45%)
Mutual labels:  xcode, cocoapods, carthage, swift-package-manager
Natrium
A pre-build (Swift) script to alter your Xcode project at pre-build-time per environment, build configuration and target.
Stars: ✭ 131 (+322.58%)
Mutual labels:  xcode, cocoapods, carthage, swift-package-manager
L10n Swift
Localization of the application with ability to change language "on the fly" and support for plural form in any language.
Stars: ✭ 177 (+470.97%)
Mutual labels:  swift-framework, cocoapods, carthage, swift-package-manager
Functionkit
A framework for functional types and operations designed to fit naturally into Swift.
Stars: ✭ 302 (+874.19%)
Mutual labels:  cocoapods, carthage, swift-package-manager, functional-programming
Bow
🏹 Bow is a cross-platform library for Typed Functional Programming in Swift
Stars: ✭ 538 (+1635.48%)
Mutual labels:  cocoapods, carthage, functional-programming
Swiftframeworktemplate
A template for new Swift iOS / macOS / tvOS / watchOS Framework project ready with travis-ci, cocoapods, Carthage, SwiftPM and a Readme file
Stars: ✭ 527 (+1600%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Openssl
OpenSSL package for SPM, CocoaPod, and Carthage, for iOS and macOS
Stars: ✭ 515 (+1561.29%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Sablurimageview
You can use blur effect and it's animation easily to call only two methods.
Stars: ✭ 538 (+1635.48%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Preferences
⚙ Add a preferences window to your macOS app in minutes
Stars: ✭ 898 (+2796.77%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Keyboardshortcuts
Add user-customizable global keyboard shortcuts to your macOS app in minutes
Stars: ✭ 500 (+1512.9%)
Mutual labels:  cocoapods, carthage, swift-package-manager
Badgehub
A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.
Stars: ✭ 592 (+1809.68%)
Mutual labels:  swift-framework, xcode, cocoapods
Bfkit
BFKit is a collection of useful classes and categories to develop Apps faster.
Stars: ✭ 811 (+2516.13%)
Mutual labels:  xcode, cocoapods, carthage
Pulltodismiss
You can dismiss modal viewcontroller like Facebook Messenger by pulling scrollview or navigationbar in Swift.
Stars: ✭ 456 (+1370.97%)
Mutual labels:  swift-framework, cocoapods, carthage
Sidemenu
Simple side/slide menu control for iOS, no code necessary! Lots of customization. Add it to your project in 5 minutes or less.
Stars: ✭ 5,267 (+16890.32%)
Mutual labels:  xcode, cocoapods, carthage

Build Status codecov CocoaPods Compatible Carthage Compatible Swift 3.0.x Platform MIT

SwiftlyExt is a library that extends certain Swift standard types and classes using extension feature in the Swift language.

Requirements

  • iOS 9.0+ / macOS 10.11+ / tvOS 9.0+ / watchOS 2.0+
  • Xcode 8.0+
  • Swift 3.0+

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1.0+ is required to build SwiftlyExt.

To integrate SwiftlyExt into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'SwiftlyExt', '~> 1.3'
end

Then, run the following command:

$ pod install

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate SwiftlyExt into your Xcode project using Carthage, specify it in your Cartfile:

github "khoiln/SwiftlyExt" ~> 1.3

Run carthage update to build the framework and drag the built SwiftlyExt.framework into your Xcode project. U

Swift Package Manager

Adding SwiftlyExt as a dependency is as easy as adding it to the dependencies value of your Package.swift file.

dependencies: [
    .Package(url: "https://github.com/khoiln/SwiftlyExt.git", majorVersion: 1)
]

Note that the Swift Package Manager is still in early design and development, but SwiftlyExt does support its use on supported platforms.

Usage

There are many handy usages of SwiftlyExt, head over CocoaDocs for the comprehensive documentation.

We'll try to list some of the cool examples here.

Array Extensions

[😀,🤡,❤️,💋].sample() // Return a random element
// => 💋
[😀,🤡,❤️,💋].sampleSize(2) // Return n random elements
// => [🤡, 💋]
[1, 2, 3, 4, 5].dropWhile { $0 < 3 } //Drop elements that passes the predicate from the beginning to end
// => [3, 4, 5]
[1, 2, 3, 4, 5].dropWhile { $0 < 3 }.some {$0 % 2 == 0} //And YES you can use method chaining too 👍
// => true
[0, 11, 28, 10].every { $0 % 2 == 0 } //Check if all elements in the array passed the condition
// => false
[0, 11, 28, 10].some { $0 % 2 != 0 } //Check if one of the element passes the condition
// => true
[1, 2, 3, 4, 5].findLastIndex {$0 % 2 == 0} //Find index of the last number which predicate return true for.
// => 3 
[1, 2, 3, 4, 5].groupBy { $0 % 2 == 0 ? "even" : "odd"} //Group common elements from an array to a dictionary of [Hashable : [Element]]
// => ["even": [2,4], "odd": [1,3,5]]
// Any many more....

Date Extensions

let now = Date()
let tmr = now.date(byAddingDays: 1)
             .date(byAddingMinutes: 20) // You could also add year, month... and other time units

now.isBefore(tmr) 
// => true

now?.toString(format: "dd/MM/yyyy HH:mm:ss") // Return the string representation for a date.
// => "03/15/2017 14:34:22"

tmr.year == 2017 // Access time unit properties
tmr.hour == 14
tmr.minute == 54

String Extensions

"John Doe".initials // Return the initials of the String
// => "JD"
"[email protected]".isEmail // Email validation
// => true
"<p>💯</p>".between("<p>", "</p>") // Find the string between two string
// => "💯" 
"01/01/1970 00:34:22".date(format: "dd/MM/yyyy HH:mm:ss") // Return a date from current string
// => Date("01/01/1970 00:34:22")
"https://github.com/Swiftly".base64Encoded // Return base64encoded string
// => "aHR0cHM6Ly9naXRodWIuY29tL1N3aWZ0bHk="
"\n\n\n Swiftly    ".trimmed.reversed // Trim newline and spaces and reverse the string
// => "yltfiwS"
"Swiftly\t\nString\nTest".urlEncoded // URL Encoded
// => "Swiftly%09%0AString%0ATest"
"https%3A%2F%2Fgithub.com%2Fkhoiln%2FSwiftlyEXT".urlDecoded // URL Decoded
// => "https://github.com/khoiln/SwiftlyEXT"
// Any many more....

Int Extensions

1.upTo(3) { print($0) } 
// print 1, 2, 3
5.times { print("🐶") } // Run a block n times
// print 🐶 5 times
1234.digits() // Convert integer to array of digits
// => [1,2,3,4]
201.isIn(range: 200..<300) // Test whether a int is in a range
// => true
// And many more

How to contribute

Any help or feedback is highly appreciated. Please refer to the contributing guidelines for more information.

License

SwiftyExt is released under the MIT license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].