Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xai3/Nori
Easier to apply code based style guide to storyboard.
https://github.com/xai3/Nori
Last synced: 15 days ago
JSON representation
Easier to apply code based style guide to storyboard.
- Host: GitHub
- URL: https://github.com/xai3/Nori
- Owner: xai3
- License: mit
- Created: 2016-11-22T08:29:58.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-03T14:49:57.000Z (over 5 years ago)
- Last Synced: 2024-05-29T04:54:13.387Z (7 months ago)
- Language: Swift
- Homepage:
- Size: 54.7 KB
- Stars: 295
- Watchers: 10
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - Nori - Easier to apply code based style guide to storyboard. (Tools / Web View)
README
# Nori
**Nori** designs the view of the storyboard with source code.
![nori](https://cloud.githubusercontent.com/assets/6880730/23615653/79cb71fc-02ca-11e7-8c5f-0b1ba2698190.gif)
## Usage
### Label
Define the custom class that extends `StyleableLabel` as `@IBDesignable`. And implement the `func intrinsicStyle() -> LabelStyle`.
``` swift
import Nori@IBDesignable class LargeLabel: StyleableLabel {
override func intrinsicStyle() -> LabelStyle {
return LabelStyle {
$0.textColor = Color.black.color
$0.font = UIFont.systemFont(ofSize: FontSize.large.point)
}
}
}
```### Button
It's same as the Label.
``` swift
@IBDesignable class StarButton: StyleableButton {
override func intrinsicStyle(for state: UIControlState) -> ButtonStyle {
return ButtonStyle {
$0.backgroundColor = Color.green.color
$0.cornerRadius = 10
$0.title = LabelStyle {
$0.textColor = UIColor.white
}
}
}
}
```## Supported views
* View
* Button
* ImageView
* Label
* TextField
* Switch## License
Nori is released under the MIT license. See LICENSE for details.