Latest 0.0.1
Homepage https://github.com/Badlazzor/Spiffy
License MIT
Platforms ios 9.0, requires ARC
Authors

Spiffy is a lightweight styling library for iOS apps written in Swift. It’s main goal is to help define easy-to-apply styles, and NOT to create an all-knowing super wrapper.

// Swift

import Spiffy
import UIKit

class ViewController: UIViewController {
    @IBOutlet weak var button: UIButton!
    @IBOutlet weak var label: UILabel!

    override func viewDidLoad() {
        super.viewDidLoad()

        button.styled(by: Styles.Showcase.Button.base)
        label.styled(by: Styles.Showcase.Label.base)
    }
}

extension Styles {
    fileprivate enum Showcase {
        enum Label {
            static let base = Styles.Label.Style(
                .alignment(.right),
                .color(.blue)
            )
        }

        enum Button {
            static let base: [Styling] = [
                Styles.View.Predefined.autolayouted,
                Styles.Button.Style(
                    .titleColor(with: .black, for: .normal),
                    .backgroundColor(with: .white, for: .normal),
                    .titleColor(with: .red, for: .highlighted),
                    .backgroundColor(with: .gray, for: .highlighted)
                )
            ]
        }
    }
}

Requirements

  • XCode 10.0
  • Swift 4.2

Installation

CocoaPods

Tested with pod --version: 1.6.1

# Podfile
use_frameworks!

target 'YOUR_TARGET_NAME' do
    pod 'Spiffy',    '~> 0.0.1'
end

Replace YOUR_TARGET_NAME and then, in the Podfile directory, type:

$ pod install

Latest podspec

{
    "name": "Spiffy",
    "version": "0.0.1",
    "license": {
        "type": "MIT",
        "file": "LICENSE.md"
    },
    "homepage": "https://github.com/Badlazzor/Spiffy",
    "authors": {
        "Balu00e1zs Hajagos": "[email protected]"
    },
    "summary": "Spiffy is a lightweight styling library for iOS applications",
    "description": "Spiffy is a lightweight styling library tailored to be as easy to use and as extensible as possible while maintaining a coherent coding experience.",
    "source": {
        "git": "https://github.com/Badlazzor/Spiffy.git",
        "tag": "0.0.1"
    },
    "requires_arc": true,
    "swift_version": "4.2",
    "source_files": "Spiffy/**/*.{swift,h,m}",
    "ios": {
        "frameworks": "UIKit"
    },
    "platforms": {
        "ios": "9.0"
    }
}

Pin It on Pinterest

Share This