5 best practices in iOS app development to follow

11 min read
March 16, 2023

In 2020, Apple rejected a record 1 million apps from the Apple App Store.

Some rejections were due to fraud or blatant copies of other apps. But in most cases, the decision to turn an app down has to do with app quality.

Apple takes the iOS app experience seriously—and for a good reason. A well-designed app is a great way to engage your users, retain them, and improve your monetization efforts.

Luckily, there are certain best practices you can implement to help you create an iOS app that will satisfy both Apple and your users.

We go into five of them in this article.

Decide on a suitable architectural pattern

An architectural pattern defines how the app logic is divided into components. The goal is to make app development and maintenance much easier.

A simple example is to separate the app UI from its internal code. That way, you can develop, test, and update them independently.

There are various types of mobile app architecture, from N-tier to monolithic. But in iOS development, you’ll most likely encounter three: MVC, MVP, and MVVM.

Each of these types of mobile app architecture has different advantages and drawbacks that you need to consider, depending on the nature of your project.

Let’s go through them briefly, to help you decide.

The first is MVC, which separates the app into three major parts—the Model, View, and Controller.

MVC mobile app architecture

Source: Guru99

The Model is responsible for the data and business logic, such as extracting data from a database and then processing it. It acts as the brain component of the app.

The View is concerned with presenting the data to the user. It’s where the user interface (UI) is located.

This component is also responsible for getting user input and passing it to the Controller.

The Controller is the link between the Model and View components.

It receives (and sometimes validates) input from the user, alerts and passes it to the Model, then updates the View to reflect the changes.

The MVC is straightforward and simple to understand, which makes it the go-to choice for simple apps.

However, the big drawback of MVC is that it requires neatly classifying any code into either of the three categories—which isn’t always possible.

This ends up overloading one or two components in large, complex apps.

Next is the MVP architecture, which comprises the Model, View, and Presentation components.

MVP is, for the most part, similar to the MVC architecture, as you’ll see below:

MVC vs MVP mobile app architecture

Source: GitHub

But there are subtle differences between the two that set them apart.

The most critical is that MVP is more loosely connected than MVC.

In MVC, the Model can communicate directly with the View and ask it to display changes. But in the MVP architecture, the View has no knowledge of the Model.

Everything is coursed through the Presenter component (the Controller counterpart in MVP).

Thus, the MVP is more flexible and modular than MVC. You can easily develop, maintain, and update the components independently. Because of this, MVP is more suitable for larger apps.

Another type of architecture is the Model-View-ViewModel (MVVM), which the DECODE team favors.

Here’s why.

Model-View-ViewModel mobile app architecture

Source: Tech Target

Like MVP and MVC, MVVM also includes the Model and View components.

However, the MVVM version of the View component is passive—it can’t change the UI directly.

That responsibility is passed to data binders, which act as the bridge between the View and ViewModel components.

Thus, MVVM is more modular and easier to maintain than MVC and MVP.

In our view, it’s the best approach for very complex apps because it allows you to organize code into smaller, more manageable chunks.

The last architecture we’ll briefly cover is VIPER, an acronym that stands for its five components—View, Interactor, Presenter, Entity, and Router.

VIPER mobile app architecture

Source: GitHub

The View is the UI component, displaying data and sending user inputs to the rest of the architecture.

However, it doesn’t handle app navigation (which screens should be shown). That’s the responsibility of the Router.

On the backend, you have the Entity, which handles all the data operations like database retrieval. The Interactor contains all the application logic.

And tying everything together is the Presenter, which calls on the other components and passes input/output to them.

As you can see, the VIPER is very modular and well-divided, making it a good choice for apps with many moving parts.

However, because of the sheer number of components, VIPER development can also get complicated.

No doubt you have many choices with your app architecture. It’s important to realize that all of them are viable in the right situations.

You just need to look at the unique needs of your project to make the right decision.

Use the recommended technologies

Apple is known for implementing tight control over its entire ecosystem.

iOS development isn’t any different, as Apple has a list of tools and technologies it strongly recommends developers use. And although Apple isn’t as strict with this, it’s best to comply.

After all, it’s for a good and simple reason—quality.

Using Apple’s recommended technologies gives you a better chance of developing a high-performing, compliant app.

It’s especially handy once you publish your app in the Apple App Store (more on that later).

Plus, it makes iOS development easier, as everything you’ll ever need is already provided.

So what are some Apple recommended technologies?

Two that you must absolutely start with are the iOS SDK and XCode, the official Apple integrated development environment (IDE).

XCode interface

Source: Apple

The iOS SDK includes all the relevant libraries for developing iOS apps. For instance, it contains functions for handling touch controls or using the accelerometer.

On the other hand, XCode provides an intuitive environment to create your apps. It also has powerful debugging and extensive documentation.

Plus, you’ll get support from Apple when you encounter problems.

iOS apps also have their own programming languagesSwift and Objective-C.

Of the two, Swift is recommended because it’s easy to use yet powerful. Performance-wise, it’s also 2.6 times faster than the older Objective-C (and, interestingly, 8.4 faster than Python).

Swift vs Objective-C syntax

Source: AltexSoft

You shouldn’t also build your app’s user interface from scratch. Instead, utilizing UIKit and SwiftUI—Apple’s official user interface frameworks—is best.

Both offer ready-made UI components, storyboards, drag-and-drop capability, and other features to help you quickly assemble UIs in shorter periods.

These are just the basics. You can also use other recommended libraries and frameworks, such as the ones we use at DECODE.

DECODE iOS development languages, libraries and frameworks

Source: DECODE

These libraries and frameworks make iOS development much cheaper, easier, and faster—so why not use them?

Focus on writing clean code

Clean code refers to code that is well-organized, consistently structured, and easy to understand.

It should be a top priority when developing iOS apps (or any software, for that matter).

You’ll be surprised that software development is more about reading code than writing it.

Indeed, American engineer Robert Martin, the author of Clean Code: A Handbook of Agile Software Craftsmanship, says:

The ratio of time spent reading versus writing is well over 10 to 1. We are constantly reading old code as part of the effort to write new code. […] Therefore, making it easy to read makes it easier to write.

Readable code makes your code easier to handle, which could lead to a better app overall.

It enables you and other developers to focus on what the code is saying instead of struggling to understand it.

There are several ways to write clean iOS code. The simplest is to follow the coding standards for Objective-C and Swift.

You can check several style guides, like this one, that focuses on code readability.

A crucial part of this is relying on naming conventions for variables and components.

Here’s an example:

iOS development naming conventions

Source: Devopedia

Using these prefixes allows the reader to know at a glance what an object in the code refers to instead of deducing it based on the context.

Can you imagine if a button variable was named xyz instead?

Another good approach is to use clean code principles, which are rules that facilitate code readability.

Three popular principles are YAGNI, KISS, and DRY, which can be applied sequentially to make your code increasingly simple.

YAGNI vs KISS vs DRY code principles

Source: Jayakrishna Ganjikunta

YAGNI (which stands for You Aren’t Gonna Need It) says that you shouldn’t add anything unnecessary to the code.

To do this, you should only add codes, libraries, or third-party tools when you actually need them, not when you think you’ll do.

KISS (or Keep It Simple, Stupid) mandates that code be simple. It would help if you tried the most straightforward algorithm or routine when writing code.

Lastly, DRY (or Don’t Repeat Yourself) focuses on reusability and automation. It advises getting any redundant code and packaging it into a function or class that can be reused.

If you adhere to these principles when writing your code, it is sure to be clean and intelligible.

Follow Apple’s Human Interface Guidelines

Human Interface Guidelines (HIG) are design principles and best practices set by Apple when designing iOS apps.

It covers every aspect, including typography, layout, navigation, UI components, color, and accessibility.

For example, HIG states that a button’s size and style should help show your app’s content hierarchy.

Large, filled buttons are best reserved for the primary action in the current app screen.

HIG button size guidelines

Source: Apple

The goal of HIG is to provide a universal guideline that ensures all iOS apps are intuitive, accessible, and visually consistent.

Following it is thus highly recommended, as it removes most of the guesswork in app design.

HIG can also help make your app more accessible to people with visual or hearing disabilities, representing a significant portion of your user base.

For instance, one survey suggests that up to 70% of visually-impaired people use a screen reader with a mobile phone. HIG can help you reach these users.

Finally, HIG is one of the major factors in App Store approval.

Apps that don’t follow HIG are perceived as having low usability and quality and could therefore be rejected by Apple’s app review process.

Be compliant with App Store guidelines

The Apple App Store is notorious for having one of the most rigorous review processes in the industry.

To ensure your app passes, you must ensure it conforms to Apple’s App Store Review Guidelines—a set of safety, performance, business, design, and legal requirements every iOS app must meet.

We discussed following Human Interface Guidelines as a good reason to improve your chances of approval. But that’s just one of many factors in the review process.

One of the areas Apple looks at is performance. Apps that crash frequently or have long load times are signs of poor performance that negatively affect the user experience.

Safety is also a critical issue. Apps with minimal cybersecurity measures like encryption or authentication will likely be rejected.

Likewise, a lack of a privacy policy can cause your app to fail the review process.

Apple App Store privacy policy

Source: DECODE

Finally, any signs that the app is incomplete will also cause it to fail a review.

This includes incomplete metadata, placeholder content (such as “lorem ipsum” text), and broken links, among other things.

For an extensive list of other reasons that could warrant app store rejection, you can check out our article here.

Need more help developing your iOS app?

We hope these five best practices can help you create excellent iOS apps that deliver fantastic user experiences.

However, even the best tip is useless if it’s not implemented by a capable developer. That’s why the best practice is still hiring the right development team for your project.

And we think DECODE is that team.

With dozens of successful iOS apps under our belt and a pool of 70+ experts, DECODE can help your next project succeed.

Interested? Contact us today to schedule a FREE consultation.

Categories
Written by

Toni Vujevic

React Native Team Lead

Skilled in React Native, iOS and backend, Toni has a demonstrated knowledge of the information technology and services industry, with plenty of hands-on experience to back it up. He’s also an experienced Cloud engineer in Amazon Web Services (AWS), passionate about leveraging cloud technologies to improve the agility and efficiency of businesses. One of Toni’s most special traits is his talent for online shopping. In fact, our delivery guy is convinced that ‘Toni Vujević’ is a pseudonym for all DECODErs.

Related articles