CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

KabuKit 0.4.0

KabuKit 0.4.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Oct 2017
SwiftSwift Version 3.0
SPMSupports SPM

Maintained by crexista.



KabuKit 0.4.0

  • By
  • crexista

KabuKit



KabuKit is Simple & Tiny Application’s Transition Framework

Introduction

KabuKitはアプリケーションの画面遷移時のルーティングと
その際に各画面で必要となっている値渡しを行うシンプルなフレームワークです。

Requirements

  • Xcode 8.3.2+
  • Swift 3.0+

このREADME.mdはまだ完全ではありません、以下はまだ書き途中です


About Architecture

kabukit_architecture

Get Start (example)

  1. 遷移元の画面と遷移先の画面にSceneを実装します
//遷移元
extension FromViewController : Scene {
  typealias contextType : Void
}
// 遷移先
extension ToViewController: Scene {
  typealias contextType: String
}
  1. 画面から飛ばすリクエストの設定します
class TrasitRequest: Request<String>()

extension FromViewController : Scene {
  typealias contextType : String

  @IBAction func onTapNext(sender: UIButton) {
    send(TransitRequst("hello"))
  }
}
  1. ルーティング
class SampleGuide {
  typealias Stage = UINavigationController

  func start(with operation: SceneOperation<UINavigationController>) {

    operation.at(Sample1ViewController.self) { s in

      s.given(Sample2Request.self) { (args) in
         args.stage.pushViewController(args.next, animated: true)
         return {
            args.stage.popViewController(animated: true)
         }
      }

    }
  }
}