Adding multiple buttons in UITextfield iOS swift - ios

I doing one project in swift.In that i want to add multiple buttons in UItextfield.While typing in textfield,a dropdown will come with results.while selecting that result,It should be added like a button in textfield.For example I want it in a "Mail To: format".Please help me to do this.Give some idea

Related

How to navigate from one dropdown menu to next dropdown menu in iOS?

In whatsapp, when we go to any particular user then at right corner there is more option (three dots menu). Then after clicking that menu, one list will come and again at last row there is navigate arrow, then after clicking on that row again new menu will come.
here is the images,
after clicking on more option, following view will appear
I want to implement this feature in my iOS Project. Anyone have any idea how to implement it ?
You can manage it with multiple ways!
First Way : Take two table view for the menu. Initially keep one tableview hidden. Then on more's click of first tableview, show second tableview and hide firt one.
Second Way : Take only one tableview and reload different data. I mean on click of main change your datasource for tableview and reload it.
DropDown menu's are considered bad practice in iOS. Use one UIAlertController to show first options, than on selecting the More show another UIAlertController.

How to create stacked pagination in iOS?

How to achieve the UI as shown in the image below?
I wanted to create a form with steps, by clicking next button it will swipe and open next form and will update the number of stacked pages as shown.
For making this type of UI you need to use Background image and UIPageControl. And you have to make other UI elements like text fields and button with code. You should be careful about frames.
Finally I got the answer, and created the same UI using Koloda library in objective-c
https://github.com/wang9262/Koloda-ObjC

Xcode buttons/images always on top?

Is there an option for a button/image to set, that it will always be shown on top? So I have 2 buttons and want to add an image. But the image covers the two buttons and I have no idea how I could get the image in the background or the buttons in the front.
BTW: I´m fairly new to xcode and programming...
Use the xCode top menu item Editor->Arrange. There you have options to handle z index for controls.
What I did was, to have two button one for the label and one for the image and when one is clicked it propagates the message to the other and does the action depending on which one was clicked.

iOS get UINavigationBar's back button in order to set accessibility properties

I have a navigation controller stack where one of the views has a dynamic title.
The view controllers and their titles go like this:
Main --> ItemsTableView --> ItemDetails
Title:Main Title: NN Items Title: Details
Because the iOS UINavigationController sets the text of the "Back" button to be the title of the previous screen, the "Back" button on the details screen says "< NN Items" where NN is a dynamically changing number.
I'm trying to do some iOS UI automation, but the accessibility Label / ID of the back button is set by the system to it's button text. This means that the accessibility label of the back button on the details screen will change dynamically, and I can't find it from my scripts!
If I could get a reference to the UIBarButtonItem then I could easily set it's accessibilityLabel or accessibilityIdentifier from code to be a fixed string, however I can't figure out how to do this?
All of the stuff I've been able to find references setting the back button to a custom button via self.navigationItem.backBarButtonItem or similar, but when I read this property it's nil. I haven't been able to find out how to get access to the standard item without replacing it. I'd prefer not to replace the button if possible
This was bugging me as well. I've been writing Xcode 7 UI Tests and was trying to come up with a generic way of tapping on the back button without having to replace it with a custom button.
The following is how I solved this for Xcode 7 UI Tests - but you may also be able to apply this to UI Automation as well.
I discovered that (in terms of Xcode 7 UI Tests at least) the back bar button item that is created by the system consists of two buttons the entire thing is a button with an accessibility label of whatever the title of the button is, and then the arrow is also a button with an accessibility label of "Back".
Thus, as long as there aren't any other buttons on the screen that are identified as "Back", the back button can be accessed via the accessibility label of "Back". Like so in the case of UI Tests:
[[app.buttons matchingIdentifier:#"Back"] elementBoundByIndex:0]
Here I'm getting the first button that can be identified by "Back". I my case there could only ever be two such buttons - the arrow, or the whole back button itself (in the case where the back button's title is also "Back"). Since both of these buttons are essentially the same, just getting the first one it finds is sufficient.

Is there a way to create a tabbed picker in iOS? Or somehow combine numpad + picker inputs?

I'm looking for a clean way to enable two interactions within one screen.
For example:
1) User clicks on "Add Activity" button
2) User enters a number of standard units (e.g., 10 meters), and then picks an associated activity from a list (e.g., picklist of: jog, run, walk, crawl)
All I can think of right now is creating two separate entry fields - one that calls up numpad, and another that calls up the picker. Is it possible to created a tabbed numpad so that the user completes numerical entry, then just hits 'Activity Type' above the numpad and the element switches to a picker?
Appreciate any inputs!
Not with a stock keyboard. If all you need is a numpad, you ought to be able to implement a very reasonable keyboard out of a few buttons. Add a couple of "tab" buttons, and show/hide the appropriate view: keyboard or picker.

Resources