iOS Choose the adapted view - ios

I'm implementing a check module message in my app and I want some advice to choose the adapted view.
When I click on a button, it redirect to a view with all messages. I'll click on a message ( choose it ) and it'll redirect me to a view with more info about this message. I can then go back to the list messages.
Have you any idea about what view I can choose after clicked on the button ?

Related

Can I programmatically open a turbo_frame?

I have a list of documents(index.html.erb) where I can click a document to load details (show.html.erb) in a turbo_frame modal. This works well. There is a preview button that goes to a non turbo view for previewing an attachment. From here I want to click a back button to go back to the index.html.erb page but I'd also like to trigger the show.html.erb modal so they are technically back where they started. I was attempting to just force a redirect in the controller to the documents#show but this changes the route to /show and closing the modal gives you a blank page. Is it possible to open a turbo_frame without a click?

How to have a back button in a VC in a navigation controller stack but segued from elsewhere?

Here is the user flow I want for my chat app:
(Basically exact same as WhatsApp, and very close to iMessage)
I have a tableVC for all existing chats inside a NavigationC. When the user clicks on the search button:
I want to have searchVC come up from bottom (it is set to present modally). If user cancels, I call dismiss(animated), which works well.
But if the user clicks on a new user to chat, I segue to chat screen using show detail, but I don't get my navigation controllers back button. How would I get it? (back to conversations not searchVC)
I don't want to embed everything in the navigationC because it doesn't really belong there. Also I looked at this answer but that does not work since I have a chatVC I want to go to. Again exact same as WhatsApp.
In images below, you can see if I click on my conversationsVC, the back button shows, but when I click on the seachVC, it disappears.
The navigationController only records viewControllers that is using show/push to perform and so it can provide back button. Otherwise, you have to embed another navigationController. Example

Data is unloaded from View Controller when segue happens

I have two screens that I am performing a push segue between. In the first screen, there are 5 buttons that you click on to send you to the next page. On the next page, you edit some information that is specific to each button, then you click a button and get sent back to the first screen. (Kind of like editing contacts) When I edit one button it works perfectly. However, when I click on the next button and edit its information, when I come back the original screen has lost the information about the first button. Just to be clear, I am not actually editing the button. There is information that is being displayed on the button, but I am storing data in some properties on the view controller.
I think the problem is that the data stored in the properties is being cleared when I perform the segue. How can I make it so that the data persists?
Thanks to #rdelmar, I am now using a modal segue from the first view. I then use dismissViewControllerAnimated to go back. (Found in this question.)

Using Xamarin Forms, how do I override the back button functionality?

Using Xamarin Forms, I have a MasterDetailPage whose Master is a list of menu options and Detail is a NavigationPage that contains a ContentPage. If I push a second page onto the Detail's NavigationPage, the icon that used to open the menu becomes a back button. I want to override this behavior so that icon always opens the menu. I have a subheader with a custom back button which is why I need the Detail to be a NavigationPage.
It's not possible out of the box. maybe using a custom render for the Navigation page.
This is possible now
NavigationPage.SetHasBackButton(page, false);
where page is the page you are about to push.
I found there are a lot of ways to make a new screen pop up with the Master Detail Page. The one that stopped the back button from showing up for me was:
((MasterDetailPage)Application.Current.MainPage).Detail = new NavigationPage(page);
where "page" is whatever screen you want to set it to. For example:
((MasterDetailPage)Application.Current.MainPage).Detail = new NavigationPage(new ResultsPage());

iPad: Cannot display Second Modal View Controller after dismiss the first one

Hi I am new to iOS development, and my app i am working on is allow users to log in to the server by using web services, and after the user logged in, he will get a list of the books he's allowed to access and then he select one and do what he needs to do after that.
So here is my problem. There is a "Sign In" button on the main view. After he click the button "Sign In", a modal view poped up asking him to fill in his username/password. I set up the main view controller to be the delegate so that the modal view controller can pass the credentials to the main view controller. After the log in information passed, the main view controller will dismiss the sign in view controller and connect to a server to verify user account. As the response, the server send back a list of book objects. Here I want to use a modal view to populate a UITableView with the book list to let user select from. So in the - (void)parserDidEndDocument:(NSXMLParser *)parser method in main view controller, I put the code to generate and show the second modal view with the book list, and it doesn't show no matter what I do. I know I did get the book list and I know the code to populate the second modal view got executed, but the second modal view just not show.
I read some related questions here and no matter how I dismiss the first modal view, the second one was not shown at all.
Actually I found a solution to it even though it is not a pretty solution at all. All I have to do is just set the dismissModalViewControllerAnimated to NO for the first modal view I dismissed and then I can have my second modal view shown up. I saw somebody used timer but that didn't work for me at all.

Resources