An extension pack for Swift classes and structs

TinySwift

TinySwift is an extension pack for Swift classes and structs.

Requirements

Swift 3.2-4.2

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 thumbnail iOS, tvOS

Bool

  • init(_: Integer) iOS, tvOS, watchOS
  • static var random iOS, tvOS, watchOS
  • func toggle() iOS, tvOS, watchOS

CGAffineTransform

  • var rotationAngle iOS, tvOS, watchOS
  • var scaleX iOS, tvOS, watchOS
  • var scaleY iOS, tvOS, watchOS

Collection

  • var random iOS, tvOS, watchOS

Array

  • subscript(safe:) iOS, tvOS, watchOS
  • var shuffled iOS, tvOS
  • func remove(element:) iOS, tvOS, watchOS
  • func shuffle() iOS, tvOS

RandomAccessCollection

  • var appearances iOS, tvOS, watchOS
  • var arithmeticMean iOS, tvOS, watchOS
  • var areAllElementsEqual iOS, tvOS, watchOS
  • var geometricMean iOS, tvOS, watchOS
  • var median iOS, tvOS, watchOS
  • var mode iOS, tvOS, watchOS
  • var set iOS, tvOS, watchOS
  • var standardDeviation iOS, tvOS, watchOS
  • var sum iOS, tvOS, watchOS
  • var variance iOS, tvOS, watchOS

Data

  • init(hexadecimalString:) iOS, tvOS, watchOS
  • var hexadecimalString iOS, tvOS, watchOS

Date

  • var day iOS, tvOS, watchOS
  • var firstOfMonth iOS, tvOS, watchOS
  • var firstOfYear iOS, tvOS, watchOS
  • var lastOfMonth iOS, tvOS, watchOS
  • var lastOfYear iOS, tvOS, watchOS
  • var month iOS, tvOS, watchOS
  • var nextDay iOS, tvOS, watchOS
  • var previousDay iOS, tvOS, watchOS
  • var weekday iOS, tvOS, watchOS
  • var year iOS, tvOS, watchOS

FloatingPoint

  • var additiveInverse iOS, tvOS, watchOS
  • var degreesToRadians iOS, tvOS, watchOS
  • var multiplicativeInverse iOS, tvOS, watchOS
  • var radiansToDegrees iOS, tvOS, watchOS

Integer

  • var additiveInverse iOS, tvOS, watchOS
  • var days iOS, tvOS, watchOS
  • var degreesToRadians iOS, tvOS, watchOS
  • var factorial iOS, tvOS, watchOS
  • var hours iOS, tvOS, watchOS
  • var isEven iOS, tvOS, watchOS
  • var isOdd iOS, tvOS, watchOS
  • var isPrime iOS, tvOS, watchOS
  • var minutes iOS, tvOS, watchOS
  • var multiplicativeInverse iOS, tvOS, watchOS
  • var radiansToDegrees iOS, tvOS, watchOS
  • var seconds iOS, tvOS, watchOS

Int

  • init(random:) iOS, tvOS, watchOS
  • var random iOS, tvOS, watchOS
  • func times(execute:) iOS, tvOS, watchOS

String

  • init(path:) iOS, tvOS, watchOS
  • init(random:length:nonRepeating:) iOS, tvOS, watchOS
  • var camelCased iOS, tvOS, watchOS
  • var dataFromHexadecimalString iOS, tvOS, watchOS
  • var emptyIfNil iOS, tvOS, watchOS
  • var initials iOS, tvOS, watchOS
  • var isEmailAddress iOS, tvOS, watchOS
  • var lines iOS, tvOS, watchOS
  • var localized iOS, tvOS, watchOS
  • var nilIfEmpty iOS, tvOS, watchOS
  • var nonEmptyLines iOS, tvOS, watchOS
  • var trimmed iOS, tvOS, watchOS
  • var upperCamelCased iOS, tvOS, watchOS
  • func occurrences(of:) iOS, tvOS, watchOS

TimeInterval

  • func time(with:) iOS, tvOS, watchOS

UIColor

  • init(hex:alpha:) iOS, tvOS, watchOS
  • var hex iOS, tvOS, watchOS

UIDevice

  • var device iOS, tvOS
  • var deviceCode iOS, tvOS
  • var diskSize iOS, tvOS
  • var freeDiskSpace iOS, tvOS

UIImage

  • init(color:size:) iOS, tvOS, watchOS
  • var grayscale iOS, tvOS
  • var normalizedImage iOS, tvOS, watchOS
  • var png iOS, tvOS, watchOS
  • var square iOS, tvOS, watchOS
  • var thumbnail iOS, tvOS, watchOS
  • static func get(from:completion:) iOS, tvOS, watchOS
  • func border(width:color:) iOS, tvOS, watchOS
  • func color(at:) iOS, tvOS, watchOS
  • func crop(to:) iOS, tvOS, watchOS
  • func heic(quality:) iOS, tvOS
  • func jpeg(quality:) iOS, tvOS, watchOS
  • func resize(to:) iOS, tvOS, watchOS

UIImageView

  • func setImage(from:placeholder:completion:) iOS, tvOS

UIScreen

  • var isLowResolution tvOS
  • var isSmallScreen iOS
  • var size iOS

UITableViewCell

  • func hideSeparator() iOS

UIView

  • var viewFromNib iOS, tvOS

UIViewController

  • func presentAlertController(withTitle:message:completion:handler:) iOS, tvOS

WKInterfaceDevice

  • var device iOS, watchOS
  • var isSmaller iOS, watchOS
  • var isLarger iOS, watchOS

GitHub