Apr 25, 2019
The .
The key difference to to-do lists that the Swift app provides is that it automatically saves the to-do items, even when there is no internet connection. You can sync your list on multiple devices using iCloud.
So, how do you do this in your Swift 4 code? The key here is to get the name of the List key in the plist file of your storyboard.
In Xcode 8, click on the storyboard you want to work on.
For example, if you want to use the List Table View, double-click on it to open the file.
Now, click on the attributes inspector (second from the left).
Then click on the Identity Inspector (second from the right).
On the Identity inspector, you will see the value of the List key.
The values are different for each platform. In order to get the key of List on iOS, it should look like this:
The values for Android and macOS are pretty similar. You should use this value in your AppDelegate or Main.storyboard file.
This is just a quick fix and there are other ways to do this. You can follow my tutorial that explains how to connect multiple ViewControllers in a storyboard.
In short: What you should have is a segue from one ViewController to another, and in the segue, you have to set the identifier of the destinationViewController. (It will be different on iOS and macOS). Then you can get the destinationViewController from the segue. Now, if you have set the identifier to your first ViewController, you can access it by calling this.destinationViewController in the function prepareForSegue:sender:
let currentVC = self.destinationViewController!
currentVC.someProperty = "Hello"
Now, you are ready to push the second ViewController in a navigation controller.
If you have more questions, please let me know.
FILED ac619d1d87
Related links:
Comentários