Skip to content
This repository has been archived by the owner on Sep 6, 2018. It is now read-only.

ignore module for import, if it matches the current module #19

Merged
merged 3 commits into from
Feb 16, 2017
Merged
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
184 changes: 184 additions & 0 deletions Tests/Expected/Storyboards-iOS/default-context-all-ignore-module.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
// Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen

import Foundation
import UIKit
import LocationPicker
import SlackTextViewController

// swiftlint:disable file_length
// swiftlint:disable line_length
// swiftlint:disable type_body_length

protocol StoryboardSceneType {
static var storyboardName: String { get }
}

extension StoryboardSceneType {
static func storyboard() -> UIStoryboard {
return UIStoryboard(name: self.storyboardName, bundle: NSBundle(forClass: BundleToken.self))
}

static func initialViewController() -> UIViewController {
guard let vc = storyboard().instantiateInitialViewController() else {
fatalError("Failed to instantiate initialViewController for \(self.storyboardName)")
}
return vc
}
}

extension StoryboardSceneType where Self: RawRepresentable, Self.RawValue == String {
func viewController() -> UIViewController {
return Self.storyboard().instantiateViewControllerWithIdentifier(self.rawValue)
}
static func viewController(identifier: Self) -> UIViewController {
return identifier.viewController()
}
}

protocol StoryboardSegueType: RawRepresentable { }

extension UIViewController {
func performSegue<S: StoryboardSegueType where S.RawValue == String>(segue: S, sender: AnyObject? = nil) {
performSegueWithIdentifier(segue.rawValue, sender: sender)
}
}

enum StoryboardScene {
enum AdditionalImport: String, StoryboardSceneType {
static let storyboardName = "AdditionalImport"

static func initialViewController() -> LocationPicker.LocationPickerViewController {
guard let vc = storyboard().instantiateInitialViewController() as? LocationPicker.LocationPickerViewController else {
fatalError("Failed to instantiate initialViewController for \(self.storyboardName)")
}
return vc
}

case PublicScene = "public"
static func instantiatePublic() -> SlackTextViewController.SLKTextViewController {
guard let vc = StoryboardScene.AdditionalImport.PublicScene.viewController() as? SlackTextViewController.SLKTextViewController
else {
fatalError("ViewController 'public' is not of the expected class SlackTextViewController.SLKTextViewController.")
}
return vc
}
}
enum Anonymous: StoryboardSceneType {
static let storyboardName = "Anonymous"

static func initialViewController() -> UINavigationController {
guard let vc = storyboard().instantiateInitialViewController() as? UINavigationController else {
fatalError("Failed to instantiate initialViewController for \(self.storyboardName)")
}
return vc
}
}
enum Dependency: String, StoryboardSceneType {
static let storyboardName = "Dependency"

case DependentScene = "Dependent"
static func instantiateDependent() -> UIViewController {
return StoryboardScene.Dependency.DependentScene.viewController()
}
}
enum Message: String, StoryboardSceneType {
static let storyboardName = "Message"

case ComposerScene = "Composer"
static func instantiateComposer() -> UIViewController {
return StoryboardScene.Message.ComposerScene.viewController()
}

case MessagesListScene = "MessagesList"
static func instantiateMessagesList() -> UITableViewController {
guard let vc = StoryboardScene.Message.MessagesListScene.viewController() as? UITableViewController
else {
fatalError("ViewController 'MessagesList' is not of the expected class UITableViewController.")
}
return vc
}

case NavCtrlScene = "NavCtrl"
static func instantiateNavCtrl() -> UINavigationController {
guard let vc = StoryboardScene.Message.NavCtrlScene.viewController() as? UINavigationController
else {
fatalError("ViewController 'NavCtrl' is not of the expected class UINavigationController.")
}
return vc
}

case URLChooserScene = "URLChooser"
static func instantiateURLChooser() -> XXPickerViewController {
guard let vc = StoryboardScene.Message.URLChooserScene.viewController() as? XXPickerViewController
else {
fatalError("ViewController 'URLChooser' is not of the expected class XXPickerViewController.")
}
return vc
}
}
enum Placeholder: String, StoryboardSceneType {
static let storyboardName = "Placeholder"

case NavigationScene = "Navigation"
static func instantiateNavigation() -> UINavigationController {
guard let vc = StoryboardScene.Placeholder.NavigationScene.viewController() as? UINavigationController
else {
fatalError("ViewController 'Navigation' is not of the expected class UINavigationController.")
}
return vc
}
}
enum Wizard: String, StoryboardSceneType {
static let storyboardName = "Wizard"

static func initialViewController() -> CreateAccViewController {
guard let vc = storyboard().instantiateInitialViewController() as? CreateAccViewController else {
fatalError("Failed to instantiate initialViewController for \(self.storyboardName)")
}
return vc
}

case Accept_CGUScene = "Accept-CGU"
static func instantiateAcceptCGU() -> UIViewController {
return StoryboardScene.Wizard.Accept_CGUScene.viewController()
}

case CreateAccountScene = "CreateAccount"
static func instantiateCreateAccount() -> CreateAccViewController {
guard let vc = StoryboardScene.Wizard.CreateAccountScene.viewController() as? CreateAccViewController
else {
fatalError("ViewController 'CreateAccount' is not of the expected class CreateAccViewController.")
}
return vc
}

case PreferencesScene = "Preferences"
static func instantiatePreferences() -> UITableViewController {
guard let vc = StoryboardScene.Wizard.PreferencesScene.viewController() as? UITableViewController
else {
fatalError("ViewController 'Preferences' is not of the expected class UITableViewController.")
}
return vc
}

case Validate_PasswordScene = "Validate_Password"
static func instantiateValidatePassword() -> UIViewController {
return StoryboardScene.Wizard.Validate_PasswordScene.viewController()
}
}
}

enum StoryboardSegue {
enum AdditionalImport: String, StoryboardSegueType {
case Private = "private"
}
enum Message: String, StoryboardSegueType {
case CustomBack
case Embed
case NonCustom
case Show_NavCtrl = "Show-NavCtrl"
}
enum Wizard: String, StoryboardSegueType {
case ShowPassword
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
// Generated using SwiftGen, by O.Halligon — https://github.com/AliSoftware/SwiftGen

import Foundation
import UIKit
import LocationPicker
import SlackTextViewController

// swiftlint:disable file_length
// swiftlint:disable line_length
// swiftlint:disable type_body_length

protocol StoryboardSceneType {
static var storyboardName: String { get }
}

extension StoryboardSceneType {
static func storyboard() -> UIStoryboard {
return UIStoryboard(name: self.storyboardName, bundle: NSBundle(forClass: BundleToken.self))
}

static func initialViewController() -> UIViewController {
guard let vc = storyboard().instantiateInitialViewController() else {
fatalError("Failed to instantiate initialViewController for \(self.storyboardName)")
}
return vc
}
}

extension StoryboardSceneType where Self: RawRepresentable, Self.RawValue == String {
func viewController() -> UIViewController {
return Self.storyboard().instantiateViewControllerWithIdentifier(self.rawValue)
}
static func viewController(identifier: Self) -> UIViewController {
return identifier.viewController()
}
}

protocol StoryboardSegueType: RawRepresentable { }

extension UIViewController {
func performSegue<S: StoryboardSegueType where S.RawValue == String>(segue: S, sender: AnyObject? = nil) {
performSegueWithIdentifier(segue.rawValue, sender: sender)
}
}

enum StoryboardScene {
enum AdditionalImport: String, StoryboardSceneType {
static let storyboardName = "AdditionalImport"

static func initialViewController() -> LocationPicker.LocationPickerViewController {
guard let vc = storyboard().instantiateInitialViewController() as? LocationPicker.LocationPickerViewController else {
fatalError("Failed to instantiate initialViewController for \(self.storyboardName)")
}
return vc
}

case `public`
static func publicViewController() -> SlackTextViewController.SLKTextViewController {
guard let vc = StoryboardScene.AdditionalImport.`public`.viewController() as? SlackTextViewController.SLKTextViewController
else {
fatalError("ViewController 'public' is not of the expected class SlackTextViewController.SLKTextViewController.")
}
return vc
}
}
enum Anonymous: StoryboardSceneType {
static let storyboardName = "Anonymous"

static func initialViewController() -> UINavigationController {
guard let vc = storyboard().instantiateInitialViewController() as? UINavigationController else {
fatalError("Failed to instantiate initialViewController for \(self.storyboardName)")
}
return vc
}
}
enum Dependency: String, StoryboardSceneType {
static let storyboardName = "Dependency"

case dependent = "Dependent"
static func dependentViewController() -> UIViewController {
return StoryboardScene.Dependency.dependent.viewController()
}
}
enum Message: String, StoryboardSceneType {
static let storyboardName = "Message"

case composer = "Composer"
static func composerViewController() -> UIViewController {
return StoryboardScene.Message.composer.viewController()
}

case messagesList = "MessagesList"
static func messagesListViewController() -> UITableViewController {
guard let vc = StoryboardScene.Message.messagesList.viewController() as? UITableViewController
else {
fatalError("ViewController 'MessagesList' is not of the expected class UITableViewController.")
}
return vc
}

case navCtrl = "NavCtrl"
static func navCtrlViewController() -> UINavigationController {
guard let vc = StoryboardScene.Message.navCtrl.viewController() as? UINavigationController
else {
fatalError("ViewController 'NavCtrl' is not of the expected class UINavigationController.")
}
return vc
}

case urlChooser = "URLChooser"
static func urlChooserViewController() -> XXPickerViewController {
guard let vc = StoryboardScene.Message.urlChooser.viewController() as? XXPickerViewController
else {
fatalError("ViewController 'URLChooser' is not of the expected class XXPickerViewController.")
}
return vc
}
}
enum Placeholder: String, StoryboardSceneType {
static let storyboardName = "Placeholder"

case navigation = "Navigation"
static func navigationViewController() -> UINavigationController {
guard let vc = StoryboardScene.Placeholder.navigation.viewController() as? UINavigationController
else {
fatalError("ViewController 'Navigation' is not of the expected class UINavigationController.")
}
return vc
}
}
enum Wizard: String, StoryboardSceneType {
static let storyboardName = "Wizard"

static func initialViewController() -> CreateAccViewController {
guard let vc = storyboard().instantiateInitialViewController() as? CreateAccViewController else {
fatalError("Failed to instantiate initialViewController for \(self.storyboardName)")
}
return vc
}

case accept_CGU = "Accept-CGU"
static func accept_CGUViewController() -> UIViewController {
return StoryboardScene.Wizard.accept_CGU.viewController()
}

case createAccount = "CreateAccount"
static func createAccountViewController() -> CreateAccViewController {
guard let vc = StoryboardScene.Wizard.createAccount.viewController() as? CreateAccViewController
else {
fatalError("ViewController 'CreateAccount' is not of the expected class CreateAccViewController.")
}
return vc
}

case preferences = "Preferences"
static func preferencesViewController() -> UITableViewController {
guard let vc = StoryboardScene.Wizard.preferences.viewController() as? UITableViewController
else {
fatalError("ViewController 'Preferences' is not of the expected class UITableViewController.")
}
return vc
}

case validate_Password = "Validate_Password"
static func validate_PasswordViewController() -> UIViewController {
return StoryboardScene.Wizard.validate_Password.viewController()
}
}
}

enum StoryboardSegue {
enum AdditionalImport: String, StoryboardSegueType {
case Private = "private"
}
enum Message: String, StoryboardSegueType {
case CustomBack
case Embed
case NonCustom
case Show_NavCtrl = "Show-NavCtrl"
}
enum Wizard: String, StoryboardSegueType {
case ShowPassword
}
}
Loading