Learn how to take a disaster of nested stack views and untangle it into a great user interface.
Sliders as Knobs
You've seen other apps rotate views, but you may have no idea how to do it yourself. Let me show you one way to rotate views. We'll make a simple knob control you might be able to use in your apps. Download the example file. On the storyboard, I added an UIImageView of a knob …
Protocols and Time Pickers
While there is the date components picker, sometimes you want a picker the gives a time interval in seconds. In this two-part tutorial, Let me show you how to set up one, and discuss some good uses of protocols beyondself If you download the exercise files, you’ll see I set up a project with two …
CALayer Masks
UI doesn't have to look like a rectangle. You might want a different shape for your icon. You can do that with layer masks. Let's learn how to set them up. Download the example files. You'll find an app with two square buttons. If you head over to the assets, you see I have a …
Draw Paths in UIViews
In a previous tip, I drew rectangles and circles in a UIView. This time, let's add lines and curves using paths to draw some toast. Download the playground I set up for you. I set up my code to do all the drawing in the drawLines method. Go to the closure. I set up a …
Make A Toggle Button
Sometimes you need a control that doesn't yet exist. For example, the UISwitch control is far from customizable. I'd like a toggle switch that looks more like an old-fashioned switch or pushbutton. Let's learn the basics of making your own controls by making a UIButton into a toggle button. Open the example file. You'll find …
Embed Table Views
Here's an app I started from the downloaded example file. It is a restaurant check with a total, but I have to press the Order button to see the details in a table view on the next view controller. That button is a waste of real estate, and it would be nice to see the …
Layout iPad Landscape and Multitasking Apps
Note:You can find a video of this tip here on LinkedIn Learning If there's one thing in auto layout that drives me nuts it is laying out for landscape different than portrait on an iPad. Phones are easy since the class sizes are different for portrait and landscape. For all phones, if I have a …
Continue reading "Layout iPad Landscape and Multitasking Apps"
Recursion and UIView Changes
One powerful, yet sometimes rightfully feared programming technique is recursion. Many do not even use it, some don't know what it is, but when working with hierarchies, you really have to use it. Let's take a look at recursion and apply it to a common UI case where you need it. Download and open the …
Make Round Buttons and UIViews
In the good old days, Apple used a lot of rounded corner buttons. Many developers use several images to get the effect of round buttons. The CALayer of UIButton does have a feature for you to easily get rounded corners, and even circular buttons. Download the code from GitHub and open the starter file. It …