UI Design for UIDatePicker in iOS - iphone

I have experience in Android and currently started to learn iOS. I created a mechanism to Pick data in an Android App. When I click on Date button, a DatePicker pops up:
As you see It has Cancel and Set button.
My question is about my iphone App. I want to have the same mechanism. When I click on the button, Date picker pops up (that can have Set and cancel button like Android Date picker). How can I do that? I'm not sure that it is a good way in iPhone, Can you help me if we can design a better mechanism?

Here's a UX comparison between Android and iOS standard widgets, with links to the documentation on the relevant Apple / Android websites. It's a nice way to get started learning all the technical terms.
http://kintek.com.au/blog/portkit-ux-metaphor-equivalents-for-ios-6-and-android-4/
Hopefully that gets you started.

Apple has a sample project that demonstrates this. You'll have to adapt it slightly: instead of showing/hiding the date picker itself, you'll want to show/hide a view containing a date picker and a dismissal button.
It's called DateCell.
Basically, it treats the date picker as if it were the keyboard for a cell containing the date. You'll need to manage hiding it when the user enters a text field (and thus, needs the real keyboard) and scrolling to keep the date row in view, but all the bits you need are in this project one way or the other.

One way to do it would be add a custom buttons to the same view containing date picker and then pop it up when the users wants. Instead of using the date picker delegate use the buttons action to get the date picker value.

Related

Daterangepicker is not keyboard accessible

I am using a daterangepicker in my project. It's developed with help of third party library daterangepicker.js But, it's not supporting keyboard accessibility. Author of this library is not ready to add the feature as it's 11 years old library.
Can someone help me to add the keyboard accessibility for this date picker in my application. I appreciate the suggestions and ideas on this.
More details on exact issue:
We attached the date picker to a input field. And opening the datepicker as soon as input field gets the focus. But, not able to navigate the datepicker using keyboard(arrow, tab etc..)
I am expecting to make date range picker keyboard accessible.

iOS - UIPickerView Dismiss with button or without a button?

Good Afternoon/Evening/Morning Folks,
I recently encountered a discussion with another developer on dismissing a UIPickerView. We work on a legacy enterprise application that had a lot of issues and was written very poorly (among other things). Since then, we revamped and fixed a lot of bugs with this program, strictly adhering to Apple's Human Interface Guidelines as much as possible while keeping to original requirements.
We seem to have a difference in opinion as Human Interface Guidelines do not really go into any detail about picker views. We implemented our new UIPickerView with a "Done," Button to confirm a selected value to be placed in a UITextField. Screen's input would be locked until they selected a value or clicked done.
Legacy application prior to our changes allowed users to utilize a done button but also by way of tapping a value selected in a picker. In addition, legacy application would also show selected UIPickerView value in UITextField prior to selection, wiping out original contents , if any was selected prior to opening a UIPickerView.
So, What is correct way to implement a UIPickerView per common practice or Strict Apple Documentation (if any exists). What is common practice?
Sorry, I cannot post any screen shots or code snippets due to business process reasons. I will do my best to explain if any questions arise.
Thanks,
We can figure this out through apps designed by Apple. Here are two examples
1. Contacts
Find a contact person in the Contacts app and set birthday. The picker shows up. While you are dragging the pickers, it does not set value to the text field. It happens only when you release the wheel. There is no Done button to hide the picker it self. To dismiss it, you can either click on the done button on navigation bar to end editing for the whole page, or click on another text field which pops a different keyboard.
2.Setting - Date&Time
Basically the same as Contacts app. Here you cannot even dismiss the picker.

how to create the control in xcode

I'm new to iphone programming. there are lot of basic controls in xcode which i can implement but i want to know how to create the control shown below in iphone.
It is not present in list of control objects in xcode
There are no default dropdown implementations available for iPhone. You can try to implement a UIPickerView or UIActionSheet based on the requirement.
If you cannot modify your design, you can go ahead and implement your own dropdown implementation. Basically you need to have a button with the above image as background view and on tap of that you need to show a table view below that. Alternatively you can check this custom dropdown list and this Drop Down Demo iOS.
Xcode does not provide this control.You can create custom control with a table view and Button.Show the table view when you click on it and hide it on again clicking on it.You can also add images on background for the same look.

iPhone alternate option for DatePicker

I need to select dates from a calender with a click of a button.
I tried UIDatePicker, but it is occupying major part of screen.
Can I have any other way to do this?
Thanks in advance.
It's generally recommended to use the UIDatePicker.
I would suggest you link it to a button/tableviewcell, which when pressed presents an actionsheet with the UIDatePicker. This way will shortly occupy a large part of the screen when it's selected. In my experience there is no other way around it.

iphone UI forms and labels

Just a general question here, I have an iPhone app that has 3 textfields on a view. What is best practice for displaying 'form elements' and 'labels'?
Coming from a web background I have automatically used labels (above the textfields) & textfields on my UI, but should i get rid of my labels and use the placeholder property of the textfields instead?
the app target audience will be varied demographics and i envisage a lot of newbie iphone users using the app.
thanks
kb
You are correct, placeholder text is the way to go. For an example, go to the Calendar app, tap on the + button at the top-right, & select 'Title Location'. You will see something similar to what you are trying.