Latest 1.0.1
Homepage https://github.com/e-Sixt/Swible
License MIT
Platforms ios 10.0
Authors

Build Status
codecov
Badge w/ Version
GitHub license

Getting Started

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

pod "Swible"

Usage

Swible core protocol is Designable which requires to methods to be implemented.

public protocol Designable: class {
    func setup()
    func applyStyling()
}

Setup: Is the first point where you can design your view. Main focus here should be to do the setup of code which only happen once. Often times you add subviews and constrain them inside this method.

Apply Styling: Should be used to customize the appearance of your views, for example you would set the backgroundColor, font or aligment here. It is called after setup and can be called multiple times.

UIKit subclasses

Swible provides a couple of base classes for UIKit views. To create your own designable view, choose a subclass which fits your element and subclass from it. Here is an example for a custom UIView

  1. Create a new DesingableView (or any other Designable___) subclass like

    
    class CustomView: DesignableView {
    
    override func setup() {
        // Do any setup in here, e.g. creating constraints in code
    }
    
    override func applyStyling() {
        // Do any styling in here, e.g. background color
    }

}

2. Design your view and add `@IBInspectable` properties.
3. Sometimes Xcode/Interface Builder does not recognize `Designable` subclasses as `@IBDesignable`. **!Workaround!** Declare your custom class as `@IBDesignable` like:
``` swift
@IBDesignable
class CustomView: DesignableView {
}

Author

Contributors:

License

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

alt text

Latest podspec

{
    "name": "Swible",
    "version": "1.0.1",
    "summary": "Swible - Designables made easy in Swift",
    "description": "Swible aims to provide a streamlined way to create custom views which are rendered on the storyboard",
    "homepage": "https://github.com/e-Sixt/Swible",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "e-Sixt": "[email protected]"
    },
    "source": {
        "git": "https://github.com/e-Sixt/Swible.git",
        "tag": "1.0.1"
    },
    "platforms": {
        "ios": "10.0"
    },
    "source_files": "Swible/Classes/**/*",
    "pushed_with_swift_version": "3.0"
}

Pin It on Pinterest

Share This