A compact set of complementary additions to UIKit
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Playground/Playground.playground
UIKitz.xcworkspace
UIKitz
.gitignore
.travis.yml
CHANGELOG.md
LICENSE
README.md

README.md

UIKitz :shipit:

Version Travis CI Swift Platforms

A compact set of complementary additions to UIKit

Even though I shipped it with my app, I still need to invest the time to set this up, and finalize the API. Contributors welcome!

Highlights

  • Compact and Transparent:
    Each addition made to the framework is required to be small and as transparent about errors and issues as the underlying API.

  • Full Documentation:
    You can refer to the playground in the project or this read me for the available features.

  • Full Testing:
    Aiming for 100% test coverage for such scattered functionality is a no-brainer.

Features

UINibs

Instantiate Objects from XIBs
using class name and safe casting

// XIB file named "CustomClass" must exist in the bundle
let object = Object.nibObject()                     // .Optional(CustomObject)
let object = Object.nibObject(bundle: customBundle) // .Optional(CustomObject)
let object = Object.nibObject(owner: someOwner)     // .Optional(CustomObject)

Instantiate ViewControllers from Storyboards
using class name and safe casting

let controller = ViewController.createFromStoryboard(storyboard)
// returns .Optional(ViewController)

UIView

Easily support custom views in your ViewController

class CustomView: UIView {}

class ViewController: UIViewController {
    override func loadView() {
        view = CustomView()
    }
}

extension ViewController: CustomViewProvider {
    typealias ViewType = CustomView
}

let customView = ViewController().customView

Convenient grouping for UIViewAutoresizing

let flexibleMargins: UIViewAutoresizing = .FlexibleMargins
let flexibleSize: UIViewAutoresizing = .FlexibleSize

Getting Started

  1. Submodule only for now ... Cocoapods, Carthage, and better instructions coming soon.

Motivation

When our team in my previous company exceeded 2 engineers, things quickly became hectic in terms of convention. In the spirit of fighting this problem, we strove to eliminate the cause of inconsistency altogether and build a very thin convenience layer that is intuitive and easy to pickup.

A good example would be eliminating the need for defining UIxxxCell identifiers all over the place, and stick with class name as the identifier (which covered 100% of our use cases).

Author

Mazyod (@Mazyod)

License

UIKitz is released under the MIT license. See LICENSE for details.