/
NSStoryboardExtensions.swift
33 lines (28 loc) · 1.02 KB
/
NSStoryboardExtensions.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// NSStoryboardExtensions.swift
// Pods Updater
//
// Created by Kizito Nwose on 01/02/2018.
// Copyright © 2018 Kizito Nwose. All rights reserved.
//
import Cocoa
extension NSStoryboard {
func instantiateCommandViewController(with command: Command, successHandler: (() -> Void)? = nil) -> CommandViewController {
let vc = instantiateController(withIdentifier: .commandViewController) as! CommandViewController
vc.command = command
vc.successHandler = successHandler
return vc
}
func instantiatePodfileViewController(with result: PodFileCleanResult) -> PodfileViewController {
let vc = instantiateController(withIdentifier: .podfileViewController) as! PodfileViewController
vc.result = result
return vc
}
}
extension NSStoryboard.SceneIdentifier {
public static let podfileViewController = "PodfileViewController"
public static let commandViewController = "CommandViewController"
}
extension NSStoryboard.Name {
public static let main = "Main"
}