This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BundleSegue: ConfigurationSegue { | |
| typealias Source = BundlesViewController | |
| typealias Destination = BundleViewController | |
| typealias First = BundlesViewController | |
| typealias Second = BundleViewController | |
| override func inject() { | |
| destinationController.viewModel = resolver.resolve(BundleViewModelType.self) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| protocol GiverType { | |
| var message: String { get } | |
| } | |
| protocol ReceiverType: class { | |
| var message: String? { get set } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| protocol GiverType { | |
| var message: String { get } | |
| } | |
| protocol ReceiverType: class { | |
| var message: String? { get set } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * SwinjectでSegueにInjectするSegueOperatorTypeを指定する。 | |
| * nameにSegueのIdentifierを指定する。 | |
| */ | |
| container.register(SegueOperatorType.self, name: "BundlesSegue") { _ in | |
| return SegueOperator { | |
| _, _ in | |
| print("test") | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| viewController?.performSegueWithIdentifier(R.segue.bundlesViewController.bundleSegue.identifier, | |
| sender: TransitionOperator { | |
| (e: UIStoryboardSegue, s: BundlesViewController, d: BundleViewController) in | |
| d.id = id | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func showNextPage(id: Int) { | |
| performSegueWithIdentifier("MySegue", sender: TransitionOperator { | |
| (e: UIStoryboardSegue, _, d: DestinationViewController) in | |
| d.id = id | |
| }) | |
| } | |
| override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { | |
| switch sender { | |
| case let transitionOperator as TransitionOperatorType: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var viewController: SampleViewController? { | |
| let viewControllers = handler?.allViewControllers | |
| for obj in viewControllers { | |
| print(obj) | |
| } | |
| return nil | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private protocol P1 { | |
| var p1: String { get } | |
| var p1_ : String { get set } | |
| init() | |
| init(p1: String) | |
| } | |
| extension P1 { | |
| init(p1: String) { | |
| self.init() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum Zundoko: String { | |
| case Zun = "ズン" | |
| case Doko = "ドコ" | |
| } | |
| var zundoko = Array<Zundoko>() | |
| let gen = anyGenerator { return arc4random_uniform(2) == 0 ? Zundoko.Zun : Zundoko.Doko } | |
| .lazy | |
| .map { (zd) -> [Zundoko] in | |
| zundoko.append(zd) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TripleGenerator: GeneratorType { | |
| static let max: Int = 1000 | |
| typealias Element = Triple | |
| var triple: Triple? = Triple(a: 3, b: 4, c: 5) | |
| func nextTriple(a a: Int, b: Int) -> Triple? { | |
| var nextA = a | |
| var nextB = b |