Skip to content

Syntactic sugar for init UIEdgeInsets and other similar objects

License

Notifications You must be signed in to change notification settings

acecilia/SugarEdges

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SugarEdges

Syntactic sugar for init UIEdgeInsets and other similar objects.

Usage

Remember to import SugarEdges at the top of the file:

import SugarEdges

Then, instead of initiating like this:

let insets: UIEdgeInsets = UIEdgeInsets(top: 20, left: 10, bottom: 0, right: 10)

You can do it like this:

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. To install it, simply add the following line to your Podfile:

pod 'SugarEdges'

Author

Andrés Cecilia Luque (acecilia) a.cecilia.luque@gmail.com

License

SugarEdges is available under the MIT license. See the LICENSE file for more info.

About

Syntactic sugar for init UIEdgeInsets and other similar objects

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages