Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CodeGenExample/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
<segment title="SwiftGen"/>
<segment title="Natalie"/>
<segment title="R.Swift"/>
<segment title="SegueManager + R.swift"/>
<segment title="CGUtils"/>
<segment title="None"/>
</segments>
Expand All @@ -156,11 +157,11 @@
<rect key="frame" x="0.0" y="130" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="WCw-Qf-5nD" id="37f-cq-3Eg">
<rect key="frame" x="0.0" y="0.0" width="320" height="43.5"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" text="Title" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Arm-wq-HPj">
<rect key="frame" x="15" y="0.0" width="290" height="43.5"/>
<rect key="frame" x="15" y="0.0" width="290" height="43"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="20"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
Expand Down
11 changes: 10 additions & 1 deletion CodeGenExample/DetailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
//

import UIKit
import SegueManager

class DetailViewController: UIViewController {
class DetailViewController: UIViewController, SeguePerformer {

@IBOutlet weak var detailDescriptionLabel: UILabel!

lazy var segueManager: SegueManager = { SegueManager(viewController: self) }()

var generatorType: GeneratorType = .None

var detailItem: AnyObject? {
Expand Down Expand Up @@ -67,6 +70,8 @@ class DetailViewController: UIViewController {
if let segueInfo = R.segue.detailViewController.imageView(segue: segue) {
segueInfo.destinationViewController.imageToShow = R.image.lolwut()
}
case .SegueManager_R:
segueManager.prepareForSegue(segue)
case .CodeGenUtils:
switch segue.identifier {
case MainStoryboardImageViewIdentifier?:
Expand All @@ -89,6 +94,10 @@ class DetailViewController: UIViewController {
performSegue(Segue.ImageView)
case .R:
performSegueWithIdentifier(R.segue.detailViewController.imageView, sender: self)
case .SegueManager_R:
performSegue(R.segue.detailViewController.imageView) { segue in
segue.destinationViewController.imageToShow = R.image.lolwut()
}
case .CodeGenUtils:
performSegueWithIdentifier(MainStoryboardImageViewIdentifier, sender: self)
}
Expand Down
4 changes: 4 additions & 0 deletions CodeGenExample/MasterViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ enum GeneratorType: Int {
case SwiftGen
case Natalie
case R
case SegueManager_R
case CodeGenUtils
case None
}
Expand Down Expand Up @@ -71,6 +72,9 @@ class MasterViewController: UITableViewController {
if segue == Segue.showDetail {
prepareDestinationForDetailSegue(segue.destinationViewController as! UINavigationController)
}
case .SegueManager_R:
// A segue triggered from Storyboard is not a case that is supported by SegueManager
fallthrough
case .R:
if let info = R.segue.masterViewController.showDetail(segue: segue) {
prepareDestinationForDetailSegue(info.destinationViewController)
Expand Down
3 changes: 2 additions & 1 deletion Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
platform :ios, '9.0'
use_frameworks!

pod 'R.swift'
pod 'R.swift'
pod 'SegueManager/R.swift'
16 changes: 11 additions & 5 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
PODS:
- R.swift (1.2.0):
- R.swift.Library (~> 1.0.1)
- R.swift.Library (1.0.1)
- R.swift (1.3.0):
- R.swift.Library (~> 1.1.0)
- R.swift.Library (1.1.0)
- SegueManager/iOS (2.0.0)
- SegueManager/R.swift (2.0.0):
- R.swift.Library
- SegueManager/iOS

DEPENDENCIES:
- R.swift
- SegueManager/R.swift

SPEC CHECKSUMS:
R.swift: 6cce30887fc8dc3d2185a71c56ed3f1bdbdedf8c
R.swift.Library: 801000362d9af80918d16c4de31ddf819e003e03
R.swift: 43f8a833dd8cbb4a19908cbfd37fb982e9147899
R.swift.Library: 775f3086e07313ed1a1dfddca8418317f5a87397
SegueManager: 89523f26f6eff07f4dd1b36b4824303f8d91d2f7

COCOAPODS: 0.39.0