没有合适的资源?快使用搜索试试~ 我知道了~
首页iOS.Apprentice.3.MyLocations.v5.0.pdf
iOS.Apprentice.3.MyLocations.v5.0.pdf

Up to date for iOS 10, Xcode 8, and Swift 3 The iOS Apprentice is a series of epic-length tutorials for beginners where you’ll learn how to build 4 complete apps from scratch. 一共四个部分: 第一部分地址:http://download.csdn.net/detail/xinconan1992/9717164 第一部分地址:http://download.csdn.net/detail/xinconan1992/9717170 随书代码地址:http://download.csdn.net/detail/xinconan1992/9717159
资源详情
资源评论
资源推荐


iOS Apprentice
Matthijs Hollemans
Copyright ©2016 Razeware LLC.
Notice of Rights
All rights reserved. No part of this book or corresponding materials (such as text,
images, or source code) may be reproduced or distributed by any means without
prior written permission of the copyright owner.
Notice of Liability
This book and all corresponding materials (such as source code) are provided on an
“as is” basis, without warranty of any kind, express of implied, including but not
limited to the warranties of merchantability, fitness for a particular purpose, and
noninfringement. In no event shall the authors or copyright holders be liable for any
claim, damages or other liability, whether in action of contract, tort or otherwise,
arising from, out of or in connection with the software or the use of other dealing in
the software.
Trademarks
All trademarks and registered trademarks appearing in this book are the property of
their own respective owners.
License
By purchasing iOS Apprentice, you have the following license:
• You are allowed to use and/or modify the source code in iOS Apprentice in as
many apps as you want, with no attribution required.
• You are allowed to use and/or modify all art, images and designs that are
included in iOS Apprentice in as many apps as you want, but must include this
attribution line somewhere inside your app: “Artwork/images/designs: from iOS
Apprentice book, available at www.raywenderlich.com”.
• The source code included in iOS Apprentice is for your personal use only. You are
NOT allowed to distribute or sell the source code in iOS Apprentice without prior
authorization.
• This book is for your personal use only. You are NOT allowed to sell this book
without prior authorization, or distribute it to friends, coworkers or students;
they would need to purchase their own copies.
iOS Apprentice
raywenderlich.com 2

About the author
Matthijs Hollemans is a mystic who lives at the top of a mountain
where he spends all of his days and nights coding up awesome
apps. Actually he lives below sea level in the Netherlands and is
pretty down-to-earth but he does spend too much time in Xcode.
Check out his website at www.matthijshollemans.com.
About the cover
Striped dolphins live to about 55-60 years of age, can travel in pods numbering in
the thousands and can dive to depths of 700 m to feed on fish, cephalopods and
crustaceans. Baby dolphins don't sleep for a full a month after they’re born. That
puts two or three sleepless nights spent debugging code into perspective, doesn't
it? :]
iOS Apprentice
raywenderlich.com 3

Table of Contents: Extended
Tutorial 3: MyLocations 6.............................................................
The MyLocations app 6..........................................................................................................
Swift review 7...........................................................................................................................
Getting GPS coordinates 29.................................................................................................
Objects vs. classes 76.............................................................................................................
The Tag Location screen 88...................................................................................................
Value types and reference types 130................................................................................
Storing the locations with Core Data 136...........................................................................
The Locations tab 166............................................................................................................
Hierarchies 191........................................................................................................................
Pins on a map 193..................................................................................................................
The photo picker 212..............................................................................................................
Making the app look good 244...........................................................................................
The end 279..............................................................................................................................
iOS Apprentice
raywenderlich.com 5

3
Tutorial 3: MyLocations
By Matthijs Hollemans
The MyLocations app
In this tutorial you will look at some of the more alluring technologies from the iOS
SDK and you’ll dive a lot deeper into the Swift language.
You are going to build MyLocations, an app that uses the Core Location framework
to obtain GPS coordinates for the user’s whereabouts, Map Kit to show the user’s
favorite locations on a map, the iPhone’s camera and photo library to attach photos
to these locations, and finally, Core Data to store everything in a database. Phew,
that’s a lot of stuff!
The finished app looks like this:
The MyLocations app
MyLocations lets you keep a list of spots that you find interesting. Go somewhere
raywenderlich.com 6
剩余278页未读,继续阅读











安全验证
文档复制为VIP权益,开通VIP直接复制

评论3