Skip to content

A compact set of complementary additions to UIKit

License

Notifications You must be signed in to change notification settings

SwiftKitz/UIKitz

Repository files navigation

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.

About

A compact set of complementary additions to UIKit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages