Commit c406fcc8 authored by giovannicariglia's avatar giovannicariglia

added navi controller

parent ccf97bb1
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
9AB7E3ED259D06C8008F9DD8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9AB7E3EB259D06C8008F9DD8 /* Main.storyboard */; }; 9AB7E3ED259D06C8008F9DD8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9AB7E3EB259D06C8008F9DD8 /* Main.storyboard */; };
9AB7E3EF259D06CB008F9DD8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9AB7E3EE259D06CB008F9DD8 /* Assets.xcassets */; }; 9AB7E3EF259D06CB008F9DD8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9AB7E3EE259D06CB008F9DD8 /* Assets.xcassets */; };
9AB7E3F2259D06CB008F9DD8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9AB7E3F0259D06CB008F9DD8 /* LaunchScreen.storyboard */; }; 9AB7E3F2259D06CB008F9DD8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9AB7E3F0259D06CB008F9DD8 /* LaunchScreen.storyboard */; };
9AEA96C725A2168D00EC932D /* EditorController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AEA96C625A2168D00EC932D /* EditorController.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
...@@ -28,6 +29,7 @@ ...@@ -28,6 +29,7 @@
9AB7E3EE259D06CB008F9DD8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; 9AB7E3EE259D06CB008F9DD8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
9AB7E3F1259D06CB008F9DD8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; 9AB7E3F1259D06CB008F9DD8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
9AB7E3F3259D06CB008F9DD8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 9AB7E3F3259D06CB008F9DD8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9AEA96C625A2168D00EC932D /* EditorController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EditorController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -69,6 +71,7 @@ ...@@ -69,6 +71,7 @@
9AB7E3F3259D06CB008F9DD8 /* Info.plist */, 9AB7E3F3259D06CB008F9DD8 /* Info.plist */,
9A93295025A0FBC90025FC97 /* DashboardController.swift */, 9A93295025A0FBC90025FC97 /* DashboardController.swift */,
9A93295325A0FBFF0025FC97 /* DetailsController.swift */, 9A93295325A0FBFF0025FC97 /* DetailsController.swift */,
9AEA96C625A2168D00EC932D /* EditorController.swift */,
); );
path = "Test Login"; path = "Test Login";
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -147,6 +150,7 @@ ...@@ -147,6 +150,7 @@
9AB7E3EA259D06C8008F9DD8 /* ViewController.swift in Sources */, 9AB7E3EA259D06C8008F9DD8 /* ViewController.swift in Sources */,
9A93295425A0FBFF0025FC97 /* DetailsController.swift in Sources */, 9A93295425A0FBFF0025FC97 /* DetailsController.swift in Sources */,
9AB7E3E6259D06C8008F9DD8 /* AppDelegate.swift in Sources */, 9AB7E3E6259D06C8008F9DD8 /* AppDelegate.swift in Sources */,
9AEA96C725A2168D00EC932D /* EditorController.swift in Sources */,
9AB7E3E8259D06C8008F9DD8 /* SceneDelegate.swift in Sources */, 9AB7E3E8259D06C8008F9DD8 /* SceneDelegate.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
......
This diff is collapsed.
...@@ -9,6 +9,9 @@ import UIKit ...@@ -9,6 +9,9 @@ import UIKit
class DashboardController: UIViewController { class DashboardController: UIViewController {
@IBOutlet weak var tfDemo: UITextField!
@IBOutlet weak var labelAnswer: UILabel!
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
...@@ -18,17 +21,16 @@ class DashboardController: UIViewController { ...@@ -18,17 +21,16 @@ class DashboardController: UIViewController {
@IBAction func unwindToDashboard(_ unwindSegue: UIStoryboardSegue) { @IBAction func unwindToDashboard(_ unwindSegue: UIStoryboardSegue) {
//let sourceViewController = unwindSegue.source //let sourceViewController = unwindSegue.source
// Use data from the view controller which initiated the unwind segue // Use data from the view controller which initiated the unwind segue
if let src = unwindSegue.source as? EditorController {
labelAnswer.text = src.tfDemo.text
}
} }
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) { override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination. if let dest = segue.destination as? EditorController {
// Pass the selected object to the new view controller. dest.msg = tfDemo.text!
tfDemo.text = ""
}
} }
*/
} }
//
// DetailsController.swift
// Test Login
//
// Created by Giovanni Cariglia on 02.01.21.
//
import UIKit
class EditorController: UIViewController, UITextFieldDelegate {
@IBOutlet weak var tfDemo: UITextField!
@IBOutlet weak var labelQuestion: UILabel!
var msg = ""
override func viewDidLoad() {
super.viewDidLoad()
labelQuestion.text = msg
tfDemo.delegate = self
// Do any additional setup after loading the view.
}
@IBAction func unwindToEditor(_ unwindSegue: UIStoryboardSegue) {
//let sourceViewController = unwindSegue.source
// Use data from the view controller which initiated the unwind segue
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
view.endEditing(true)
performSegue(withIdentifier: "segueUnwindEditorToDashboard", sender: self)
return false
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment