The Startup
Published in

The Startup

iOS Development Fast Track

Since there is a handful amount of getting started articles, this will be my take on tips, tricks and tools that hopefully will speed you up into iOS development world.

Xcode

Xcode is the IDE used to develop native iOS apps. You can download it from App Store, but a faster way is to download it is from this link: https://developer.apple.com/download/more/

Tips:

  • To test apps on device, you need to add an Apple ID by going to: Xcode -> Preferences -> Accounts -> Click on “+” -> Apple ID
  • Fast way to configure developer account to be used with Xcode is after adding the Apple ID is to double click on the targeted team on the right panel, click on “+” then select “Apple Development” to generate the development certificate or “Apple Distribution” to generate the production certificate to be used when uploading to store or TestFlight
  • Sometimes, when you run into problems building the app with cleaning the build folder, you can delete the derived data linked to the project from this folder “~/Library/Developer/Xcode/DerivedData” (it is always safe to empty this folder, especially if you run into storage shortage with your mac as it may consume a lot of storage space if you are building multiple projects)
  • You can enable wireless device debugging from: Window -> Devices and Simulators -> Select desired device -> check “Connect via network”

Code Structure

While you can have any structure / architecture, it is recommended to use the MVVM architecture in mobile development. My take on this is as follows.

Folders

First level, we have 2 main folders that separates the code from the UI as follows:

  • Classes: where we place all the code
  • Resources: where we place all the UI related stuff like Storyboards, XIBs and Assets

Inside Classes we have the following folders

  • Core: app level classes / helpers that are core in any app. These are the back-bone of the app and require few or no change when moved to another project. It can include the networking helpers for REST APIs, extensions and configurations.
  • Convenience / Utilities: similar to Core, but these are project specific helper classes.
  • Controllers: the ViewControllers (split into sub-folders based on business logic for big projects).
  • Managers: the classes that manages the logic / actions in the app. These are mostly singleton classes.
  • Views: classes for the reusable like UICollectionViewCells or UITableViewCells
  • Models: the model classes
  • ViewModels: classes responsible from filling out the views from models

Inside Resources we have the following folders

  • Assets: stores the media files used in the app like images / icons.
  • XIBs: the XIB files
  • Storyboards: the storyboards (it is recommended to break up the project into multiple storyboards based on business logic since having large storyboards may cause performance issue when opened)

Classes

Here are the list of basic classes needed

  • Core/Config: struct storing all the configuration settings like important IDs or list of Rest API paths
struct Config {
static let pageCount = 30
static let baseURL = "https://jsonplaceholder.typicode.com/"
struct Url {
static let albums = "albums"
static let photos = "albums/%d/photos"
}
}
  • Core/API: the middleware class for handling the http requests. It is important to use a middleware class that can append and needed business logic (like authentication header) before performing the request and that can properly handle errors.
  • Core/Appearance: global appearance settings. Here is where we use the UIAppearance methods to customize the global appearance for any UI element.
  • Convenience/UserDefaultsManager: handles the read / write operations from / to UserDefaults
  • Convenience/NavigationManager: list of methods for initializing and showing the view controllers

ViewControllers

Use same logic order and naming convention across the project, my take on this is that I place them in the following order

  • IBOutlets
  • Private properties
  • Public properties
  • View Controller life cycle methods
  • Functions
  • IBActions
  • DataSource / Delegate (recommend separating these by implementing them inside an extension of the view controller)

Tips

  • Always design your reusable table view or collection view cells inside XIBs instead of storyboard
  • Use multiple storyboards instead of one for the whole project
  • All new projects generated have dark mode enabled by default, to disable it you need to set the “Appearance” to “Light” in info.plist
  • All new projects generated support iOS 13+ versions, to support prior versions you need to set the minimum version in project settings, add property “var window: UIWindow?” in AppDelegate and make SceneDelegate only available on iOS 13 + by adding “@available(iOS 13.0, *)”

Libraries

There are a lot of great libraries that you can use to speed up your work. The following link have a compiled categorized list of the best libraries out there: https://github.com/vsouza/awesome-ios

and below is my short list of the most essential libraries:

I tried my best to highlight most of the essential information needed for any engineer wants to get onto the iOS developer track beyond the getting started stage.

This was my first published article, hope you find it useful and I would be glad to hear your feedbacks.

Feel free to add me on LinkedIn or reach me at https://ramitabbara.io/

--

--

--

Get smarter at building your thing. Follow to join The Startup’s +8 million monthly readers & +756K followers.

Recommended from Medium

Possible iOS App experience improvements from a Developer’s perspective: Background fetching in iOS

ViewPager Fragment navigation On Back button, (same as instagram navigation)

A Look at CurrentValueSubject in Swift

Warhol II: Compose your Overlay on Top of the Detected Face Hassle-Free for iOS

Bring your old iOS Library back to Life in just few easy Steps

Swift Property Wrappers, User Defaults and Unique Default Values

Retrieve Default Remote Config Values at Compile Time

Best Way To Structure Your Xcode Project

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rami Tabbara

Rami Tabbara

Senior Web & Mobile Engineer / UX Design Expert

More from Medium

iOS Dev: Difference between frame and bound, the easiest explanation you can find nowhere

Improving Swift Code Readability With SwiftLint

What Are iOS App Lifecycle Methods

Reduce iOS App Launch Time