TinySwift 2.8.0

TinySwift 2.8.0

测试测试
Lang语言 SwiftSwift
许可 MIT
Released最后发布2023年10月
SPM支持SPM

Piotr Sochalewski 维护。



TinySwift 2.8.0

  • Piotr Sochalewski

TinySwift

CI Status codecov Version License Platform

系统要求

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, 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

数据

  • init(hexadecimalString:) iOS, tvOS, watchOS
  • var hexadecimalString iOS, tvOS, watchOS
  • func qrCode(correctionLevel:) iOS, tvOS

日期

  • 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

浮点数

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

整数

  • 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

NSAttributedString

  • func formatted(substring:font:) 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 formatted(substring:font:) iOS、tvOS、watchOS
  • func occurrences(of:) iOS、tvOS、watchOS
  • func qrCode(correctionLevel:encoding:) iOS、tvOS

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
  • func sharpenForQRCode() 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

URL

  • func qrCode(correctionLevel:encoding:) iOS、tvOS

WKInterfaceDevice

  • var device watchOS
  • var isSmaller watchOS
  • var isLarger watchOS

作者

皮奥特·索哈雷夫斯基,sochalewski.github.io

许可证

TinySwift 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。