Code Monkey home page Code Monkey logo

swiftyextensions's Introduction

SwiftyExtensions

A set of Swift extensions

Carthage compatible Build Status

Requirements

  • iOS 7.0+
  • Xcode 7.+

Integration

Carthage (iOS 8+)

You can use Carthage to install SwiftyExtensions by adding it to your Cartfile

github "corin8823/SwiftyExtensions"

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<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) -> T
  • dequeueReusableCell<T: UICollectionReusableView>(kind: String, withReuseType type: T.Type, forIndexPath indexPath: NSIndexPath) -> T

UIColor

  • init(rgba: String, alpha: CGFloat = 1.0)

UIImageView

  • template()

UITableView

  • registerNibFromClass<T: UITableViewCell>(type: T.Type)
  • registerClassFromClass<T: UITableViewCell>(type: T.Type)
  • dequeueReusableCell<T: UITableViewCell>(type: T.Type, forIndexPath indexPath: NSIndexPath) -> T

UIView

  • roundedCorrner(radius: CGFloat)
  • roundedRectangleFilter()
  • circleFilter()
  • border(width: CGFloat, color: UIColor)
  • removeSublayers()
  • hasViewClass(targetClass: AnyClass) -> Bool

License

SwiftyExtensions is released under the MIT license. See LICENSE for details.

swiftyextensions's People

Contributors

corin8823 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.