same behavior as "Starts" text/date picker in iOS/iPhone calendar - ios

I am trying to learn ios development. I want to simulate the same behavior as I get when I Tap the "Starts" row in iphone calendar app
Same row has the column name "Starts" with default value of Datepicker.date
When I tap on the row, it expands (pushes next row down) and brings up date picker
Right now, I have a text field with its input set to date picker value.
UIDatePicker *datePicker = [[UIDatePicker alloc]init];
[datePicker setDate:[NSDate date]];
[self.timeTextField setInputView:datePicker];
In my case date picker, comes bottom up.
Please help

As written, your question is too broad, and too much of a "spoon-feed me a complete solution to my problem" question. You're much more likely to get help if you try specific things and ask questions about the problems you have in implementing those things.
Break it down into parts. What are the sub-parts, and what are you able to do on your own? Have you created a date picker and set it to a default date yet?
Are you looking for help with inserting a date picker as a new cell in a table view immediately below the "starts" cell? are you looking for help with making changes to the picker update the "starts" date cell immediately?
Again, break it into parts and tackle each part separately. First, simply create a date picker on it's own window and learn how to use it. Then add a label under the date picker, set yourself up as the picker's delegate, and display the date the user selects in the picker into the label.
Then figure out how to set a date picker to a specific date, and/or set the earliest/latest date the picker will accept.
Now figure out how to make a table view respond to taps on a row (try didSelectRowAtIndexPath). Then look at the animated methods for inserting a new row into a table view.
If you have trouble, post back with specific questions on the trouble you are having.

Related

how to show certain amount of dates in FSCalendar in iOS swift

I am having an issue with FSCalendar.
In my project i have a tableview having a different type of cell one of them having a calendar which is FScalendar.
Now I want to show dates on the calendar and dates are coming from another UITableviewCell but its not working properly.
first time it works shows date but after that it disappears.

iOS - How to get a time interval in a picker view

I want to set a time interval in one picker view. How can I manage two time pickers in one picker view? One for a starting time and one for the ending time?
You can see what I mean in the screenshot.
Screenshot of the design
Thanks for your help!

How to make a picker view dynamically in Xcode in objective c?

I am newbie in iOS.I a trying to make picker view in a navigation toolbar my dates are coming their sucessfully.I need to make a Picker view which fills datasource with 2 names and on selection of it i need to return it in string so that I can apply a sql query on it.
I have already mentioned the method of picker view for making my dates come their.
The issue is that I need picker views one which selects the date and other which shows 2 name For e.g 1)Emergency 2)Synergy11.I need to fill both in the picker view. Please let me know.

inline date picker implementation

i am developing an application which is retrieve some data from a web service and show them in a table view.i want to filter the data on the date.so i have tried to implement a in line date picker. so i have successfully done an exercise by help of this.
so i have a question : as i know, all the rows are filled to the table view via cellForRowAtIndexPath method. can i do such a thing like , when i select a date from the inline date picker, it should be load the cells by calling the web service according to the date..
simply , first of all all the cells should be empty. when we touch the top most cell , in line date picker is showed. after we select the date, then the cells should be loaded.. can i do that ? if it is ,can some one give me some idea how to do that? please guide me with some links , code samples ideas.. anything....
thank you
try like this take picker in Xib and connect it properly, And set IBAction as ValueChanged
after that call this method while changing the date
-(IBAction)datePickerValueChanged: (id)sender {
NSDate *selectedDate = [sender date];
NSLog(#"%#",selectedDate);
//do something with selectedDate
}

Get selected row of UIDatePicker while spinning

I have a UIDatePicker in a view whose controller is in a UINavigationController. I'm registering changes in the selected date like this:
[self.datePicker addTarget:self.alarm action:#selector(timeChanged:) forControlEvents:UIControlEventValueChanged];
It works well, except if the user presses the back button in the UINavigationController before the date picker has completely settled. In that case, the timeChanged: method isn't being called, and so I'm not getting the new date.
Nothing is being released when I press the back button, it's just that the view controller is being popped off. (A reference to it is maintained).
I've found solutions to this problem with UIPickerView that involve implementing delegate methods for the picker view (eg: UIPickerView: Get row value while spinning?). But unless I'm very mistaken, that's not an option with a UIDatePicker. If possible, I'd like to stick with the UIDatePicker rather than a custom UIPickerView. Is there a way to do this? It doesn't have to get the selected row perfectly (within a row or two is fine), but the closer the better.
EDIT: This is for a jailbreak app, so private APIs are fine, if I can figure out what they are.
As for the current APIs, there's no way of detecting whether a UIDatePicker is spinning.
This is because UIDatePicker is not a subclass of UIPickerView and it manages a UIPickerView internally.
I'm afraid the best solution here is to use a custom UIPickerView.

Resources