Latest 0.0.6
License MIT
Platforms ios 8.0
Frameworks UIKit

Syntactic sugar for init UIEdgeInsets and other similar objects.


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.


To run the example project, clone the repo, and open the workspace found under the Example folder with Xcode.


SugarEdges is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'SugarEdges'


Andrés Cecilia Luque (acecilia) [email protected]


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

Latest podspec

    "name": "SugarEdges",
    "version": "0.0.6",
    "summary": "Syntactic sugar for init UIEdgeInsets and other similar objects",
    "description": "This framework provides the protocol ExpressibleByEdgesDictionaryLiteral in order to be used with other custom types.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Andru00e9s Cecilia Luque": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.0.6"
    "platforms": {
        "ios": "8.0"
    "source_files": "Sources/**/*",
    "frameworks": "UIKit"

Pin It on Pinterest

Share This