Add ability to customize bundle for storyboard initialization
This commit is contained in:
parent
1111dc6855
commit
a450d23453
|
|
@ -19,6 +19,7 @@
|
|||
787682FA1CAD40C300532AB3 /* StaticEstimatedViewHeightProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 787682F91CAD40C200532AB3 /* StaticEstimatedViewHeightProtocol.swift */; };
|
||||
787783631CA03CA0001CDC9B /* IndexPath+ImmutableIndexPath.swift in Sources */ = {isa = PBXBuildFile; fileRef = 787783621CA03CA0001CDC9B /* IndexPath+ImmutableIndexPath.swift */; };
|
||||
787783671CA04D4A001CDC9B /* String+SizeCalculation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 787783661CA04D4A001CDC9B /* String+SizeCalculation.swift */; };
|
||||
788E86F71DBA556C009BF65A /* StoryboardProtocol+DefaultBundle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 788E86F61DBA556C009BF65A /* StoryboardProtocol+DefaultBundle.swift */; };
|
||||
788EC15A1CF64528009CFB6B /* UIStoryboard+InstantiateViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 788EC1591CF64528009CFB6B /* UIStoryboard+InstantiateViewController.swift */; };
|
||||
78A74EA91C6B373700FE9724 /* UIView+DefaultNibName.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78A74EA81C6B373700FE9724 /* UIView+DefaultNibName.swift */; };
|
||||
78B036411DA4D7060021D5CC /* UIImage+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 78B036401DA4D7060021D5CC /* UIImage+Extensions.swift */; };
|
||||
|
|
@ -79,6 +80,7 @@
|
|||
787682F91CAD40C200532AB3 /* StaticEstimatedViewHeightProtocol.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StaticEstimatedViewHeightProtocol.swift; sourceTree = "<group>"; };
|
||||
787783621CA03CA0001CDC9B /* IndexPath+ImmutableIndexPath.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "IndexPath+ImmutableIndexPath.swift"; sourceTree = "<group>"; };
|
||||
787783661CA04D4A001CDC9B /* String+SizeCalculation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+SizeCalculation.swift"; sourceTree = "<group>"; };
|
||||
788E86F61DBA556C009BF65A /* StoryboardProtocol+DefaultBundle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "StoryboardProtocol+DefaultBundle.swift"; sourceTree = "<group>"; };
|
||||
788EC1591CF64528009CFB6B /* UIStoryboard+InstantiateViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIStoryboard+InstantiateViewController.swift"; sourceTree = "<group>"; };
|
||||
78A74EA81C6B373700FE9724 /* UIView+DefaultNibName.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "UIView+DefaultNibName.swift"; path = "LeadKit/Extensions/UIView/UIView+DefaultNibName.swift"; sourceTree = SOURCE_ROOT; };
|
||||
78B036401DA4D7060021D5CC /* UIImage+Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "UIImage+Extensions.swift"; sourceTree = "<group>"; };
|
||||
|
|
@ -205,6 +207,7 @@
|
|||
isa = PBXGroup;
|
||||
children = (
|
||||
7834236F1DB8D15800A79643 /* StoryboardProtocol+Extensions.swift */,
|
||||
788E86F61DBA556C009BF65A /* StoryboardProtocol+DefaultBundle.swift */,
|
||||
);
|
||||
name = StoryboardProtocol;
|
||||
path = LeadKit/StoryboardProtocol;
|
||||
|
|
@ -594,6 +597,7 @@
|
|||
78C36F7E1D801E3E00E7EBEA /* Double+Rounding.swift in Sources */,
|
||||
78CFEE551C5C45E500F50370 /* NibNameProtocol.swift in Sources */,
|
||||
78CFEE561C5C45E500F50370 /* ReuseIdentifierProtocol.swift in Sources */,
|
||||
788E86F71DBA556C009BF65A /* StoryboardProtocol+DefaultBundle.swift in Sources */,
|
||||
78B036411DA4D7060021D5CC /* UIImage+Extensions.swift in Sources */,
|
||||
786D78E81D53C378006B2CEA /* AlamofireRequest+Extensions.swift in Sources */,
|
||||
78C36F811D8021DD00E7EBEA /* UIColor+Hex.swift in Sources */,
|
||||
|
|
|
|||
|
|
@ -21,6 +21,11 @@ public protocol StoryboardProtocol {
|
|||
*/
|
||||
static var storyboardIdentifier: StoryboardIdentifier { get }
|
||||
|
||||
/**
|
||||
- returns: bundle for storyboard initialization
|
||||
*/
|
||||
static var bundle: Bundle? { get }
|
||||
|
||||
/**
|
||||
method which instantiate UIViewControlle instance for specific view controller identifier
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
//
|
||||
// StoryboardProtocol+DefaultBundle.swift
|
||||
// LeadKit
|
||||
//
|
||||
// Created by Ivan Smolin on 21/10/16.
|
||||
// Copyright © 2016 Touch Instinct. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
public extension StoryboardProtocol {
|
||||
|
||||
/**
|
||||
- returns: default bundle for storyboard initialization
|
||||
*/
|
||||
public static var bundle: Bundle? {
|
||||
return Bundle.main
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -16,7 +16,7 @@ ViewControllerIdentifier: RawRepresentable, ViewControllerIdentifier.RawValue ==
|
|||
- returns: UIStoryboradInstance with StoryboardIdentifier name
|
||||
*/
|
||||
public static var uiStoryboard: UIStoryboard {
|
||||
return UIStoryboard(name: storyboardIdentifier.rawValue, bundle: Bundle.main)
|
||||
return UIStoryboard(name: storyboardIdentifier.rawValue, bundle: bundle)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue