Basic animation, Auto Layout, and view geometry – Part 2

[Download the full Xcode project from GitHub.]

In this series of posts, “Basic animation, Auto Layout, and view geometry – Part X,” we’re learning about basic animation in several steps. In yesterday’s post, “Basic animation, Auto Layout, and view geometry – Part 1” we covered setting up a storyboard scene using Auto Layout. Today, we’ll be using some basic UIView geometry to play with shapes and sizes. Tomorrow, we’ll be writing the code to explore iOS animation capabilities. I’ll be writing code in Swift 3.0, then later providing Objective-C versions. I’ll make all the source code available to y’all on GitHub as we move forward.

NOTE: The iOS skill level required herein is “beginner” to “intermediate.” One of the purposes of this blog is to help aspiring new iOS developers get started on the right foot. For all you seasoned (or “advanced”) developers out there, I encourage you to stick with this blog as we’ll be covering very complex iOS scenarios too. Everyone can benefit from these articles, including myself, by getting your feedback.

So what’s this stuff I call “basic UIView geometry?” All user interface components, like UIView’s and UIButton’s, must be positioned on an Apple device’s screen. They’re also objects that occupy space, so they have width and height. In order to position user interface components properly on screen, you use Auto Layout, which boils down to a series of geometric equations called “constraints.” According to Apple, “The layout of your view hierarchy is defined as a series of linear equations. Each constraint represents a single equation. Your goal is to declare a series of equations that has one and only one possible solution.” Let’s make this all more concrete and define two terms you’ll always need to know.

Continue reading “Basic animation, Auto Layout, and view geometry – Part 2”

Basic animation, Auto Layout, and view geometry – Part 1

[Download the full Xcode project from GitHub.]

We’re going to learn about basic animation in the next few series of posts, “Basic animation, Auto Layout, and view geometry – Part X.” In order to perform animations, we need to lay the foundation for a simple app. We’ll be 1) setting up a storyboard scene using Auto Layout (this post), 2) using some basic UIView geometry to play with shapes and sizes (Part 2), and 3) writing the code in Swift and Objective-C to explore iOS animation capabilities (Part 3). After Part 3, we’ll start solidifying all the concepts you’ve learned in this series, tie all these concepts together, and come to the realization that these concepts will be indispensable in almost all your iOS development efforts. I’ll make all the source code available to y’all on GitHub as we move forward.

NOTE: The iOS skill level required herein is “beginner” to “intermediate.” One of the purposes of this blog is to help aspiring new iOS developers get started on the right foot. For all you seasoned (or “advanced”) developers out there, I encourage you to stick with this blog as we’ll be covering very complex iOS scenarios too. Everyone can benefit from these articles, including myself, by getting your feedback.

Create a new Xcode 8.x project, selecting a Single View Application, naming the project “Animation Demo,” filing out all the required new project fields, selecting “Swift” as the Language, and setting “iPhone” for Devices.

Continue reading “Basic animation, Auto Layout, and view geometry – Part 1”

2016: A good year to be an iOS app developer (and how to become a better one)

It can be good to be an iOS app developer, but not easy to be a great one (we’ll talk about that later in this article). There are many opportunities for app programmers looking to work as employees for companies. There are plenty of opportunities for developers who prefer freelancing. It’s frustrating, trying to come up with novel apps that generate any significant revenue, when it seems that every idea under the sun has already been turned into an app by “someone else.” Apple continues to push out buggy versions of iOS, the iOS SDK, and Xcode — especially in early versions of new products. Yet most of us would agree that Apple’s hardware and software, even their development tools, continue to be elegant and cutting edge. It’s hard to argue with the bottom line as “Apple App Store developers raked in $20 billion in 2016, up 40% year over year,” according to an article from CNBC:

Continue reading “2016: A good year to be an iOS app developer (and how to become a better one)”

The heartbreak of the Xcode “Undefined symbols for architecture xxx” linker message

As an iOS developer — or any type of software developer — you’re eventually going to run into linker errors. Sometimes they’re easy to fix (i.e., you’re missing an #include for a header file). Sometimes they’re crazy complex, subtle, and very difficult to solve. Today we’ll talk about some tools (file, otool) and techniques (setting library target hardware architectures) you can use for solving difficult Xcode linker errors.

Continue reading “The heartbreak of the Xcode “Undefined symbols for architecture xxx” linker message”

Using Xcode 7 with the iOS 10 SDK

Today, we’ll be discussing getting an older version of Xcode (7) to work with a newer version of the iOS SDK (10). When done reading this article, you’ll be able to build, link, install, and debug apps in/from Xcode 7 onto iPhones/iPads/iPods running iOS 10. (If you don’t need background, just skip to the solution.) The main reasons for doing this?

  • You have an app built for the last iOS version (9) that has a problem when running in the latest iOS version (10) and you’d like to debug the code; and/or,
  • Apple releases a new beta iOS (10) and beta Xcode (8), you want to see how your current, stable code (built for iOS 9) runs on the new beta iOS (10), but you don’t want to trash your current, stable Xcode (7) installation with the beta Xcode (8).

Continue reading “Using Xcode 7 with the iOS 10 SDK”

Installing multiple versions of Xcode (6, 7, 8) side-by-side, together on the same Mac

Let’s talk about cleanly installing multiple versions of Xcode (6, 7, 8) side-by-side, together on the same Mac desktop, MacBook Pro, or MacBook Air.

Apple keeps moving forward with new Xcode and iOS versions, but some of us in the developer community need the ability to support — or just experiment with — projects in older versions. I’m currently working on an iOS 9 app, developed in Xcode 7 that’s ready to be submitted to the App Store. At this eleventh hour, the last thing I want to do is go through the pain of upgrading to a new iOS SDK in a new Xcode version. I tried building the app and its constituent libraries in Xcode 8, and was presented with tens of compiler and linker errors. Oy… But I do need to to start moving the project to Xcode 8/iOS 10 — and start other projects, check out new features, and get up to speed…

Continue reading “Installing multiple versions of Xcode (6, 7, 8) side-by-side, together on the same Mac”

Welcome to iOS Brain

Stayed tuned as we get our infrastructure together. We’ll be publishing information, tutorials, news, tips, workarounds, reviews, etc., of all things iOS. Look for articles on developing iOS apps using Xcode, Interface Builder, Objective-C, Swift, Adaptive Layout, Auto Layout, and more. Related technologies like Git, BitBucket, GitHub, Photoshop, and Sketch will also be covered.

Don’t be surprised if we go off on tangents into subjects like object-oriented programming, debugging, Agile, Test-Driven Development, Continuous Integration, and more.

Thanks for checking in!

Continue reading “Welcome to iOS Brain”