diff --git a/README.md b/README.md index 5a984bc..7ad654f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # SwiftyExtensions -A set of Swift extensions +A set of Swift extensions [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Build Status](https://travis-ci.org/corin8823/SwiftyExtensions.svg)](https://travis-ci.org/corin8823/SwiftyExtensions/) @@ -16,6 +16,69 @@ You can use [Carthage](https://github.com/Carthage/Carthage) to install `SwiftyE github "corin8823/SwiftyExtensions" ``` -## License +## Contents +- NSMutableAttributedString +- String +- UICollectionView +- UIColor +- UIImage +- UIImageView +- UITableView +- UIView +- UIViewController + +## Extensions + +## NSMutableAttributedString +- ``init(string: String, image: UIImage?, point: CGPoint = CGPointZero, index: Int = 0)`` +- ``init(string: String, lineHeight: CGFloat) `` + +## String +- ``insert(#string: String, atIndex: Int) -> String `` +- ``trim() -> String`` +- ``textHeight(width: CGFloat, font: UIFont) -> CGFloat`` + +## Swift +- ``delay(delay: Double, closure:() -> ())`` +- ``Localized(key: String) -> String`` +- ``StringFromClass(object: AnyObject) -> String`` +- ``LOG(_ body: AnyObject! = "", function: String = __FUNCTION__, line: Int = __LINE__)`` +- ``dispatch_async_main(closure: () -> ())`` +- ``dispatch_async_global(closure: () -> ())`` + +## UICollectionView +- ``registerNibFromClass(type: T.Type)`` +- ``registerNibFromClass(type: T.Type, forSupplementaryViewOfKind kind: String)`` +- ``registerClassFromClass(type: T.Type)`` +- ``dequeueReusableCell(type: T.Type, + forIndexPath indexPath: NSIndexPath) -> T `` +- ``dequeueReusableCell(kind: String, withReuseType type: T.Type, + forIndexPath indexPath: NSIndexPath) -> T`` -SwiftyExtensions is released under the MIT license. See LICENSE for details. \ No newline at end of file +## UIColor +- ``init(rgba: String, alpha: CGFloat = 1.0) `` + +## UIImageView +- ``template()`` + +## UITableView +- ``registerNibFromClass(type: T.Type)`` +- ``registerClassFromClass(type: T.Type)`` +- ``dequeueReusableCell(type: T.Type, + forIndexPath indexPath: NSIndexPath) -> T`` + +## UIView +- ``loadNib() -> UIView`` +- ``roundedCorrner(radius: CGFloat)`` +- ``roundedRectangleFilter()`` +- ``circleFilter()`` +- ``border(width: CGFloat, color: UIColor)`` +- ``removeSublayers()`` +- ``hasViewClass(targetClass: AnyClass) -> Bool`` + +## UIViewController +- ``initialLoadStoryboard() -> UIViewController`` +- ``loadStoryboard() -> UIViewController`` + +## License +SwiftyExtensions is released under the MIT license. See LICENSE for details. diff --git a/SwiftyExtensions.xcodeproj/project.pbxproj b/SwiftyExtensions.xcodeproj/project.pbxproj index b8e1170..bff2bc2 100644 --- a/SwiftyExtensions.xcodeproj/project.pbxproj +++ b/SwiftyExtensions.xcodeproj/project.pbxproj @@ -14,7 +14,6 @@ 015B5B0A1B6DD9BF0087F4D3 /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 015B5B011B6DD9BF0087F4D3 /* String+Extension.swift */; }; 015B5B0B1B6DD9BF0087F4D3 /* Swift+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 015B5B021B6DD9BF0087F4D3 /* Swift+Extensions.swift */; }; 015B5B0C1B6DD9BF0087F4D3 /* UIColor+Hex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 015B5B031B6DD9BF0087F4D3 /* UIColor+Hex.swift */; }; - 015B5B0D1B6DD9BF0087F4D3 /* UIImage+Additions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 015B5B041B6DD9BF0087F4D3 /* UIImage+Additions.swift */; }; 015B5B0E1B6DD9BF0087F4D3 /* UIImageView+Addtions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 015B5B051B6DD9BF0087F4D3 /* UIImageView+Addtions.swift */; }; 015B5B0F1B6DD9BF0087F4D3 /* UIView+Addtions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 015B5B061B6DD9BF0087F4D3 /* UIView+Addtions.swift */; }; 015B5B141B6DDAF10087F4D3 /* UICollectionView+Register.swift in Sources */ = {isa = PBXBuildFile; fileRef = 015B5B111B6DDAF10087F4D3 /* UICollectionView+Register.swift */; }; @@ -43,7 +42,6 @@ 015B5B011B6DD9BF0087F4D3 /* String+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Extension.swift"; sourceTree = ""; }; 015B5B021B6DD9BF0087F4D3 /* Swift+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Swift+Extensions.swift"; sourceTree = ""; }; 015B5B031B6DD9BF0087F4D3 /* UIColor+Hex.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIColor+Hex.swift"; sourceTree = ""; }; - 015B5B041B6DD9BF0087F4D3 /* UIImage+Additions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+Additions.swift"; sourceTree = ""; }; 015B5B051B6DD9BF0087F4D3 /* UIImageView+Addtions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImageView+Addtions.swift"; sourceTree = ""; }; 015B5B061B6DD9BF0087F4D3 /* UIView+Addtions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIView+Addtions.swift"; sourceTree = ""; }; 015B5B111B6DDAF10087F4D3 /* UICollectionView+Register.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UICollectionView+Register.swift"; sourceTree = ""; }; @@ -98,7 +96,6 @@ 015B5AE81B6DD8DB0087F4D3 /* SwiftyExtensions.h */, 015B5B111B6DDAF10087F4D3 /* UICollectionView+Register.swift */, 015B5B031B6DD9BF0087F4D3 /* UIColor+Hex.swift */, - 015B5B041B6DD9BF0087F4D3 /* UIImage+Additions.swift */, 015B5B051B6DD9BF0087F4D3 /* UIImageView+Addtions.swift */, 015B5B121B6DDAF10087F4D3 /* UITableView+Register.swift */, 015B5B061B6DD9BF0087F4D3 /* UIView+Addtions.swift */, @@ -244,7 +241,6 @@ 015B5B0B1B6DD9BF0087F4D3 /* Swift+Extensions.swift in Sources */, 015B5B141B6DDAF10087F4D3 /* UICollectionView+Register.swift in Sources */, 015B5B0C1B6DD9BF0087F4D3 /* UIColor+Hex.swift in Sources */, - 015B5B0D1B6DD9BF0087F4D3 /* UIImage+Additions.swift in Sources */, 015B5B0E1B6DD9BF0087F4D3 /* UIImageView+Addtions.swift in Sources */, 015B5B151B6DDAF10087F4D3 /* UITableView+Register.swift in Sources */, 015B5B0F1B6DD9BF0087F4D3 /* UIView+Addtions.swift in Sources */,