Giter Site home page Giter Site logo

auto-layout-demystified's Introduction

Auto-Layout-Demystified

Welcome to the source code repository for Auto Layout Demystified. Sample code is never a fixed target. It continues to evolve as Apple updates its SDK and the CocoaTouch libraries. Get involved. You can pitch in by suggesting bug fixes and corrections as well as by expanding the code that's on offer.

Github allows you to fork repositories and grow them with your own tweaks and features, and share those back to the main repository. If you come up with a new idea or approach, let me know. My team will be happy to include great suggestions both at the repository and in the next edition of this book.

About the Book

Auto Layout Demystified is written for experienced developers who want to build constraint-based interfaces. It helps to be already be familiar with Objective-C, the Cocoa frameworks, and the Xcode Tools.

What's the deal with main.m?

For the sake of pedagogy, this book's sample code usually centers around 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 many individual files at once. Offering a single file starting point concentrates that story, allowing access to that idea in a single chunk.

How to build these projects

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.

The samples for this book use a single application identifier, com.sadun.helloworld. This book avoids 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.

"Some feature does not work on OS X"

As the book title says, this is an iOS-specific work. I've included OS X support wherever possible. I do know that I caught one big bug in the later chapters that hasn't propagated back to the early ones. If you deploy to OS X and encounter an error with UIViewNoIntrinsicMetric, please add the following:
#ifndef UIViewNoIntrinsicMetric
#define UIViewNoIntrinsicMetric -1
#endif

If you find any stray UIKit includes (I tried to smite those I found), please let me know and I'll try to update as well.

auto-layout-demystified's People

Contributors

erica avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

auto-layout-demystified's Issues

a mistake in Chapter 3?

second edition
Chapter 3, Page 72
in the table of IB Element description,the second last row,last paragraph,it says"The Container variation of each command (found at the bottom of the resolution menu) generates constraints for the entire scene, not just the selected view." However,I just can not find where the Container variation is.I just guess it should be View Controller or its view instead.Any help will be appreciated.

Downloading code

I can not download the files from here it starts it downloads like 299.1mb den it stops there i have tried many times but still the same problem

Unexpected Interface Name

I'm getting a compiler error on the Constraints.h file when I try to call the MATCH_HEIGHT(FROMVIEW, TOVIEW) macro. It's coming from the _INSTALL_CONSTRAINTS(PRIORITY, NAME, ...) macro. It doesn't recognize NSArray. I even tried importing Foundation at the top of the header, but that didn't work.

Any ideas on what I'm doing wrong here?

No images

There are missing files in folder National Park Service Images of PagedImageScrollView (2 edition - C07 - 6). Looks like they was not copied to a project folder.

some mistakes?

chapter 3,exercise 8 answer
8. Describe the results the constraint @"H:|-(-20)-[view1(==50)]" produces.
The view’s height is constrained to 50 points. It’s placed 20 points above the top of the
view. Only the bottom 30 points of the view extend within its superview.

This statement maybe incorrect,"It’s placed 20 points above the top of the
view"。Because the placement of the view is unknown until it has been constrainted already.

chapter 7 p213 the first paragraph below the title,"Table Cells"。
“You see an example of the playback indicator on the fourth row of the table.”
it seems the correct statement is,"You see an example of the playback indicator on the second row of the table."

Directly modifying layer properties on layer backed views

Hi Ericka,

I have a question regarding this code:

I thought you should not change directly layer properties unless you are doing it in updateLayer method. But perhaps I'm missing something. Can you please clarify it to me?

Thank you in advance :)

Patryk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.