Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lbrndnr/sweets
A framework that extends UIKit so that it's somewhat convenient to use with Swift
https://github.com/lbrndnr/sweets
Last synced: about 2 months ago
JSON representation
A framework that extends UIKit so that it's somewhat convenient to use with Swift
- Host: GitHub
- URL: https://github.com/lbrndnr/sweets
- Owner: lbrndnr
- License: mit
- Created: 2015-05-07T05:58:33.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-06-04T10:22:30.000Z (over 8 years ago)
- Last Synced: 2024-05-02T01:26:52.731Z (8 months ago)
- Language: Swift
- Size: 32.2 KB
- Stars: 16
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://img.shields.io/badge/[email protected]?style=flat)](https://twitter.com/lbrndnr)
[![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/lbrndnr/Sweets/blob/master/LICENSE)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)## Author
I'm Laurin Brandner, I'm on [Twitter](https://twitter.com/lbrndnr).## Example
### UIControl
```swift
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
```swift
tableView.registerReusableCellClass(Cell.self)let cell = tableView.dequeueReusableCell(Cell.self) // dequeues a Cell instance
let otherCell = tableView.dequeueReusableCell(OtherCell.self) // returns nillet 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
```objc
github "larcus94/Sweets" ~> 0.0.1
```## License
Sweets is licensed under the [MIT License](http://opensource.org/licenses/mit-license.php).