TinySwift
系统要求
Swift 3.2-5.7
iOS 8+, tvOS 9+, watchOS 2+
安装
TinySwift通过CocoaPods提供。要安装它,只需将以下行添加到您的Podfile中
pod "TinySwift"
用法
TinySwift是Swift类和结构的扩展包。
它包含以下函数和属性
AVAsset
var thumbnail
iOS, tvOS
Bool
init(_: Integer)
iOS, tvOS, watchOSstatic var random
iOS, tvOS, watchOSfunc toggle()
iOS, tvOS, watchOS
CGAffineTransform
var rotationAngle
iOS, tvOS, watchOSvar scaleX
iOS, tvOS, watchOSvar scaleY
iOS, tvOS, watchOS
Collection
var random
iOS, tvOS, watchOS
Array
subscript(safe:)
iOS, tvOS, watchOSvar shuffled
iOS, tvOSfunc remove(element:)
iOS, tvOS, watchOSfunc shuffle()
iOS, tvOS
RandomAccessCollection
var appearances
iOS, tvOS, watchOSvar arithmeticMean
iOS, tvOS, watchOSvar areAllElementsEqual
iOS, tvOS, watchOSvar geometricMean
iOS, tvOS, watchOSvar median
iOS, tvOS, watchOSvar mode
iOS, tvOS, watchOSvar set
iOS, tvOS, watchOSvar standardDeviation
iOS, tvOS, watchOSvar sum
iOS, tvOS, watchOSvar variance
iOS, tvOS, watchOS
数据
init(hexadecimalString:)
iOS, tvOS, watchOSvar hexadecimalString
iOS, tvOS, watchOSfunc qrCode(correctionLevel:)
iOS, tvOS
日期
var day
iOS, tvOS, watchOSvar firstOfMonth
iOS, tvOS, watchOSvar firstOfYear
iOS, tvOS, watchOSvar lastOfMonth
iOS, tvOS, watchOSvar lastOfYear
iOS, tvOS, watchOSvar month
iOS, tvOS, watchOSvar nextDay
iOS, tvOS, watchOSvar previousDay
iOS, tvOS, watchOSvar weekday
iOS, tvOS, watchOSvar year
iOS, tvOS, watchOS
浮点数
var additiveInverse
iOS, tvOS, watchOSvar degreesToRadians
iOS, tvOS, watchOSvar multiplicativeInverse
iOS, tvOS, watchOSvar radiansToDegrees
iOS, tvOS, watchOS
整数
var additiveInverse
iOS, tvOS, watchOSvar days
iOS, tvOS, watchOSvar degreesToRadians
iOS, tvOS, watchOSvar factorial
iOS, tvOS, watchOSvar hours
iOS, tvOS, watchOSvar isEven
iOS, tvOS, watchOSvar isOdd
iOS, tvOS, watchOSvar isPrime
iOS, tvOS, watchOSvar minutes
iOS, tvOS, watchOSvar multiplicativeInverse
iOS, tvOS, watchOSvar radiansToDegrees
iOS, tvOS, watchOSvar seconds
iOS, tvOS, watchOS
Int
init(random:)
iOS、tvOS、watchOSvar random
iOS, 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 camelCased
iOS、tvOS、watchOSvar dataFromHexadecimalString
iOS、tvOS、watchOSvar emptyIfNil
iOS、tvOS、watchOSvar initials
iOS、tvOS、watchOSvar isEmailAddress
iOS、tvOS、watchOSvar lines
iOS、tvOS、watchOSvar localized
iOS、tvOS、watchOSvar nilIfEmpty
iOS、tvOS、watchOSvar nonEmptyLines
iOS、tvOS、watchOSvar trimmed
iOS、tvOS、watchOSvar upperCamelCased
iOS、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 hex
iOS、tvOS、watchOS
UIDevice
var device
iOS, tvOSvar deviceCode
iOS, tvOSvar diskSize
iOS, tvOSvar freeDiskSpace
iOS, tvOS
UIImage
init(color:size:)
iOS, tvOS, watchOSvar grayscale
iOS, tvOSvar normalizedImage
iOS, tvOS, watchOSvar png
iOS, tvOS, watchOSvar square
iOS, tvOS, watchOSvar thumbnail
iOS, 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 isLowResolution
tvOSvar isSmallScreen
iOSvar size
iOS
UITableViewCell
func hideSeparator()
iOS
UIView
var viewFromNib
iOS, tvOS
UIViewController
func presentAlertController(withTitle:message:completion:handler:)
iOS, tvOS
URL
func qrCode(correctionLevel:encoding:)
iOS、tvOS
WKInterfaceDevice
var device
watchOSvar isSmaller
watchOSvar isLarger
watchOS
作者
皮奥特·索哈雷夫斯基,sochalewski.github.io
许可证
TinySwift 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。