TinySwift
Requirements
Swift 3.2-5.7
iOS 8+, tvOS 9+, watchOS 2+
Installation
TinySwift is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "TinySwift"Usage
TinySwift is an extension pack for Swift classes and structs.
It contains the following functions and properties:
AVAsset
var thumbnailiOS, tvOS
Bool
init(_: Integer)iOS, tvOS, watchOSstatic var randomiOS, tvOS, watchOSfunc toggle()iOS, tvOS, watchOS
CGAffineTransform
var rotationAngleiOS, tvOS, watchOSvar scaleXiOS, tvOS, watchOSvar scaleYiOS, tvOS, watchOS
Collection
var randomiOS, tvOS, watchOS
Array
subscript(safe:)iOS, tvOS, watchOSvar shufflediOS, tvOSfunc remove(element:)iOS, tvOS, watchOSfunc shuffle()iOS, tvOS
RandomAccessCollection
var appearancesiOS, tvOS, watchOSvar arithmeticMeaniOS, tvOS, watchOSvar areAllElementsEqualiOS, tvOS, watchOSvar geometricMeaniOS, tvOS, watchOSvar medianiOS, tvOS, watchOSvar modeiOS, tvOS, watchOSvar setiOS, tvOS, watchOSvar standardDeviationiOS, tvOS, watchOSvar sumiOS, tvOS, watchOSvar varianceiOS, tvOS, watchOS
Data
init(hexadecimalString:)iOS, tvOS, watchOSvar hexadecimalStringiOS, tvOS, watchOSfunc qrCode(correctionLevel:)iOS, tvOS
Date
var dayiOS, tvOS, watchOSvar firstOfMonthiOS, tvOS, watchOSvar firstOfYeariOS, tvOS, watchOSvar lastOfMonthiOS, tvOS, watchOSvar lastOfYeariOS, tvOS, watchOSvar monthiOS, tvOS, watchOSvar nextDayiOS, tvOS, watchOSvar previousDayiOS, tvOS, watchOSvar weekdayiOS, tvOS, watchOSvar yeariOS, tvOS, watchOS
FloatingPoint
var additiveInverseiOS, tvOS, watchOSvar degreesToRadiansiOS, tvOS, watchOSvar multiplicativeInverseiOS, tvOS, watchOSvar radiansToDegreesiOS, tvOS, watchOS
Integer
var additiveInverseiOS, tvOS, watchOSvar daysiOS, tvOS, watchOSvar degreesToRadiansiOS, tvOS, watchOSvar factorialiOS, tvOS, watchOSvar hoursiOS, tvOS, watchOSvar isEveniOS, tvOS, watchOSvar isOddiOS, tvOS, watchOSvar isPrimeiOS, tvOS, watchOSvar minutesiOS, tvOS, watchOSvar multiplicativeInverseiOS, tvOS, watchOSvar radiansToDegreesiOS, tvOS, watchOSvar secondsiOS, tvOS, watchOS
Int
init(random:)iOS, tvOS, watchOSvar randomiOS, tvOS, watchOSfunc times(execute:)iOS, tvOS, watchOS
NSAttributedString
func formatted(substring:font:)iOS, tvOS, watchOS
String
init(path:)iOS, tvOS, watchOSinit(random:length:nonRepeating:)iOS, tvOS, watchOSvar camelCasediOS, tvOS, watchOSvar dataFromHexadecimalStringiOS, tvOS, watchOSvar emptyIfNiliOS, tvOS, watchOSvar initialsiOS, tvOS, watchOSvar isEmailAddressiOS, tvOS, watchOSvar linesiOS, tvOS, watchOSvar localizediOS, tvOS, watchOSvar nilIfEmptyiOS, tvOS, watchOSvar nonEmptyLinesiOS, tvOS, watchOSvar trimmediOS, tvOS, watchOSvar upperCamelCasediOS, tvOS, watchOSfunc formatted(substring:font:)iOS, tvOS, watchOSfunc occurrences(of:)iOS, tvOS, watchOSfunc qrCode(correctionLevel:encoding:)iOS, tvOS
TimeInterval
func time(with:)iOS, tvOS, watchOS
UIColor
init(hex:alpha:)iOS, tvOS, watchOSvar hexiOS, tvOS, watchOS
UIDevice
var deviceiOS, tvOSvar deviceCodeiOS, tvOSvar diskSizeiOS, tvOSvar freeDiskSpaceiOS, tvOS
UIImage
init(color:size:)iOS, tvOS, watchOSvar grayscaleiOS, tvOSvar normalizedImageiOS, tvOS, watchOSvar pngiOS, tvOS, watchOSvar squareiOS, tvOS, watchOSvar thumbnailiOS, tvOS, watchOSstatic func get(from:completion:)iOS, tvOS, watchOSfunc border(width:color:)iOS, tvOS, watchOSfunc color(at:)iOS, tvOS, watchOSfunc crop(to:)iOS, tvOS, watchOSfunc heic(quality:)iOS, tvOSfunc jpeg(quality:)iOS, tvOS, watchOSfunc resize(to:)iOS, tvOS, watchOS
UIImageView
func setImage(from:placeholder:completion:)iOS, tvOSfunc sharpenForQRCode()iOS, tvOS
UIScreen
var isLowResolutiontvOSvar isSmallScreeniOSvar sizeiOS
UITableViewCell
func hideSeparator()iOS
UIView
var viewFromNibiOS, tvOS
UIViewController
func presentAlertController(withTitle:message:completion:handler:)iOS, tvOS
URL
func qrCode(correctionLevel:encoding:)iOS, tvOS
WKInterfaceDevice
var devicewatchOSvar isSmallerwatchOSvar isLargerwatchOS
Author
Piotr Sochalewski, sochalewski.github.io
License
TinySwift is available under the MIT license. See the LICENSE file for more info.