Skip to content

Commit

Permalink
Remove old title property
Browse files Browse the repository at this point in the history
  • Loading branch information
dcvz committed Nov 11, 2020
1 parent 1432391 commit aebb165
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Example/Example/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct ContentView: View {
.toolbar {
ToolbarItemGroup(placement: .navigationBarTrailing) {
Button(action: {
navigation.pushView(AnyView(SettingsView()), title: "Settings", animated: true)
navigation.pushView(AnyView(SettingsView()), animated: true)
}) { Image(systemName: "gear") }
}
}
Expand Down
6 changes: 3 additions & 3 deletions Sources/XNavigation/Navigation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ open class Navigation: ObservableObject {
window.rootViewController?.present(viewController, animated: animated)
}

public func pushView(_ view: AnyView, title: String, animated: Bool = true) {
public func pushView(_ view: AnyView, animated: Bool = true) {
let controller = DestinationHostingController(rootView: view.environmentObject(self))
pushViewController(controller, title: title, animated: animated)
pushViewController(controller, animated: animated)
}

public func pushViewController(_ viewController: UIViewController, title: String, animated: Bool = true) {
public func pushViewController(_ viewController: UIViewController, animated: Bool = true) {
let nvc = window.rootViewController?.children.first?.children.first as? UINavigationController
nvc?.pushViewController(viewController, animated: animated)
}
Expand Down

0 comments on commit aebb165

Please sign in to comment.