All Projects → pixeldock → PXDToolkit

pixeldock / PXDToolkit

Licence: MIT License
A collection of Swift utility extensions and functions

Programming Languages

swift
15916 projects
ruby
36898 projects - #4 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to PXDToolkit

numeric
numeric facilities for C++ 14; dual numbers, dual quaternions, constrained numbers, intervals
Stars: ✭ 21 (+50%)
Mutual labels:  degrees, radians
vistir
Setup / utilities which most projects eventually need
Stars: ✭ 30 (+114.29%)
Mutual labels:  utilities
devbricksx-android
DevBricksX provides plenty of useful classes that will be used in daily Android development.
Stars: ✭ 22 (+57.14%)
Mutual labels:  utilities
grease
CLI utility for managing GitHub releases that comes in handy on CI servers
Stars: ✭ 20 (+42.86%)
Mutual labels:  utilities
validation-components
A collection of common validation predicates for ValidationToolkit framework
Stars: ✭ 26 (+85.71%)
Mutual labels:  carthage
dynamic-utils
Utility functions to perform dynamic operations on Android.
Stars: ✭ 86 (+514.29%)
Mutual labels:  utilities
iwfp
A utility (Android/iOS/web) app to help maximize your credit card cashback rewards with math and magic. May the five percent be with you ;)
Stars: ✭ 24 (+71.43%)
Mutual labels:  utilities
BubbleShowCase-iOS
ShowCase is a framework that provides with a view that you can display to help your users understand your App features
Stars: ✭ 36 (+157.14%)
Mutual labels:  carthage
greek-utils
A JavaScript library for Greek language with utilities such as replacement of accented and other diacritics characters, conversion from Greek to phonetic, transliterated or greeklish Latin and more.
Stars: ✭ 66 (+371.43%)
Mutual labels:  utilities
plex
Oracle PL/SQL Export Utilities: Export Oracle APEX app, ORDS modules, all schema objects and table data in one go
Stars: ✭ 23 (+64.29%)
Mutual labels:  utilities
go
Monorepo for small Go modules maintained by Tawesoft
Stars: ✭ 16 (+14.29%)
Mutual labels:  utilities
RayCarrot.RCP.Metro
Rayman Control Panel (4.0.0 and above)
Stars: ✭ 24 (+71.43%)
Mutual labels:  utilities
NeumorphismTab
Custom TabBarController with Neumorphism.
Stars: ✭ 78 (+457.14%)
Mutual labels:  carthage
quick-add-github-issue-browser-extension
Quickly add GitHub issues direct from a browser button
Stars: ✭ 14 (+0%)
Mutual labels:  utilities
BetterMappable
Better Mappable through Property Wrappers using ObjectMapper
Stars: ✭ 26 (+85.71%)
Mutual labels:  carthage
TermiNetwork
🌏 A zero-dependency networking solution for building modern and secure iOS, watchOS, macOS and tvOS applications.
Stars: ✭ 80 (+471.43%)
Mutual labels:  carthage
bro-q
Chrome Extension for JSON formatting and jq filtering in your browser.
Stars: ✭ 82 (+485.71%)
Mutual labels:  utilities
SwiftVer
Easily Manage Versioning in MacOS, iOS, watchOS, and tvOS projects.
Stars: ✭ 23 (+64.29%)
Mutual labels:  carthage
SwiftyAcknowledgements
Integrate acknowledgements into your iOS App
Stars: ✭ 40 (+185.71%)
Mutual labels:  carthage
nimblenote
Simple keyboard-driven note taking application for macOS, Linux and Windows.
Stars: ✭ 31 (+121.43%)
Mutual labels:  utilities

PXDToolkit

CI Status Version License Platform Carthage compatible Swift Twitter

Requirements

iOS 8.0 or Greater
Swift 4

If you are using Swift 3.x use PXDToolkit version 0.3.1

If you are using Swift 2.3 use PXDToolkit version 0.2.1

Integration

CocoaPods

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

pod "PXDToolkit", '~> 0.4'

If you are using Swift 3.x use PXDToolkit version 0.3.1:

pod "PXDToolkit", '0.3.1'

If you are using Swift 2.3 use PXDToolkit version 0.2.1:

pod "PXDToolkit", '0.2.1'

Add this to your podfile (if it is not already there) to make the pod work with Swift 4, 3.1 (or Swift 2.3):

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '4.0' # or the Swift version you are using
    end
  end
end

Carthage

You can use Carthage to install PXDToolkit by adding it to your Cartfile:

github "pixeldock/PXDToolkit"

Usage

Int

Random Int between 0 and 10
let randomInt = 10.random

Array

Get random element from Array
let randomElement = ["A", "B", "C"].randomElement

Get 2 random elements from Array

let randomElements = ["A", "B", "C"].randomElements(2)

Get shuffled array (order elements randomly)

let shuffledArray = ["A", "B", "C"].shuffled

UIColor

Color from hex int value
let darkRedColor = UIColor(hex: 0xAA0000)

Color from hex int value with alpha

let darkRedColor = UIColor(hex: 0xAA0000, alpha: 0.5)

Hex string from Color

let redColorHexString = UIColor.redColor().hexString

CGFloat

Degrees to Radians
let angleRadians = CGFloat(180).degreesToRadians

Radians to Degrees

let degrees = CGFloat(3.1415).radiansToDegrees

NSLocalizedString

If your *Localizable.strings* file contains this:
"GREETING" = "Hello";
"TEMPERATURE" = "It is %f.01°C in %@";

You can do this: Get localized string for a key

print(LocalizedString("GREETING")) // "Hello"

And this: Get localized string with dynamic parts

print(LocalizedString("TEMPERATURE", arguments:[21.8, "Paris"])) // "It is 21.8°C in Paris"

UIApplication

Get App version
let appVersion = UIApplication.appVersion()

Get Build number

let buildNumber = UIApplication.appBuild()

Timing Functions

Delay

Delays the execution of the closure. Always runs on the main thread.

delay(seconds: 2) {
   print("hello!")
}

Author

Jörn Schoppe, [email protected]

Comments and suggestions are highly welcome!

License

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

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