Custom Button like iOS Clear Button In Notification - ios

I need to add clear button in table view section header. It is exactly same like the one in notification center. So when user clicks it, 'x' will change to 'Clear'. If s/he clicks it again, app will perform action. But any click outside this button, 'Clear' will be back to 'x'.
Reference: http://share.framerjs.com/5hc7e6kwtwfm/

Related

How to update a label text every day so that the user gets another predefined text every day?

I am trying to do a simple application but I am very new to Xcode and Swift.
I am trying to do an application that has the following functions:
one text
one picture
one button
By pressing the button the text changes into another text, the picture into another picture and the button disappears. All these items must be predefined.
For now, I have one text, one picture, and one button. When I press the button, everything works. The picture changes, the text too, and the button disappears.
Now, how can I update those items every day?
And is it possible to make the button disappear until the next new updated text is shown?
What I mean is that once you pressed the button the first picture will not be shown anymore but it will stuck on the second picture until the new updated text and picture comes out?
Ok so what you can do is,
When user opens your app, you can call a service and check whether you have updated text. If you get response, you can unhide the button and on click of it you can change the data.
Whenever your data gets updated, you can send a silent push notification to your app and store that data. And the next time user opens your app, you can check the data and unhide Button if data is present.

Bring up textfield when button is tapped

I'm trying to implement a feature where if a user taps on a button, it brings up the textfield for the user to type something in. Once the user is done, I want to navigate the user to another screen with text that he just typed.
How do I implement bringing up the textfield for the user to type in when the button is tapped?
on the button action just add self.yourTextField.becomeFirstResponder
...
then controller.text = yourTextField.text
...

How to hide keyboard without closing the dialog box using Appium for IOS?

I have a dialog box that appears and while closing keyboard with hideKeyboard(); all the form is closed and i get back to the home page so that i can't continue the scenario for filling other data.
Here the screen :
Just use UIScrollView in your dialog box, and set scroll view class TPKAScrollViewController. Download class
You can fill up the fields first using driver.sendkey() then tap on keyboard next button to switch the driver to the next field untill the last field. in last field you will get done button then you can tap on that button.
The default "strategy" of hideKeyboard(); is to tap outside the keyboard, but this can be changed to pressing a key on the keyboard instead.
See the java-client documentation (assuming you're using java-client?) for available hideKeyboard strategies: http://appium.github.io/java-client/io/appium/java_client/ios/IOSDeviceActionShortcuts.html
If your app's keyboard has for example a "Next" button to close the keyboard with, then you could use: driver.hideKeyboard("Next");

JQuery Mobile Fixed Toolbar Hide

I was trying to simulate "tap to show/hide the fixed toolbar" when I found out that it's already the default function hahaha!
By default works charmly: it starts "show" and when it taps then "hide" and when taps again "shows" etc. PERFECT!
The problem is that I want it to start hidden and when the user taps shows and so on...
I used
$(".divBotoneraSimple").hide();
but then it doesn't show when tapped! I also tried:
$.mobile.fixedToolbars.hide(true);
$("[data-position='fixed']").fixedtoolbar('hide');
but both of them "stop my App" when triggered!
In order words I need to trigger those hides from javascript and still respond to tapping!
Use .toolbar() method with show, hide or toggle.
$(".ui-header, .ui-footer").toolbar("toggle");
Note that if you are at the top of the page, the header won't be hidden, only the footer, and vice versa.

How to have the iOS SearchBar Keyboard Search Button Perform an Action

I have a simple application which has a Table View (TV1) which gets populated by the user selecting a navigation bar button item to Add Entry (VC1). Within the Add Entry, when the user presses the Name field, they're taken to another Table View (TV2) which serves the purpose of allowing the user to select a previously entered name or create a new name.
TV2 is a Table View Controller with a Search Bar at the top.
Right now, existing names are available and show to the user. However, if the user "searches" for a name that does not exist, they should have the option to Create that name right now. If a search does not exist, I have a button which the user can tap which will create the user. That's simple. However, it's another tap.
Is there a way I can get the Search button of the Keyboard to perform the same functionality of the create button (i.e. Save the new user and dismiss TV1) which would then allow me to remove the Create button in the middle of the table view?
try this:
searchBar.delegate = delegateInstance;
//delegateInstance.m
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar{
//perform the same functionality of the create button
}
You can catch the event fired by tapping the search button this way :
UISearchDisplayController has a UISearchBar, you can set a delegate
for search bar and implement -searchBarSearchButtonClicked:.
From now, you should be able to call the same treatment that you do on create button. Found this answer on this post. Hope that helps !
I don't think you can find a right keyboard ReturnKeyType for "Create" or "Add" to let user know the return key of the keyboard will create a user. =)
Anyway, I guess what you want is if you click "search" button second time with no search result displayed on the tableview then you want to create a user with new search text on the search bar. Did I understand right? If so, I think I already answered your question.
In UISearchBarDelegate, – searchBarSearchButtonClicked:, Check if you don't have any search results and have any text in the search bar, then you can create a user.

Resources