Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/acecilia/sugaredges
Syntactic sugar for init UIEdgeInsets and other similar objects
https://github.com/acecilia/sugaredges
apple edges insets swift swift4 syntactic-sugar
Last synced: about 1 month ago
JSON representation
Syntactic sugar for init UIEdgeInsets and other similar objects
- Host: GitHub
- URL: https://github.com/acecilia/sugaredges
- Owner: acecilia
- License: mit
- Created: 2017-10-14T11:02:44.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-15T15:16:49.000Z (over 6 years ago)
- Last Synced: 2024-04-23T22:19:43.514Z (7 months ago)
- Topics: apple, edges, insets, swift, swift4, syntactic-sugar
- Language: Swift
- Size: 50.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SugarEdges
Syntactic sugar for init UIEdgeInsets and other similar objects.## Usage
Remember to import SugarEdges at the top of the file:```swift
import SugarEdges
```Then, instead of initiating like this:
```swift
let insets: UIEdgeInsets = UIEdgeInsets(top: 20, left: 10, bottom: 0, right: 10)
```You can do it like this:
```swift
let insets: UIEdgeInsets = [.top: 20, .left + .right: 10]
```If you want to use this kind of initialization for other types, just make them conform to the ```ExpressibleByEdgesDictionaryLiteral``` protocol.
## Example
To run the example project, clone the repo, and open the workspace found under the ```Example``` folder with Xcode.
## Installation
SugarEdges is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'SugarEdges'
```## Author
Andrés Cecilia Luque (acecilia)
## License
SugarEdges is available under the MIT license. See the LICENSE file for more info.