Skip to content
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## 3.0.1

* Fix `instantiate()` implementation on `StoryboardSceneBased` ViewControllers.
[@jakubgert](https://github.com/jakubgert)
[#38](https://github.com/AliSoftware/Reusable/pull/38)

## 3.0.0

* Converted library and Demo project to Swift 3.
Expand Down
4 changes: 2 additions & 2 deletions Sources/Storyboard/StoryboardSceneBased.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public extension StoryboardSceneBased where Self: UIViewController {
- returns: instance of the conforming ViewController
*/
static func instantiate() -> Self {
let storyboard = Self().storyboard
guard let vc = storyboard?.instantiateViewController(withIdentifier: self.sceneIdentifier) as? Self else {
let storyboard = (Self.self as StoryboardSceneBased.Type).storyboard
guard let vc = storyboard.instantiateViewController(withIdentifier: self.sceneIdentifier) as? Self else {
fatalError("The viewController '\(self.sceneIdentifier)' of '\(storyboard)' is not of class '\(self)'")
}
return vc
Expand Down