Using CAShapeLayer to draw a circle

UIViews are like Ogres, which are like onions – they have layers. Source: Documentation More accurately, UIView has a single layer property that can have infinite sublayers. UIView’s have layers Lets draw a circle. First create a UIView and a CAShapeLayer: let myView = UIView() let myLayer = CAShapeLayer() Layers have a path UIBezierPath makes drawing shapes…

iOS Application Lifecycle – UIKit basics

iOS applications are all about cycles This is because the iOS applications are richly interactive when it comes to user input and much of your programming with UIKit will be delegate oriented. Knowing the many different “cycles” of the device and application will be illuminating for your development. States of the UIKit App Cycle * These are the…

iOS without storyboard

Why? Programmatically/Code or NIB based layouts are a much better fit for projects that use version control (see merge conflicts) and make it much easier to reuse views. If you are deciding not to use storyboards, you will need to manually set your application window to your desired UIWindow Prerequisites: – Delete Main Interface from Deployment…

Forgetting to set translatesAutoresizingMaskIntoConstraints to false

UIKit on iOS is great! There are tons of tools and often this can supercharge your productivity for getting a prototype out into the world. Additionally, working with AutoLayout programmatically can be great if you avoid these rookie mistakes. Rookie Mistake 1: It hurts when you spend hours dealing with the rookie mistake of forgetting to…