Swarkn 是一个轻量级库,提供了一些您在 Swift 项目中可能会用到的小功能。
- UIColor - initialization from a rgb value.
- UIImage - image resizing, image with a color and a size...
- UIImageView - Mask with circle, set elevation...
- UINavigationBar - Hide Navigation Bar Bottom Line.
- UIActivityType - Get raw name description from different activities
- Array - Remove duplicates from an array easily.
- Dictionary - Sort keys by value and vice versa.
- NSBundle - Build and Version name as variables.
- NSLocale - languagesLocaleISO639_1 and languagesLocaleISO639_3 as Dictionaries,
get country name form ISO code...
- String - Ignore accents, trimming, substring with a given range...
- Email
- Phone Number (Spain numbers so far)
- URL
- ID Card (Spain so far)
- Social Security Number (Spain so far)
- Take a screenshot of the current window (takeScreenshot())
- Delay a code block execution in an easy way (delay(seconds, closure))
- IS_IPHONE, IS_IPAD, ScreenType (iPhone4, iPhone 5, etc...) constants, in order to give
a quick access of them.
- DimmingPresentationController. UIPresentationController which gives a dimmed
background to your presented controller.
Swarkn 通过 CocoaPods 提供使用。要安装它,只需将以下行添加到您的 Podfile 中
pod "Swarkn"
Swarkn 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。