Custom DatePicker with just two components - iphone

I want to to use custom datePicker in my project. In Mode date it shows Month,Day and Year, in my case I don't need Year, I just want to display Month and day.

The API does not provide a way to do this. If you want to be able to, please file a report requesting this ability, and it'll hopefully get included in a future release of iOS.
In the meantime, you can make a pretty convincing replica yourself using a UIPickerView.

Im sorry but following the reference of the PickerView
http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIDatePicker_Class/Reference/UIDatePicker.html#//apple_ref/doc/c_ref/UIDatePickerMode
It says that is not possible to do that, so your only option is to implemente yourself the delegate and the datasource, and create the pickerview with the data you need.

Related

What is the equivalent of a C# drop down combo box on iOS?

I am writing an application using Objective-C for iPhone.
In this application, the user, while entering a new record, needs to have a lookup capability (such as state, gender, phone type, etc). In C# i usually use a drop down combo or something like that to accomplish this task. What is the equivalent in Objective-C? Can someone show me a sample application?
Take a look at UIPickerView. It uses a spinning wheel to show a set of values that can be selected by the user. You need to create an object that adopts the UIPickerViewDelegate protocol to handle responding to what the user selects, and an object that adopts UIPickerViewDataSource protocol to populate the picker view.
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIPickerView_Class/Reference/UIPickerView.html
The equivalent would be a UIPickerView
If you want to choose a date then use UIDatePicker.
UIPickerView is pretty much the same thing as a dropdown combo box, except without the dropdown part
I prefer to use UIActionSheet. Works quite well as combo box.
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIActionSheet_Class/Reference/Reference.html
there is an iOS combobox api that might help you add a combobox component to your app. Check it here: http://www.chupamobile.com/products/details/365/ZComboBox/

Iphone Calendar without marking etc just basic calendar

Could someone possibly show me how to do a basic calendar display that gets the date from date selected in a calendar? The Kal examples and code does way more than I need and is not set for the type of app im making. All I really need is a calendar with the dates, and then from there something to retrieve the date so i can pass it to my other functions. I feel like the UIDatePicker is trashy looking and would like the calendar view if its possible.
Hii Casey,
For simplest / Easy Calender Integration - use Tapku Library
https://github.com/devinross/tapkulibrary
Its simple than compared to Kal.
Tapku Calendar is a solid calendar implementation, I've used it in past iPhone projects. You can check out a blog post I wrote about it earlier this year here: http://developinginthedark.com/posts/iphone-tapku-calendar-markers
I've recently updated it to include example code showing it's integration into a Tab Bar application. Scroll down the bottom of the post to get that Tab Bar application code. If you run into any difficulties, let me know.

Any code examples for using a UITableView to implement in-app settings?

Any code examples for using a UITableView to implement in-app settings?
That is where to get the iPhone settings app look and feel one custom builds the settings into a UITableView. So you you would custom set the sections and cells that get returned with switch type statements.
In particular interested in reviewing the coding approach for how to:
best configure the cellForRowAtIndexPath and didSelectRowAtIndexPath
how to handle those cells for which you want in cell editing (e.g. text)
those cells where you need to launch off into another screen to set a date/time for example
how to collect up parameters and pass back to calling rootViewController (in my case need to persist data out to Core Data persistence)
Note: using Core Data so not interested in using libraries such as InAppSettings [any feedback re whether such libraries might be ok appreciated at this SO question I created].
thanks
I am not sure if you can use the inappsettingskit for your needs. It is open source so you are free to modify the code as you wish, but it doesn't look as an out of the box solution.
If you want to make these settings available in the settings app you will have to live with some workarounds for example saving NSDate AND getting a nice UI control to modify it: Use a textfield, there is no control specified which let's you pick a date. Have a look at Apple's documentation.
So the last option will be coding. First of all, determine what kind of types you want to support. Then create custom TableViewCells which reflect those kinds. If some kinds do need some special way of editing, for example a color picker, you'll have to write those controllers as well. You set a cell into editing mode with the delegate method tableView:didSelectRowAtIndexPath and present the custom controller or get into editing directly for example a UITextField. A Slider is handled directly without any coding.
The cells will need some kind of identifier so you can identify those in your model. A TableView and Core Data can interact with each other pretty well by using the NSFetchedResultsController. Create a simple window based app with a template and check the Use Core Data for Storage. The rootViewController illustrates how a tableView works together with Core Data. For your case it will be getting a bit more complicated as inserting a row will have to determine what kind of cell it should add.
I think you should look into this and get back with some more specific questions.

Remove the "Today" entry from UIDatePicker

When using a UIDatePicker in iOS SDK, there is always an entry "Today" at the current date.
That's useful in most cases, but where I need it, it's rather confusing.
Is there a way to:
a) disable the "today"-entry (use regular date instead), and have all entries look the same
or even better
b) disable the "today"-entry (use regular date instead), and color the next day in blue
Further more, the application is for private use only, it's not going to get distributed on the AppStore, which means I could use private APIs (I still would rather avoid them) and I don't need it to be backwards compatible. iOS 4 is fine.
I had a similar problem with the UIDatePicker not matching my requirements exactly (in my case I needed a datepicker without a year wheel). Having a look at the UIDatePicker reference, it doesn't look like you can disable the today entry, so you might be forced to do what I did.
I used a UIPickerView and re-implemented the date selection functionality I needed with that. There are a few things you will need to do to implement your custom date picker:
Implement a UIPickerViewDataSource to set up row titles, dimensions and row counts.
Implement a UIPickerViewDelegate to handle events from your custom picker.
Make sure you update your day wheel when the month wheel changes so you get appropriate days for each month. UIDatePicker does this pretty seamlessly. With limited time, I just reload the picker when the month changes so the day counts match up.

iphone : customize the calendar pick up date

My client would like that the user could pick up a date in an iphone app.
He wants that all the days of the month appear. Moreover he would like to switch to the next or previous month. How would it possible to do that ?
Moreover he would like that in the calendar some days of the month (for ex. the 1rst, the 9th and the 15th) appear in a different color.
If it's possible, how could this be done ?
Thank you in advance for your help
Fabio
Currently there isn't a calendar object exposed in the 3.x iPhone SDK.
You can however implement your own. One way would be to implement your own UIView object and handle the painting and reaction to touching manually. Another way would be to implement a calendar as an HTML page and either create a full web application or embed a UIWebView.
http://dblog.com.au/iphone-development/iphone-sdk-tutorial-build-your-very-own-web-browser/