A set of Swift extensions
- iOS 7.0+
- Xcode 7.+
You can use Carthage to install SwiftyExtensions by adding it to your Cartfile
github "corin8823/SwiftyExtensions"
- NSMutableAttributedString
- String
- UICollectionView
- UIColor
- UIImage
- UIImageView
- UITableView
- UIView
- UIViewController
init(string: String, image: UIImage?, point: CGPoint = CGPointZero, index: Int = 0)init(string: String, lineHeight: CGFloat)
insert(#string: String, atIndex: Int) -> Stringtrim() -> StringtextHeight(width: CGFloat, font: UIFont) -> CGFloat
delay(delay: Double, closure:() -> ())Localized(key: String) -> StringStringFromClass(object: AnyObject) -> StringLOG(_ body: AnyObject! = "", function: String = __FUNCTION__, line: Int = __LINE__)dispatch_async_main(closure: () -> ())dispatch_async_global(closure: () -> ())
registerNibFromClass<T: UICollectionViewCell>(type: T.Type)registerNibFromClass<T: UICollectionReusableView>(type: T.Type, forSupplementaryViewOfKind kind: String)registerClassFromClass<T: UICollectionViewCell>(type: T.Type)dequeueReusableCell<T: UICollectionViewCell>(type: T.Type, forIndexPath indexPath: NSIndexPath) -> TdequeueReusableCell<T: UICollectionReusableView>(kind: String, withReuseType type: T.Type, forIndexPath indexPath: NSIndexPath) -> T
init(rgba: String, alpha: CGFloat = 1.0)
template()
registerNibFromClass<T: UITableViewCell>(type: T.Type)registerClassFromClass<T: UITableViewCell>(type: T.Type)dequeueReusableCell<T: UITableViewCell>(type: T.Type, forIndexPath indexPath: NSIndexPath) -> T
roundedCorrner(radius: CGFloat)roundedRectangleFilter()circleFilter()border(width: CGFloat, color: UIColor)removeSublayers()hasViewClass(targetClass: AnyClass) -> Bool
SwiftyExtensions is released under the MIT license. See LICENSE for details.