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!
-
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.
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)
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
- Submodule only for now ... Cocoapods, Carthage, and better instructions coming soon.
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).
Mazyod (@Mazyod)
UIKitz is released under the MIT license. See LICENSE for details.