VandadNahavandipooriOS7ProgrammingCookbookiOS7ProgrammingCookbookbyVandadNahavandipoorCopyright©2014VandadNahavandipoor.Allrightsreserved.PrintedintheUnitedStatesofAmerica.PublishedbyO’ReillyMedia,Inc.,1005GravensteinHighwayNorth,Sebastopol,CA95472.O’Reillybooksmaybepurchasedforeducational,business,orsalespromotionaluse.Onlineeditionsarealsoavailableformosttitles(http://my.safaribooksonline.com).Formoreinformation,contactourcorporate/institutionalsalesdepartment:800-998-9938orcorporate@oreilly.com.Editors:AndyOramandRachelRoumeliotisProductionEditor:ChristopherHearseCopyeditor:ZygGroup,LLCProofreader:JulieVanKeurenIndexer:AngelaHowardCoverDesigner:RandyComerInteriorDesigner:DavidFutatoIllustrator:RebeccaDemarestOctober2013:FirstEditionRevisionHistoryfortheFirstEdition:2013-10-09:FirstreleaseSeehttp://oreilly.com/catalog/errata.csp?isbn=9781449372422forreleasedetails.NutshellHandbook,theNutshellHandbooklogo,andtheO’ReillylogoareregisteredtrademarksofO’ReillyMedia,Inc.,iOS7ProgrammingCookbook,theimageofaCowan’sshrewtenrec,andrelatedtradedressaretrademarksofO’ReillyMedia,Inc.Manyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsareclaimedastrademarks.Wherethosedesignationsappearinthisbook,andO’ReillyMedia,Inc.,wasawareofatrade‐markclaim,thedesignationshavebeenprintedincapsorinitialcaps.Whileeveryprecautionhasbeentakeninthepreparationofthisbook,thepublisherandauthorassumenoresponsibilityforerrorsoromissions,orfordamagesresultingfromtheuseoftheinformationcontainedherein.ISBN:978-1-449-37242-2[QG]TableofContentsPreface.......................................................................xi1.ImplementingControllersandViews...........................................11.1.DisplayingAlertswithUIAlertView231.2.CreatingandUsingSwitcheswithUISwitch321.3.CustomizingtheUISwitch361.4.PickingValueswiththeUIPickerView391.5.PickingtheDateandTimewithUIDatePicker451.6.ImplementingRangePickerswithUISlider501.7.CustomizingtheUISlider541.8.GroupingCompactO...