iOS development trends

28 Jun 2019


Every time we speak or hear about Apple, we understand that every Apple product is in trend. More and more people start using Apple devices and Apple fans (and opponents) keep track of the emergence of new Apple trends. So, what are they?

Talking about iOS trends, we may mention such apps trends as IoT (Internet of Things), VR and AR, Apple Pay, Enhanced Security, and Wearable Devices. But we think it should be clear enough for apps’ users, if no, read our article about mobile apps development.

We would like to pay your attention to the traditional UI and how it builds with .storyboard vs. .xib, and the trend in UI  – Swift UI Design: what is new and how important is UI UX Design in an App Development Process?

One of the most passionate topics among iOS developers is “How to create the application user interface?” We have two different groups: the first are those who love creating a GUI in the Interface Builder, and then those who hate it and prefer doing it through code. An experienced developer would say that there is no silver bullet because each of the approaches has its pros and cons. One of the goals of this article is to help you make the best choice for your project.

There are generally three ways to create a user interface in iOS:

  • Storyboards – this is a visual tool for laying out multiple application views and the transitions between them (segues).
  • XIBs (or NIBs) – each XIB file corresponds to a single view element and can be laid out in the Interface Builder, making it a visual tool as well. Just note that the name “XIB” is derived from the file extension (previously .nib and now .xib).
  • Custom code – no GUI tools are used, but rather, all custom positioning, animation, creation, etc. are handled programmatically. We will consider SwiftUI.

iOS Storyboards

Storyboards are the latest addition to the iOS UI toolkit. They are announced as a revolution and replacement for XIBs and custom code UIs. And storyboards are a useful tool – but not so much an alternative, as much as they are a complement for XIBs and custom code. They are the right choice in some, but not all situations.

One developer said: “When I started to develop apps, I thought that storyboards are the only way to create a UI. And I like them a lot because I could see the whole design, easily change it, etc. But as an application grows, the storyboard becomes massive, slow, and unreadable. And this is a fundamental mistake. Because the storyboard loses its purpose and ends up looking like this:”

Applications should be divided according to logical units (stories) and each of them should have their storyboard. As its name implies, it is a board with a story to tell. It shouldn’t be used to mix unrelated stories into one significant volume. For example, a list of players and related functionality (adding, rating, etc.) can be one example of a logical unit. Then you can see the benefit of using storyboards:

Storyboards are preferred when:

  • We have views with dynamic content, where the layout changes significantly depending on the content.
  • We have views that are not easily designable in interface builder.
  • We have view controllers with complicated transitions.

Storyboards pros & cons

pros cons
visualization reusability (storyboards are very limited when you need to copy or move code, especially graphic elements because you need to move all of its dependencies)
rapid prototyping (because you can mock up the design, navigation flow and transitions of an application without writing much code) leading to merging conflicts (if you work with other developers on the same project, you will run into issues, because everyone’s modifying the same file)
it’s much easier to use auto-layout take care of handling the flow between view controllers, but not the flow of data.

 

XIBs

This is the “old-school way,” which doesn’t mean it’s terrible or deprecated. It represents only one specific view element (view, controller, table cell, etc.) – in other words, every view has its own .xib file. The advantage of this approach is that each component is easier to develop, easier to test, and easier to debug.

XIBs are preferred when:

  • We want to create reusable view templates.
  • We want to create reusable table cell templates.
  • Creating a pop-up window, modal views.

XIBs pros & cons

pros cons

reusability “prepare once use everywhere”

working with other developers on the same XIB can produce a lot of conflicts

the visual tool helps you see what are you making

harder debugging

easily use the auto layout option.

they are lazily loaded

 

SwiftUI

Apple has introduced the SwiftUI framework, a new set of tools and APIs for building user interfaces for any Apple device. Apple describes SwiftUI as a new paradigm for UI development with its Swift language that leverages a simple declarative syntax that makes code easy to write and understand.

SwiftUI provides a way to build interfaces across all Apple platforms, with one set of tools and APIs. The framework works with Xcode design tools to synchronize coding and designing. Support is provided for capabilities such as dynamic type, localization, and accessibility. Built with the Swift language itself, SwiftUI is available in the Xcode 11 beta IDE. 

Key features of SwiftUI include:

  • A declarative syntax for stating what a UI should do. For example, developers could specify that they want a list of items consisting of text fields, then describe alignment, font, and color for each field. The declarative style applies to concepts such as animation, as well, with developers able to add animation to nearly any control and choose a collection of ready-to-use effects in just a few lines of code. At runtime, the system handles the steps needed to create a smooth environment and deals with interruptions to keep apps stable.
  • Design tools from Xcode 11 provide for drag-and-drop UI building with SwiftUI. Changes to the UI are visible in preview as the developer types. Xcode recompiles changes and puts them into a running version of an app.
  • Developers can build one or many previews of SwiftUI views to get sample data and configure capabilities for users, such as large fonts, localization, or Dark Mode, a color scheme planned for iOS 13.

SwiftUI pros &cons

pros cons

performance

Prototyping (it’s difficult to imagine (visualize) how a layout looks until you see it on screen)

reusability

layout changes can’t be applied that fast

you get more control over layout and you can easily customize elements

the layout can’t be implemented so easily

resolving merge conflicts is much easier

it takes much more time to understand how things work


Summary

Although all approaches are different and each one has pros and cons, if you are familiar with them and use them together in projects, you can save your time, nerves and at the same time build great apps. So, we can be thrilled that we have different tools for building UIs. With code, you can do everything that’s possible, and with the other two, you can see the flow and basic design of the app more easily. The conclusion then, as with many other things in programming, is to analyze your specific requirements in advance and make a decision about which approach will make the most sense for the project you are working on, and go with that.

 

Contact Us

Attach files