Picking the Date and Time with UIDatePicker effect: 1. declaring a property of type UIDatePicker #import "ViewController.h" @interface ViewController () @property (nonatomic, strong) UIDatePicker *myDatePicker; @end @implementation ViewControlle…
iOS上的选择时间日期的控件是这样的,左边是时间和日期混合,右边是单纯的日期模式. 您可以选择自己需要的模式,Time, Date,Date and Time , Count Down Timer四种模式. 本篇文章简单介绍下PickerDate控件的使用1.新建一个Singe View Application,命名为DatePickDemo,其他设置如图 2.放置控件打开ViewController.xib,拖拽一个DatePicker控件放到界面上,再拖拽一个Button控件放到界面上,双…
Presenting and Managing Views with UIViewController ProblemYou want to switch among different views in your application. SolutionUse the UIViewController class. ( Apple’s strategy for iOS development was to use the model-view-controller (MVC) divisio…
ProblemYou want to display an image instead of text as the title of the current view controlleron the navigation controller SolutionUse the titleView property of the view controller’s navigation item - (void)viewDidLoad { [super viewDidLoad]; /* Crea…
ProblemYou would like to directly manipulate the array of view controllers associated with aspecific navigation controller SolutionUse the viewControllers property of the UINavigationController class to access andmodify the array of view controllers…
ProblemYou would like to allow your users to move from one view controller to the other witha smooth and built-in animation. SolutionUse an instance of UINavigationController. What it's like If you’ve used an iPhone, iPod Touch, or iPad before, chanc…
You want to be able to allow your users to share content inside your apps with theirfriends, through an interface, such as Facebook and Twitter. Solution Create an instance of the UIActivityViewController class and share your contentthrough this clas…
You would like to present a few options to your users from which they can pick anoption, through a UI that is compact, simple, and easy to understand. effect: 1. declare control #import "ViewController.h" @interface ViewController () @property (…