Replaying page on iOS app - ios

I am making an iOS app through xcode for audits where each room in a building uses the same page format but has different information. How can I replay the same page over through an add bar button so that when the add button is pressed the same page comes up but with all the text fields empty.

I assume when you are done putting in the information, you must be saving the information in the local DB or any server may be.
What you can do is, once you are done with putting in all the information display an alert stating that the information is saved and upon the clicking on any button on the alert, clear all the fields.

Related

Website wrapped in iOS App - Catching hyperlink click events

I have a iOS app that wraps a website. When the user clicks a link in the wrapped website, I want to trap the event in my app and be able to get information about the link that was clicked. Is this something that can be done in Swift?
I'm relatively new to iOS app development and I'm working on an app that has been around for a while.
The short answer is "Yes". There are a couple of views that you can use in iOS to display web content. One such view is WKWebView.
If you look at the documentation at that link, close to the bottom of the page you will find a header for "Managing Navigation Through your Web Content".
What you do is create a WKNavigationDelegate that you attach to your WKWebView. That delegate is notified when the user wants to navigate through the web content (for example, when they click on a link) and lets your application code participate in the navigation process. It can allow navigation, deny navigation, find out when it starts and stop, things of that nature.

iOS how to launch another app as a redirection

An app is currently outdated and to avoid the users to use its incorrect results, we decided to suspend this app until we have the algorithm updated.
We have tried the following:
Titanium.Platform.openURL("http://example.net");
This will open the web browser to a URL of our selection. However, in iOS there is a little "go back" link in the top left hand corner, which will lead the user back to the broken app. We want to avoid this. Basically, we want the app to be inactive all the time - whenever the user attempt to activate it, the designated page behind the URL should be shown.
How can we do this?
Why not just temporarily replace the main page of you app with a full screen web view showing the desired URL? The user stays in your app but still can only access the web page you direct them to.

How to send ENTER key in protractor tests on iOS?

I'm using ProtractorJS (and Appium) to test a website on browsers and devices. One of the tests is to type some text in the search box and then hit ENTER. Here is the snippet from the page object.
page.searchInput.sendKeys("Text");
page.searchInput.sendKeys(protractor.Key.ENTER);
The above two lines work fine on any browser and Android devices. However, the same test fails on iOS because the ENTER key is not sent. In the iOS keyboard the key I have to press is the "Search" one.
The test must trigger the search using the keyboard.
Any ideas on how to send the ENTER key on iOS?
If there is no button on the page, Safari will be stubborn about it and not submit the form. In general, I use the button tag instead of the input tag and have better results, but either way unless there is a submit button on the page, and that button is visible (see this question for reference: How to submit a form when the return key is pressed?), Safari will stubbornly refuse to submit the page. In this case, I would put a submit button on the page even though most users will never use it on mobile. You may have fits getting it past your design department. The other option is to use a blur event and trigger it that way.
You can send just new line symbol \n or create tap by coordinate proportions at the right lower corner of the app.

How can I store a list and clear it from the settings page on iOS?

I need to be able to store a list of data (either strings or objects) that is remembered by my app after it's closed. The user also needs to be able to go into the settings page for the app and clear this data by pressing a button.
Everything I read about the settings in iOS suggests that the only things that can appear there are controls that expose a specific setting. Is it possible to add a button that clears a setting list or is this unsupported?
Edit: I've just realised this must be possible because Safari does it - see the "Clear History" button:
No, you cannot do this. You don't get to run code from the iOS Settings app. Safari is special because Apple.
Your choices are two:
Have a toggle that the user can set to ON which is "Clear list on next launch". Then when your app launches, you check to see if the user toggled that to ON, clear the list and reset it to OFF.
You have an in-app settings page where the user can click a button to clear the list immediately.

ios location related bug

I am seeing a weird bug that I am looking for help with.
I have an iPad iOS 7 app that allows people to fill out forms. Their entries are stored in a Sqlite database. When they reopen a form they have worked on entries they have made are redisplayed.
When the iPad goes to a new city all the entries seem to disappear. When the app is reactivated in the new location the current page appears fine, but scrolling left or right shows nothing but blank fields. The current page is also blank if you scroll away from it and back to it.
If you print or email the form while its data is not visible, the output contains all the missing data. The data also comes back if you double-press the home button, truly exit the app, and then restart it. But simply re-opening the form does not bring the data back.
When I took my Mac and iPad to a new city, the disappearing data effect happened but went away shortly after I started testing it. I don’t know whether it always goes away eventually. I didn’t test for it immediately when I got back home, and when I did start testing the bug was not happening.
Each field is backed by an object that includes a strong string property for the field’s value. The only thing I know for sure is that in forms with invisible data that string property is nil for fields that should have data. All the other field properties retain their correct values.
So far, a change in physical location is the only thing I have found that triggers this bug. My app uses location when the user gives permission, but runs fine without it. Changing the location in the simulator does not trigger the bug. I need a way to reproduce this bug but dread having to travel all over the state (or country!) just see it.
Thanks in advance for any thoughts or suggestions.

Resources