https://github.com/3sidedcube/storyboard-designable
A helpful set of extensions and subclasses for easier Storyboard UI design
https://github.com/3sidedcube/storyboard-designable
Last synced: 11 months ago
JSON representation
A helpful set of extensions and subclasses for easier Storyboard UI design
- Host: GitHub
- URL: https://github.com/3sidedcube/storyboard-designable
- Owner: 3sidedcube
- License: apache-2.0
- Created: 2016-10-24T13:15:31.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-24T13:32:17.000Z (over 9 years ago)
- Last Synced: 2025-06-28T17:07:39.074Z (12 months ago)
- Language: Swift
- Size: 11.7 KB
- Stars: 2
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# storyboard-designable
A helpful set of extensions and subclasses for easier Storyboard UI design on both macOS and iOS projects
## Usage
Simply drop the swift file into your project!
## Extension on `UIView`/`NSView`
We provide an extension on both `UIView` and `NSView` which adds the following properties as IBDesignables in Interface Builder:
- Border Color (`UIColor`/`NSColor`)
- Border Width (`CGFloat`)
- Corner Radius (`CGFloat`)
- Shadow:
- Color (`UIColor`/`NSColor`)
- Opacity (`CGFloat`)
- Offset (`CGPoint`)
- Radius (`CGFloat`)
Please note, all though these will be available in Interface Builder, they will not render in a storyboard unless you change your view's class to be of class `TSCView`, when you will get to see exactly how your layout looks directly in Interface Builder.
## Buttons
We provide a standard button style, which can be used by using the custom class `TSCButton` (And `TSCPopupButton` on macOS), which adds the following properties:
- Use Border Color (`Bool`): Forces the button to use the border color from the `UIView`/`NSView` extension
- Primary Color (`UIColor`/`NSColor`)
- Secondary Color (`UIColor`/`NSColor`)
- Solid Mode (`Bool`) Whether the button should be solid, or bordered
- Edge Insets (`CGSize`) Adds extra edge insets to the button
We provide two types of buttons: Solid and Bordered
### Solid Buttons
Use Primary Color as the background color, and secondary color as the title color.
### Bordered Buttons
Use Primary Color as the border color, and secondary color as the title color.
## UITextField
Adds the property `textInsets` for adding custom insets to the text field.