swift 3 ViewController to TableViewController - uitableview

I'm building a todo list app. So far I have a tableViewController in which i have the list of todo created and when I click on it a viewcontroller opens with the content inside. I have a navigationController linked to the tableviewcontroller, and tableviewcontroller linked to viewcontroller.
What I want to do now is create a new viewcontroller with an input inside, you insert your name and after clicking on a button it opens the tableviewcontroller with the list inside.
Is is the same way as linking tableviewcontroller to viewcontroller or is there a difference ?
[EDIT]
Here's what I've got so far :

Say you want a new view controller to pop up when clicking on create button. drop another view controller on your storyboard. Connect your button to that view controller using segue and set type as Present Modally. Now when you click on the button, the new view controller will show up.
Now add a button on the new view controller, connect to code using an IBAction. In the action, call self.dismiss(animated: true, completion: nil) Now when you click on this button, your new view controller will be dismissed.
Finally, add your create new use stuff on your new view controller, and pass data back to your table view using unwind segue, which you can search on Google.
Your story board will look something like this

you remove navigation bar in all controller than accepted action clicked event for viewing controller present.
your login view controller to table view for applay push view controller code and back for pop view controller code apply.
3.you search in google table view to detail view you will get exact idea how to pass data tableview data to view controller in show data ...

Related

How to push a view controller programmatically from Detail view controller

My app has a split view controller as root with master detail view. I'm doing this programmatically without using storyboards. I want to push a new view controller from a button in detail view and close the split view. When I tried, it opened inside the detail view. self.navigationController?.pushViewController(mainView, animated: true)
But I want it to open full screen and have a back button to goto the split view. How can I do that?
I think you need either present it Modally or change the rootViewController in corresponding to your action.

using my ViewController as a TabBarController

So i currently have a ViewController that has a tableView in it with a tab bar on the bottom. Its basically an instagram clone. However, i built all the tableView functionality and am now just getting around to playing with the tab bar items to segue to new view controllers.
I cant figure out how to attach my already created tab bar(which is inside a regular view controller) to other view controllers in IB.
The ctrl+drag from the newly created view controllers to my MAIN view controller doesn't work. It doesn't provide an option to create a view controller segue.
Below is an image of my current view controller and a brand new one to the right
Any help on how i can do this would be greatly appreciated
On you tabbbar controller ctrl+click and drag to the view controller you want to create a relationship to.
Then when the little menu appears, under 'relationship segue' click 'view controllers'
You should then end up with something like this. Continue the same process to add more relationships.

How to add action to automatic back button in TableViewController in Swift

I have a ViewController which is embedded and second TableViewController. The segue identifier between this two controllers is "abc". And now when I click the button in ViewController I go to UITableViewController. Back button in TableViewController shows me automatically. And now:
How can I add action to this Back button? I need is because I need to send some data from TableViewController to ViewController
Make sure you have embedded the navigation controller and make sure it is the initial view controller .
open your table view controller in the storyboard and where the back option is present drag a button at that place . Connect the button into the file of the tableView controller as an 'action' and write your code.

Keeping a loaded View part of the tabController when the tableView cell is clicked?

I have a tabbed application with a TableView in the FirstView. I want to be able click on a cell in the TableView and load a new view.
Right now, when the cell is clicked I go to the view I want but it isn't part of the tab bar controller (as in I I don't see the two tabs on the bottom) and I also can't get back to the FirstView where the TableView is located.
I have seen tutorials on this but they are all starting from scratch. I already have a lot of content on my FirstView so I don't want to start over.
I think I have to put in a Navigation Controller but I don't know how to do that without starting over and I also don't know where I would put it.
Here is the StoryBoard for my app:
http://i.imgur.com/2YJMMD5.png
I am not sure if I understood what you are trying to do but try to control click from your cell in the Home Table View Controller to your Friend View Controller, this will create a segue from the cell to the view controller so the view controller will be called once the cell is clicked.
Please let me know if this is what you are going for!
All you need to do is select your table view controller, go to the Editor menu, and choose "Embed in Navigation Controller". This will insert a navigation controller between the tab bar controller and your table view controller. Now when you select a cell, you should use a "show" segue to go (via a push) to your new view controller.

displaying UIPickerView over current ViewController xcode

Here is my current problem. I have a UIViewController setup with its data and everything on a small sized view controller. What I am trying to see is if it is possible to connect that to a separate view controller. For example I have a view controller that has a user click a button. Upon pressing the button the UIPicker ViewController would pop up from the bottom and I could go from there. I know how to enable this if the picker is on the same view controller. However, I have no idea how to if its on its own ViewController. Any ideas?
One way to do this would be to put the picker view on the same view controller and make it hidden, and, when they press the button, unhide it or load the other view controller when they press the button; this will display the other view controller, not what's on the current one.

Resources