0% found this document useful (0 votes)
114 views2 pages

Best Practice iOS Development

This document provides best practices for iOS development including using SwiftUI for cross-platform apps, Combine over RxSwift for processing values over time, and Swinject for dependency injection to reduce boilerplate code. It also recommends using SwiftLint for code formatting, UIPilot for SwiftUI navigation, SQLite and Alamofire for local database and networking needs, and Kingfisher and CocoaLumberjack for image loading and logging. Additional tips include using feature flags, MVVM architecture, modularizing the app by feature, UserDefaults and SwiftKeychainWrapper for secure storage, measuring code coverage with Slather or Xcode, unit testing with XCTest, UI testing with EarlGrey 2.0, automating

Uploaded by

Franco Paredes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
114 views2 pages

Best Practice iOS Development

This document provides best practices for iOS development including using SwiftUI for cross-platform apps, Combine over RxSwift for processing values over time, and Swinject for dependency injection to reduce boilerplate code. It also recommends using SwiftLint for code formatting, UIPilot for SwiftUI navigation, SQLite and Alamofire for local database and networking needs, and Kingfisher and CocoaLumberjack for image loading and logging. Additional tips include using feature flags, MVVM architecture, modularizing the app by feature, UserDefaults and SwiftKeychainWrapper for secure storage, measuring code coverage with Slather or Xcode, unit testing with XCTest, UI testing with EarlGrey 2.0, automating

Uploaded by

Franco Paredes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Best Practice iOS Development.

1. Use SwiftUI —SwiftUI helps you build great-looking apps across all Apple platforms with
the power of Swift — and as little code as possible. With SwiftUI, you can bring even
better experiences to all users, on any Apple device, using just one set of tools and APIs.

2. Choose Combine over RxSwift— A framework that provides a declarative Swift API for
processing values over time. These values can represent many kinds of asynchronous
events.

3. Use Swinject for dependency injection — A lightweight dependency injection


framework for Swift that reduces the boilerplate of doing manual dependency injection in
your project.

4. Use SwiftLint for Code formatting — A tool to enforce Swift style and conventions,
loosely based on the now archived GitHub Swift Style Guide. It enforces the style guide
rules that are generally accepted by the Swift community.

5. Use UIPilot for easier SwiftUI navigation — Handle complex SwiftUI navigation very
easily and reliably with UIPilot.

6. Use SQLite library for local Database — The better approach for data persistence and
also works as a lightweight, Swift-friendly wrapper over the C API.

7. Use Alamofire for Networking — A swift-based, HTTP networking library to simplify


common networking tasks. Its features include chainable request/response methods,
JSON and Codable decoding, authentication, and more.

8. Use Kingfisher for Image loading — A powerful, pure-Swift library for downloading and
caching images from the web in swift. SwiftUI provides its own AsyncImage view that
asynchronously loads and displays an image from API.

9. Use CocoaLumberjack for logging — Do better logging using CocoaLumberjack which is


a fast & simple, yet powerful & flexible logging framework for macOS, iOS, tvOS, and
watchOS.

10. Coding with Feature Flags — To be able to keep shipping the app while features are
still in development, use feature flags. Feature flags will allow teams to have multiple
variants of the app that can be managed by just a few flags and will save you from having
GIT branch hell.

11. Use MVVM architecture — The perfect solution for all the drawbacks of MVP and
MVC, which makes code testable, more decoupled, and easy to maintain which is a widely
used design pattern for architecting software applications. MVVM architecture also plays
very nicely with SwiftUI.

12. Modularize your app by feature — Faster build, reduce boilerplate code, smaller and
maintainable modules, fewer circular dependencies, easier navigation, separation of
responsibility, and many more benefits…

13. Use UserDefaults to store plain key-value pairs —An interface to the user’s defaults
database, where you store key-value pairs persistently across launches of your app where
the value data could be String, Integer, Boolean, or any type of Object.

14. Use SwiftKeychainWrapper to store secured key-value pairs — A simple wrapper for
the iOS / tvOS Keychain to allow you to use it in a similar fashion to User Defaults. Written
in Swift which provides a singleton instance that is set up to work for most needs.

15. Always measure your Code coverage —You can either go for a built-in option like the
Xcode 12 coverage tool, or you can pick a free library like Slather, which will generate test
coverage reports for Xcode projects and hook them into your CI.

16. Test your classes with Unit tests — You already know the importance of writing unit
tests. You can use the XCTest or Nimble library to write tests easily. Also, use dependency
injection if not already to allow using mock/stub classes during tests.

17. Test your UI with EarlGrey 2.0 — A native iOS UI automation test framework that
combines EarlGrey with XCUITest, Apple’s official UI Testing Framework.

18. Use CI/CD to automate development — CI/CD is a must tool to make the development
process automatic. Automate all manual tasks and then keep pushing builds without
recurring efforts!

19. Use Firebase crashlytics for App analytics — The lightweight, real-time crash reporting
tool makes it easy for you to manage the stability of your app.

20. Prioritize app security — User privacy is paramount. To help people trust your app, it’s
crucial to be transparent about the privacy-related data and resources you require and
how you use them. Check out apple’s official guide on Accessing User Data and Resources.

You might also like