Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
BSD License

Copyright (c) 2016, Erica Sadun, http://ericasadun.com
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 changes: 15 additions & 11 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,35 @@ That said, if you're new to the platform, this edition of The iOS Developer's Co
Although each programmer brings different goals and experiences to the table, most iOS developers end up solving similar tasks in their development work:


* "How do I build a table?"
* "How do I create a secure Keychain entry?"
* "How do I search the Address Book?"
* "How do I move between views?"
* "How do I build a table?"
* "How do I create a secure Keychain entry?"
* "How do I search the Address Book?"
* "How do I move between views?"
* "How do I use Core Location, the gyro, and the magnetometer?"
* "How do I draw text around shapes?"
* "How do I use a Page View controller?"
* "How do I use a Page View controller?"

And so on. If you've asked yourself these questions, then this book is for you. The iOS Developer's Cookbook will get you up to speed and working with the iOS SDK, offering you ready-to-use solutions for the apps you're building today.
And so on. If you've asked yourself these questions, then this book is for you. The iOS Developer's Cookbook will get you up to speed and working with the iOS SDK, offering you ready-to-use solutions for the apps you're building today.

<h3>What's the deal with main.m?</h3>
For the sake of pedagogy, this book's sample code usually presents itself in a single main.m file. This is not how people normally develop iOS or Cocoa applications, or *should* be developing them, but it provides a great way of presenting a single big idea.

It's hard to tell a story when readers must look through 5 or 7 or 9 individual files at once. Offering a single file concentrates that story, allowing access to that idea in a single chunk.
These samples are not intended as stand-alone applications. They are there to demonstrate a single recipe and a single idea. A main.m file with a central presentation reveals the implementation story in one place.
These samples are not intended as stand-alone applications. They are there to demonstrate a single recipe and a single idea. A main.m file with a central presentation reveals the implementation story in one place.

Readers can study these concentrated ideas and transfer them into normal application structures, using the standard file structure and layout. The presentation in this book does not produce code in a day-to-day best practices approach. Instead, it offers concise solutions that you can incorporate back into your work as needed.
Readers can study these concentrated ideas and transfer them into normal application structures, using the standard file structure and layout. The presentation in this book does not produce code in a day-to-day best practices approach. Instead, it offers concise solutions that you can incorporate back into your work as needed.

Contrast that to Apple's sample code, where you must comb through many files in order to build up a mental model of the concepts that are on-offer. Those samples are built as full applications, often doing tasks that are related to but not essential to what you need to solve, with many distracting flourishes. Finding relevant portions is a *lot* of work. The effort may outweigh any gains.
Contrast that to Apple's sample code, where you must comb through many files in order to build up a mental model of the concepts that are on-offer. Those samples are built as full applications, often doing tasks that are related to but not essential to what you need to solve, with many distracting flourishes. Finding relevant portions is a *lot* of work. The effort may outweigh any gains.

There are two exceptions to this one-file rule. First, application-creation walkthroughs use the full file structure created by Xcode to mirror the reality of what you'd expect to build on your own. The walk through folders may therefore contain a dozen or more files at once.
There are two exceptions to this one-file rule. First, application-creation walkthroughs use the full file structure created by Xcode to mirror the reality of what you'd expect to build on your own. The walk through folders may therefore contain a dozen or more files at once.

Second, standard implementation and header files are provided when the class itself is the recipe. Instead of highlighting a technique, some recipes offer pre-cooked class implementations and categories (that is, extensions to a pre-existing class, rather than a child class). For those recipes, look for separate .m and .h files in addition to the skeletal main.m that encapsulates the rest of the story.
Second, standard implementation and header files are provided when the class itself is the recipe. Instead of highlighting a technique, some recipes offer pre-cooked class implementations and categories (that is, extensions to a pre-existing class, rather than a child class). For those recipes, look for separate .m and .h files in addition to the skeletal main.m that encapsulates the rest of the story.

<h3>How to build these projects</h3>
You should be able to build these projects for the simulator or use your team provision to build and deploy to devices. Before compiling, make sure you select a deployment target using the pop-up menu at the top-left of the Xcode window.

For the most part, the samples for this book use a single application identifier, com.sadun.helloworld. This book uses one identifier to avoid clogging up your iOS device with dozens of samples at once. Each sample replaces the previous one, ensuring that SpringBoard remains relatively uncluttered. If you want to install several samples at once, simply edit the identifier, adding a unique suffix, such as com.sadun.helloworld.table-edits. You'll want to edit the display name so you can tell instantly which project is which. Samples use the same icons and launch images as well.

<h3>License</h3>

Code is under BSD License. See [LICENSE](../blob/master/LICENSE).