Professional Documents
Culture Documents
i
Fetching Loans with the Kiva API ............................................................................................................. 65
Displaying Loans in A Table View ............................................................................................................. 71
Compile and Run the App .......................................................................................................................... 72
ii
Search Nearby Restaurants and Adding annotations .................................................................................. 125
Testing the Demo App ................................................................................................................................ 127
Modifying the Pin Color for the Nearby Restaurants ................................................................................. 128
iii
Creating a Preview Layer and Start the Session ......................................................................................... 177
Capture a Still Image .................................................................................................................................. 178
Toggle between Front and Back Facing Camera Using Gestures .............................................................. 179
Zoom in and Out ......................................................................................................................................... 181
Saving Images to the Photo Album ............................................................................................................ 183
iv
Build and Run the AirDrop Demo .............................................................................................................. 229
Uniform Type Identifiers ............................................................................................................................ 230
Summary ..................................................................................................................................................... 231
Chapter 20: Adaptive Collection Views Using Size Classes and UITraitCollection
Creating the Demo Project ......................................................................................................................... 267
Diving into the Code .................................................................................................................................. 269
Designing for size classes ........................................................................................................................... 272
Understanding Trait Collections ................................................................................................................. 273
Adaptive Collection View .......................................................................................................................... 274
Respond to the Change of Size Class ......................................................................................................... 276
Your Exercise .............................................................................................................................................. 277
v
Chapter 22: Building Slide Out Sidebar Menus
A Glance at the Demo App ......................................................................................................................... 304
Creating the Xcode Project ......................................................................................................................... 305
Using the SWRevealViewController Library ................................................................................ 306
Associate the Front View and Rear View Controller .................................................................................. 308
Handling Menu Item Selection ................................................................................................................... 312
Customizing the Menu ............................................................................................................................... 313
Adding a Right Sidebar .............................................................................................................................. 314
Refactoring the Code with Swift Extensions .............................................................................................. 317
vi
Chapter 26: XML Parsing and RSS
Demo App ................................................................................................................................................... 377
A Sample RSS Feed .................................................................................................................................... 378
Building the Feed Parser ............................................................................................................................ 382
Expanding and Collapsing Table View Cells ............................................................................................. 388
vii
Chapter 31: How to Preload a SQLite Database Using Core Data
A Simple Demo App ................................................................................................................................... 460
The CSV File .............................................................................................................................................. 462
Parsing CSV Files ....................................................................................................................................... 463
Preloading the Data and Saving it into Database ....................................................................................... 466
Using External Data Files ........................................................................................................................... 468
Using An Existing Database in Your Project .............................................................................................. 471
viii
Chapter 35: Building iMessage Apps Using Messages Framework
The Demo App ........................................................................................................................................... 517
Creating the Message Extension ................................................................................................................ 518
Sharing Code Using an Embedded Framework ......................................................................................... 521
Create the IconDataKit framework .................................................................................................... 521
Defining the iconSet array .................................................................................................................... 523
Moving the Icon Class from CollectionViewDemo to the Framework ............................................ 524
Replacing the Value of the iconSet Variable ........................................................................................ 525
Designing the UI of the iMessage App ................................................................................................. 526
Implementing MessagesViewController ...................................................................................... 529
Adding a Message to the Conversion ......................................................................................................... 534
Displaying the Icon Details ........................................................................................................................ 540
Designing the Detail View Controller ........................................................................................................ 540
Creating a New Class for the Detail View Controller ................................................................................ 543
Managing Message Selections and Extension States ................................................................................. 545
Summary ..................................................................................................................................................... 549
ix