Add bare bones ProfileConfigurationTableViewController.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
@@ -85,8 +85,8 @@ class AppCoordinator: RootViewCoordinator {
|
||||
|
||||
extension AppCoordinator: ConnectionsTableViewControllerDelegate {
|
||||
func addProvider(connectionsTableViewController: ConnectionsTableViewController) {
|
||||
// TODO implement
|
||||
print("Add provider")
|
||||
let addContext = persistentContainer.newBackgroundContext()
|
||||
showProfileConfigurationViewController(profile: nil, context: addContext)
|
||||
}
|
||||
|
||||
func connect(profile: Profile, connectionsTableViewController: ConnectionsTableViewController) {
|
||||
@@ -97,6 +97,23 @@ extension AppCoordinator: ConnectionsTableViewControllerDelegate {
|
||||
func configure(profile: Profile, connectionsTableViewController: ConnectionsTableViewController) {
|
||||
// TODO implement
|
||||
print("configure profile \(profile)")
|
||||
let editContext = persistentContainer.newBackgroundContext()
|
||||
var backgroundProfile: Profile?
|
||||
editContext.performAndWait {
|
||||
|
||||
backgroundProfile = editContext.object(with: profile.objectID) as? Profile
|
||||
}
|
||||
|
||||
showProfileConfigurationViewController(profile: backgroundProfile, context: editContext)
|
||||
}
|
||||
|
||||
func showProfileConfigurationViewController(profile: Profile?, context: NSManagedObjectContext) {
|
||||
let profileConfigurationViewController = storyboard.instantiateViewController(type: ProfileConfigurationTableViewController.self)
|
||||
|
||||
profileConfigurationViewController.viewContext = context
|
||||
profileConfigurationViewController.delegate = self
|
||||
|
||||
self.navigationController.pushViewController(profileConfigurationViewController, animated: true)
|
||||
}
|
||||
|
||||
func delete(profile: Profile, connectionsTableViewController: ConnectionsTableViewController) {
|
||||
@@ -104,3 +121,7 @@ extension AppCoordinator: ConnectionsTableViewControllerDelegate {
|
||||
print("delete profile \(profile)")
|
||||
}
|
||||
}
|
||||
|
||||
extension AppCoordinator: ProfileConfigurationTableViewControllerDelegate {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user