【英文完整版】iOS 8 Swift Programming Cookbook

5星(超过95%的资源)
所需积分/C币:7 2015-06-17 19:19:30 23.51MB PDF
3
收藏 收藏
举报

iOS 8 Swift Programming Cookbook Solutions & Examples for iOS Apps swift学习不容错过的书
ioS 8 Swift Programming Cookbook Vandad nahavandipoor Beijing· Cambridge· Farnham·.Kon· Sebastopol· Tokyo OREILLY° iOS 8 Swift Programming Cookbook by vanda nahavandipoor Copyright O 2015 Vandad Nahavandipoor. All rights reserved Printed in the United States of america Published by o reilly media, InC, 1005 Gravenstein Highway North, Sebastopol, CA95472 OReilly books may be purchased for educational, business, or sales promotional use. Online editions are alsoavailableformosttitles(http://safaribooksonline.com).Formoreinformationcontactourcorporate institutionalsalesdepartment800-998-9938orcorporate@oreilly.com Editors: andy Oram and Rachel roumeliotis Cover Designer: Ellie Volckhausen Production Editor: Nicole Shelby Interior Designer: David Futato Proofreader: Gillian McGarvey Illustrator: Rebecca demarest Indexer: Lucie haskins November 2014: First edition Revision history for the First Edition: 2014-11-06: First release Seehttp://oreilly.com/catalog/errata.csp?isbn=9781491908693forreleasedetails The O Reilly logo is a registered trademark of O Reilly Media, Inc. iOS 8 Swfit Programming Cookbook, the cover image, and related trade dress are trademarks of O Reilly Media, Inc Many of the designations used by manufacturers and sellers to distinguish their products are claimed as rademarks. Where those designations appear in this book, and O Reilly Media, Inc was aware of a trademark claim, the designations have been printed in caps or initial caps While the publisher and the author have used good faith efforts to ensure that the information and instruc- tions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limitation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intel lectual property rights of others, it is your responsibility to ensure that your use thereof complies with such licenses and/or rights ISBN:978-1-491-90869-3 [Malloy Table of contents Preface 1. The basics 1. 1. Adding blur Effects to Your Views 1. 2. Presenting Temporary Information on the Screen with Popovers 12 1.3. Displaying Images with UIImage View 1.4. Displaying Static Text with UILabel 21 1.5. Adding buttons to the user Interface with UIButton 27 1.6. Displaying Alerts and Action Sheets 31 1.7. Creating, Using, and Customizing Switches with UISwitch 37 1.8. Picking Values with the UIPicker View 41 1.9. Picking the Date and Time with UIDatePicker 46 1.10. Implementing Range Pickers with UISlider 49 1. 11. Grouping Compact Options with UISegmented Control 53 1.12. Presenting Sharing Options with UIActivity View Controller 1. 13. Presenting Custom Sharing Options with UIActivity View Controller 1. 14. Displaying an Image on a Navigation Bar 68 1. 15. Adding buttons to navigation Bars Using uIBarButtonItem 70 1. 16. Accepting User Text Input with UITextField 75 1. 17. Displaying Long Lines of Text with UIText View 83 1. 18. Creating Scrollable Content with UIScrollView 88 1. 19. Loading Web Pages with WebKit 91 1. 20. Loading Web Pages with UIWeb View 94 1.21. Displaying Progress with UIProgress View 97 1.22. Creating a Provision Profile 2. Extensions ,107 2. 1. Adding New Photo Editing Capabilities to the Photos App 110 2. 2. Providing a Custom Sharing extension to iOS 118 2.3. Building Custom Keyboards 129 2.4. Creating a Service Within Your App with Action Extensions 137 2.5. Adding Widgets to the Notification Center 144 3. Managing Health Data with HealthKit ,,155 3. 1. Setting Up Your App for HealthKit 3. 2. Retrieving and Modifying the Users Weight Information 160 3.3. Accessing and Modifying the User's Height Information 165 3.4. Retrieving User Characteristics 172 3.5. Observing Changes to the Users Health Information 177 3.6. Reading and modifying the users Total Calories Burned 183 3.7. Converting Between Units 196 4. Managing Home Appliances with HomeKit.................. 201 4.1. Simulating HomeKit Accessories 203 4.2. Managing the User's Home in HomeKit 212 4.3. Adding rooms to the users home 219 4.4. Specifying Zones in the Users Home 224 4.5. Discovering and managing homeKit Enabled accessories 229 4.6. Interacting with HomeKit Accessories 234 4.7. Grouping Services of HomeKit Accessories 242 5. Creating dynamic and Interactive User Interfaces 247 5. 1. Adding gravity to Your uI components 249 5. 2. Detecting and Reacting to Collisions Between UI Components 250 5.3. Animating Your UI Components with a Push 257 5.4. Attaching Multiple dynamic Items to Each Other 262 5.5. Adding a Dynamic Snap Effect to Your UI Components 266 5.6. Assigning Characteristics to Your Dynamic Effects 269 6. Table and collection views.4.....275 6. 1. Populating a Table view with Data 277 6.2. Enabling Swipe Deletion of Table View Cells 281 6.3. Constructing Headers and Footers in Table Views 282 6. 4. Displaying a Refresh Control for Table views 288 6.5. Providing basic Content to a Collection View 292 6.6. Feeding Custom Cells to Collection Views Using. xib Files 297 6.7. Handling Events in Collection Views 303 6.8. Providing Header and Footer in a Collection View 307 6.9. Adding Custom Interactions to Collection Views 312 Table of contents 7. Concurrency and Multitasking................ 315 7.1. Performing UI-Related Tasks 319 7.2. Performing Non-UI Related Tasks 321 7.3. Performing Tasks After a Delay 329 7.4. Performing a Task Only once 331 7.5. Grouping Tasks Together 332 7.6. Creating Simple Concurrency with Operations 335 7. 7. Creating Dependency between Operations 340 7.8. Firing Periodic Tasks 342 7.9. Completing a Long- Running Task in the Background 345 7. 10. Adding background Fetch Capabilities to Your apps 348 7.1l. Playing Audio in the Background 357 7. 12. Handling Location Changes in the Background 360 7. 13. Handling Network Connections in the Background 363 8. Security 367 8. 1. Authenticating the User with Touch ID 37 8.2. Enabling Security and Protection for Your Apps 376 8.3. Storing values in the Keychain 381 8.4. Finding values in the Keychain 383 8.5. Updating Existing Values in the Keychain 386 8.6. Deleting Existing Values in the Keychain 390 8.7. Sharing Keychain Data Between Multiple Apps 392 8.8. Writing to and Reading Keychain Data from iCloud 397 8.9. Storing Files Securely in the App Sandbox 399 8.10. Securing Your User Interface 403 9. Core Location, iBeacon, and Maps...,........ ,,407 9. 1. Detecting Which Floor the User Is on in a Building 407 9. 2. Defining and Processing iBeacons 409 9.3. Pinpointing the Location of a Device 415 9.4. Displaying Pins on a Map View 420 9.5. Displaying Custom Pins on a Map view 423 9.6. Searching on a Map view 429 9.7. Displaying Directions on the ma 434 9.8. Customizing the View of the Map with a Camera 440 10. Gesture Recognizers............................445 10. 1. Detecting Swipe Gestures 447 10.2. Detecting Rotation Gestures 44 10.3. Detecting Panning and Dragging Gestures 452 10.4. Detecting Long Press Gestures 455 Table of Contents 10.5. Detecting Tap gestures 458 10.6. Detecting Pinch Gestures 460 10.7. Detecting Screen Edge Pan Gestures 462 11. Networking and Sharing..... 465 11.1. Downloading Data Using NSURLSession 465 11.2. Downloading Data in the Background Using nsurlsession 473 11.3. Uploading Data Using NSURLSession 477 11.4. Downloading Asynchronously with NSURLConnection 479 11.5. Handling Timeouts in Asynchronous Connections 483 11.6. Downloading Synchronously with NSURLConnection 484 11.7. Customizing URL Requests 487 11.8.SendinghttprequestswithNsurlConNectiOn 488 11.9. Serializing and Deserializing jSoN Objects 491 11.10. Integrating Social Sharing into Your Apps 495 12. Multimedia..................................499 12. 1. Playing audio file 499 12.2. Recording audio 501 12.3. Playing video files 509 12.4. Capturing Thumbnails from Video Files 513 12.5. Accessing the Music Library 516 13. Address book 525 13. 1. Retrieving a person entity with System UI 527 13.2. Retrieving a Property of a Person Entity with System UI 531 13.3. Requesting Access to the Address Book 534 13. 4. Retrieving all the People in the Address book 537 13.5. Retrieving Properties of Address Book Entries 538 13.6. Inserting a Person Entry into the address book 541 13.7. Inserting a group entry into the Address book 544 13.8. Adding Persons to Groups 547 13.9. Searching the Address Book 549 13.10. Retrieving and Setting a Persons Address Book Image 552 14. Files and Folder management 555 14. 1. Finding the Paths of the Most Useful Folders on Disk 557 14.2. Writing to and reading from files 559 14.3. Creating Folders on Disk 564 14.4. Enumerating Files and Folders 565 14.5. Deleting Files and Folders 571 14.6. Saving Objects to Files 574 ⅵi| Table of contents 15. Camera and the photo Library............ 577 15. 1. Detecting and Probing the Camera 579 15. 2. Taking Photos with the Camera 583 15.3. Taking Videos with the Camera 587 15.4. Storing photos in the photo library 590 15.5. Storing videos in the photo library 595 15.6. Searching for and Retrieving images and videos 597 15.7. Reacting to Changes in Images and Videos 602 15.8. Editing Images and Videos Right on the Device 608 16. Notifications ,,615 16. 1. Sending notifications 616 16.2. Listening for and Reacting to notifications 618 16.3. Listening and Reacting to Keyboard Notifications 621 16.4. Scheduling Local Notifications 630 16.5. Listening for and Reacting to Local notifications 636 16.6. Handling Local System Notifications 639 16.7. Setting Up Your App for Push Notifications 642 16.8. Delivering Push Notifications to Your App 648 16.9. Reacting to Push Notifications 656 17.〔 ore data. 659 17.1. Performing Batch Updates on Core Data 661 17.2. Writing to Core Data 664 17.3. Reading Data from Core Data 666 17.4. Deleting Data from Core Data 668 17.5. Sorting Data in Core Data 670 17.6. Boosting Data Access in Table views 672 17.7. Implementing relationships in Core Data 680 17.8. Fetching Data in the background 686 17.9. Using Custom Data Types in Your Core Data Model 690 18. Dates, Calendars, and events 697 18. 1. Constructing Date Objects 698 18. 2. Retrieving Date Components 699 18.3. Requesting Permission to Access Calendars 700 18.4. Retrieving Calendar Groups on an ioS Device 705 18.5. Adding Events to Calendars 707 18.6. Accessing the Contents of calendars 712 18.7. Removing Events from Calendars 714 18.8. Adding recurring events to calendars 718 18.9. Retrieving the Attendees of an Event 722 Table of Contents 18.10. Adding alarms to calendars 725 19. Graphics and Animations. 729 19. 1. Drawing Text 734 19.2. Drawing lmages 736 19.3. Constructing Resizable images 739 19.4. Drawing Lines 745 19.5. Constructing Paths 751 19.6. Drawing rectangles 755 19.7. Adding shadows to Shapes 759 19.8. Drawing Gradients 764 19.9. Transforming views 770 19.10. Animating views 776 20. Core motion 787 20. 1. Retrieving Altitude Data 788 20.2. Retrieving Pedometer Data 790 20.3. Detecting the availability of an accelerometer 794 20.4. Detecting the availability of a gyroscope 796 20.5. Retrieving Accelerometer Data 797 20.6. Detecting Shakes on an iOS Device 801 20.7. Retrieving gyroscope data 802 21. Setting Up Your App for Cloud,…… 21.l0ud. 805 807 21.2. Storing Data with CloudKit 812 21.3. Retrieving Data with CloudKit 820 21.4. Querying the Cloud with CloudKit 826 21.5. Observing Changes to Records in CloudKit 831 21.6. Retrieving User Information from CloudKit 839 21.7. Storing and Synchronizing dictionaries in iCloud 846 21.8. Creating and Managing Files and Folders in iCloud 851 21.9. Searching for Files and Folders in iCloud 855 Index ,863 I Table of Contents

...展开详情
试读 127P 【英文完整版】iOS 8 Swift Programming Cookbook
立即下载 身份认证后 购VIP低至7折
一个资源只可评论一次,评论内容不能少于5个字
peipei巴比 带目录的原版英文 很不错!
2016-01-29
回复
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
上传资源赚钱or赚积分
最新推荐
【英文完整版】iOS 8 Swift Programming Cookbook 7积分/C币 立即下载
1/127
【英文完整版】iOS 8 Swift Programming Cookbook第1页
【英文完整版】iOS 8 Swift Programming Cookbook第2页
【英文完整版】iOS 8 Swift Programming Cookbook第3页
【英文完整版】iOS 8 Swift Programming Cookbook第4页
【英文完整版】iOS 8 Swift Programming Cookbook第5页
【英文完整版】iOS 8 Swift Programming Cookbook第6页
【英文完整版】iOS 8 Swift Programming Cookbook第7页
【英文完整版】iOS 8 Swift Programming Cookbook第8页
【英文完整版】iOS 8 Swift Programming Cookbook第9页
【英文完整版】iOS 8 Swift Programming Cookbook第10页
【英文完整版】iOS 8 Swift Programming Cookbook第11页
【英文完整版】iOS 8 Swift Programming Cookbook第12页
【英文完整版】iOS 8 Swift Programming Cookbook第13页
【英文完整版】iOS 8 Swift Programming Cookbook第14页
【英文完整版】iOS 8 Swift Programming Cookbook第15页
【英文完整版】iOS 8 Swift Programming Cookbook第16页
【英文完整版】iOS 8 Swift Programming Cookbook第17页
【英文完整版】iOS 8 Swift Programming Cookbook第18页
【英文完整版】iOS 8 Swift Programming Cookbook第19页
【英文完整版】iOS 8 Swift Programming Cookbook第20页

试读结束, 可继续阅读

7积分/C币 立即下载