iOS Keyboard Dismiss

One of my biggest pet peeve when it comes to iOS is how the keyboard stays on screen by default. Basically, when you add a TextField the keyboard pops up and won’t go away. Pretty much every app out there has the keyboard dismiss if you tap outside of it. Yet the default is to leave it there. I’ve seen a lot of different ways to deal with this but the easiest I’ve found is to add the following to the AppDelegate....

June 30, 2016 · John

iOS Money TextField

Most financial apps at some point need to have a user input a monetary amount. A very common way this is handled is a widget that accepts only numeric input. As the user types, it adds the given digit to the cents field. For example, the user types 1 and it displays $0.01. Then they press 2, and the field changes to $0.12. Each number is appended to the string. Basically, this is implied decimal with a very nice presentation....

May 11, 2016 · John

iOS App Install Request in App

Recently I was faced with an issue where I was writing an app that could call another app using iOS’s URL scheme. An issue I ran into was how to handle the calling app not being installed. Basically, when openURL failed, I needed to ask the user if they wanted to install the app. It is possible to use canOpenURL before calling openURL but there isn’t a need to because openURL will fail, just like canOpenURL will return NO....

April 10, 2016 · John

iOS Activity Overlay

I was recently working on an iOS project and was implementing a login view. As usual, the user enters their credentials, the credentials are sent to a server for verification and, if successful, the user is allowed into the app. The problem I ran into is that the asynchronous account validation leaves the user on the login view where the user could press the login button again, causing another login request....

March 18, 2016 · John