Skip to content

Commit

Permalink
feat: Improve Destinations initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
maximkrouk committed Dec 31, 2023
1 parent 67a26a1 commit c08cc89
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import SwiftUI
import CocoaAliases

public protocol DestinationInitializableControllerProtocol: CocoaViewController {
init()
static func _init_for_destination() -> CocoaViewController
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ open class StackDestination<
) -> Controller {
if
let controllerType = (Controller.self as? DestinationInitializableControllerProtocol.Type),
let controller = controllerType.init() as? Controller
let controller = controllerType._init_for_destination() as? Controller
{
return controller
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ open class TreeDestination<Controller: CocoaViewController>:
open class func initController() -> Controller {
if
let controllerType = (Controller.self as? DestinationInitializableControllerProtocol.Type),
let controller = controllerType.init() as? Controller
let controller = controllerType._init_for_destination() as? Controller
{
return controller
} else {
Expand Down

0 comments on commit c08cc89

Please sign in to comment.