Deal with final folder name issues due to Apple's case insensitive case preserving behavior.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jeroen Leenarts
2018-05-27 14:20:15 +02:00
parent e14faf6fea
commit ef67aa7dc4
35 changed files with 0 additions and 0 deletions
@@ -0,0 +1,27 @@
//
// Identifyable.swift
// WireGuard
//
// Created by Jeroen Leenarts on 23-05-18.
// Copyright © 2018 WireGuard. All rights reserved.
//
import Foundation
import UIKit
public protocol Identifyable: class {
static var identifier: String { get }
}
public extension Identifyable {
static var identifier: String {
return String(describing: Self.self)
}
}
extension UIStoryboard {
public func instantiateViewController<T: Identifyable>(type: T.Type) -> T where T: UIViewController {
return self.instantiateViewController(withIdentifier: type.identifier) as! T // swiftlint:disable:this force_cast
}
}