Skip to content

Latest commit

 

History

History
76 lines (57 loc) · 1.38 KB

FormsDemo.md

File metadata and controls

76 lines (57 loc) · 1.38 KB

FormsDemo

FormsDemo is all features demo.

Import

import FormsDemo

Dependencies

Forms.framework
FormsAnalytics.framework
FormsDeveloperTools.framework
FormsImagePicker.framework
FormsMock.framework
FormsNetworking.framework
FormsPermissions.framework
FormsSideMenu.framework
FormsSocialKit.framework
FormsTransition.framework

Usage

Forms Demo

let window: UIWindow = UIWindow(frame: UIScreen.main.bounds)
window.rootViewController = DemoRootViewController()
window.makeKeyAndVisible()

Forms Demo with custom components

Create own Demo structure

protocol DemoRowType {
    var rawValue: String { get }
}

protocol DemoRow {
    var type: DemoRowType { get }
    var title: String { get }
    var subtitle: String? { get }
    var sections: [DemoSection] { get }
    var shouldPresent: Bool { get }
}

protocol DemoSection {
    var title: String? { get }
    var rows: [DemoRow] { get }
}

Initialization

let sections: [DemoSection] = /* custom sections */
DemoRootViewController(sections, getRowController) 

func getRowController(row: DemoRow) -> UIViewController? {
    // switch your row.type
}

Architectures - CleanSwift

There is CleanSwift.xctemplate in ./FormsExample/Resources/Templates folder. You can copy it to

~/Library/Developer/Xcode/Templates/Custom