In this article I listed 5 most common missteps while starting iOS application. Typically beginners might have taken these approaches.
1. Internet connectivity status checking over response error :
It is essential to check network connectivity status offline or online before starting services.
To test reachability you might wrote in response callback :
Problem: Time consuming in case URL takes tool long to respond. More over you cannot rely on server to check connectivity. Simply because server may be down at the moment you sent request.
Solution: Use Apple’s Reachability class. It can monitor network status of WiFi or Cellular data instantly. Notifies in case network status changes. Bonus - Also make sure app works in iPv6 network as well.
2. Textfield behind keyboard :
Credit : Stackoverflow.com |
We start developing app in Xcode and run in Simulator. By default keyboard preference of simulator is hidden and we kept using Mac keyboard for field input. Hence there is a chance of missing this basic feature before handing over to testing team.
Even the same issue seen when orientation change. Also fields are visible in iPhone Plus or XL devices and hidden in 4" iPhone 5/5S/5SE models. So it is better to have an eye on the keyboard and fields.
Solution : Make use of keyboard notifiers 'UIKeyboardWillShow' before appearing and 'UIKeyboardWillHide' before hiding.
In iOS 11 Apple has deprecated topLayoutGuide and bottomLayoutGuide properties and introduced the safe area layout guide. When you create new storyboard option is enabled by default. Left un-noticed for old storyboard or nib files and you know it will mess up UI in iPhone X and its successors.
Solution : Have a standard struct or class for entire app which will make sure consistency of font size, family and even colour codes.
For instance, below list is commonly I refer from Apple's Mail app.
3. Neglecting Safe area Layout :
In iOS 11 Apple has deprecated topLayoutGuide and bottomLayoutGuide properties and introduced the safe area layout guide. When you create new storyboard option is enabled by default. Left un-noticed for old storyboard or nib files and you know it will mess up UI in iPhone X and its successors.
Solution : You convert from top and bottom layout guides to the safe area layout guide by changing the setting in the file inspector for the Storyboard. Apple suggests that we do not to place any controls outside safe area.
4. Inconsistency Font, Colour throughout app :
Typically when a team collaborating on app development, individual developers consider own font size or colour code (worst case) on their assigned screens. This questions maturity of app.Solution : Have a standard struct or class for entire app which will make sure consistency of font size, family and even colour codes.
For instance, below list is commonly I refer from Apple's Mail app.
- Bold title - 34pt
- Body text - 17pt
- Secondary text - 15pt
- Tertiary text - 13pt
5. Hardcoded view frames :
When we create custom views programmatically, we tend to create with custom frames. This might look at good shape upon running simulator or similar devices with size class. That might not true in Plus sized iPhones or vice versa.
Solution : Use 'Autolayout constraints' in necessary places. Make sure constraints added initialisation stage and full layout life cycle to be executed In case post modification of view frame. This article might help to get more clarity.
That's all about few check points to be consider while starting your iOS application. Comment if you taken such wrong approaches and then found correct way to implement same.