https://github.com/gtokman/viewtilities
A collection of UIView utilities.
https://github.com/gtokman/viewtilities
cocoapods swift uiview uiviewcontroller
Last synced: 10 months ago
JSON representation
A collection of UIView utilities.
- Host: GitHub
- URL: https://github.com/gtokman/viewtilities
- Owner: gtokman
- License: mit
- Created: 2019-01-18T20:49:25.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-01-21T16:36:39.000Z (over 7 years ago)
- Last Synced: 2024-12-01T23:21:10.321Z (over 1 year ago)
- Topics: cocoapods, swift, uiview, uiviewcontroller
- Language: Swift
- Homepage:
- Size: 72.3 KB
- Stars: 10
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Viewtilities
**Viewtilities** is a collection of `UIView` utilities. It provides useful extensions that will speed up your workflow
when building your UI.
[](https://cocoapods.org/pods/Viewtilities)
[](https://cocoapods.org/pods/Viewtilities)
[](https://cocoapods.org/pods/Viewtilities)
## Contents
- [Installation](#installation)
- [UIView](#view-examples)
- [Round Corners](#round-corners)
- [Shadow](#shadow)
- [Border](#border)
- [Chaining](#chaining)
- [Custom Views](#custom-view-examples)
- [BaseView](#baseview)
- [ModifiableView](#modifiableview)
- [UIViewControllers](#view-controller-examples)
## View Examples
#### Round Corners
```swift
myView.add(
.cornerRadius(.custom(corners: [.all], radius: 10))
)
```
#### Shadow
```swift
myView.add(
.shadow(.custom(offset: .init(width: 0, height: 2), radius: 5, opacity: 0.25, color: .black))
)
```
#### Border
```swift
myView.add(
.border(.custom(color: .black, width: 1))
)
```
#### Chaining
```swift
myView.add(
.cornerRadius(.custom(corners: [.all], radius: 10)),
.shadow(.custom(offset: .init(width: 0, height: 2), radius: 5, opacity: 0.25, color: .black)),
.border(.default)
)
```
## View Controller Examples
#### Coming soon
## Custom View Examples
#### BaseView - Coming Soon
#### ModifiableView - Coming Soon
## Installation
Viewtilities is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'Viewtilities'
```
Then run pod install.
Don't forget to import `Viewtilities` in every file you'd like to use `Viewtilities`.
## Author
[](https://twitter.com/bestgaryever)
[](https://github.com/gtokman)
## License
Viewtilities is available under the MIT license. See the LICENSE file for more info.