Code Monkey home page Code Monkey logo

sweets's Introduction

Sweets

About

Sweets aims to improve the usage of UIKit with Swift. Compared to other third party libraries, Sweets does not try to replace the components of UIKit, it rather extends them to make them more class aware. This framework is still work in progress. I will gradually add new things along the way. Feel free to add things that are cumbersome to use with Swift.

Twitter: @lbrndnr License Carthage compatible

Author

I'm Laurin Brandner, I'm on Twitter.

Example

UIControl

func action(sender: UIControl) {
	println("by \(sender)")
}
control.setAction(action, forControlEvents: .TouchUpInside)
control.setAction(action, forControlEvents: .TouchUpOutside)

control.setAction({ sender in
	println("Hello")
}, forControlEvents: .TouchDown)

UITableView

tableView.registerReusableCellClass(Cell.self)

let cell = tableView.dequeueReusableCell(Cell.self) // dequeues a Cell instance
let otherCell = tableView.dequeueReusableCell(OtherCell.self) // returns nil

let cell: Cell? = tableView.cellForRowAtIndexPath(NSIndexPath(forRow: 0, inSection: 0)) // returns a Cell instance
let cell: OtherCell? = tableView.cellForRowAtIndexPath(NSIndexPath(forRow: 0, inSection: 0)) // returns nil

Installation

###Carthage

github "larcus94/Sweets" ~> 0.0.1

License

Sweets is licensed under the MIT License.

sweets's People

Contributors

lbrndnr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  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.