iOS Project #2

raj
2 min readNov 9, 2015

This series showcases various experiments in iOS programming. The purpose is to learn and to share it with others.

Today, we take the project built yesterday and add another login screen to it. We are going to add bold colors to it and going to use AutoLayout to place the different views.

Again, we are going to use the views from UI OH MY as inspiration.

Please note that all UI will be created using code without using interface builder or storyboards. AutoLayout features are also written in code. The app is written using the Swift language. You can download the project from github with the link provided below.

Final Result

Tricky Issues

  • Make sure to set translatesAutoresizingMaskIntoConstraints to false of the views that you are trying to arrage using AutoLayout. This was an option that Apple used earlier to arrange views. When this is not set to false, you will see some weird errors with respective to AutoLayout in your console.
  • If you need to specify custom colors using RGB values, you need to initialize UIColor object with the custom colors as follows, e.g. if your RGB value is 255, 25, 64, you will initialize the object as,
customColor = UIColor(red: 255.0/255.0, green: 25.0/255.0, blue: 64.0/255.0, alpha: 1.0)

Thats it.

You can download the project files from its github repository.

You can follow me on twitter.

--

--