facebook twitter hatena line email

Ios/swift/外部ライブラリ/Eureka

提供: 初心者エンジニアの簡易メモ
2016年8月2日 (火) 19:05時点におけるAdmin (トーク | 投稿記録)による版

移動: 案内検索

Eurekaとは

swiftの設定画面用のライブラリ

公式

https://github.com/xmartlabs/Eureka

インストール

source 'https://github.com/CocoaPods/Specs.git'  
platform :ios, '8.0'  
use_frameworks!
pod 'Eureka', '~> 1.6'

サンプル

import Eureka
class MyFormViewController: FormViewController {
   override func viewDidLoad() {
       super.viewDidLoad()
       form +++ Section("Section1")
           <<< TextRow(){ row in
               row.title = "Text Row"
               row.placeholder = "Enter text here"
           }
           <<< PhoneRow(){
               $0.title = "Phone Row"
               $0.placeholder = "And numbers here"
           }
       +++ Section("Section2")
           <<< DateRow(){
               $0.title = "Date Row"
               $0.value = NSDate(timeIntervalSinceReferenceDate: 0)
           }
   }
}