Tag: ios
-
How Xcode Recognizes Module Imports
In iOS development, a module is a self-contained unit of code offering a specific set of functionalities. Modules help break down complex apps into smaller components. Developers can incorporate a module into different parts of an app using the import keyword. Behind the scenes, the build system performs several tasks to recognize and integrate these imports seamlessly. A module can be distributed in various formats such as collections of source files, or a pre-compiled binaries or bundles.
-
pre-commit Environment Issue in SourceTree
In the previous post, I mentioned pre-commit as a powerful tool to lint and format in a project. It had worked seamlessly for me until I committed code using SourceTree. Just to clarify, I predominantly use git on terminal. I only use a GUI app such as SourceTree to view the diff, or to stage selective chunks in a file (which is a bit difficult to achieve when using terminal). Therefore, the issue went unnoticed during my usual workflow.
-
Using pre-commit for Linters/Formatters
During my tenure at Grab, I witnessed the project’s transformation from an iOS exclusive to a multi-language initiative. Initially, the project primarily comprised iOS code. Over time, we developed various scripts (Ruby, Python, Bash, etc.) to enhance project build time and facilitate CI/CD integration. However, the linter setup was not sufficient for such a multi-language project. At a glance, we used SwiftLint, Rubocop, and Flake8 to lint Swift, Ruby, and Python code, respectively.
-
Using Swift Packages in CocoaPods-Based Projects
Introduction Swift Package Manager (SwiftPM, or SPM) is a tool for managing the distribution of Swift code. Initially launched in 2015, it primarily catered to server-side or command-like projects. Its adoption has been limited over the years due to lack of support for the mainstream iOS/MacOS development. During this time, CocoaPods has gained its power and emerged as a dominant tool in iOS development. Not until recently has SPM been adopted widely.
-
Designing Test Quarantine Logic to Deal With Flaky Tests
Introduction Flaky tests, known for producing inconsistent results (success or failure) over time, can be a source of frustration for developers. These non-deterministic tests can arise due to various factors, including code issues or an inconsistent testing environment. In this blog post, we will explore the concept of test quarantine, an approach to mitigate the challenges posed by flaky tests. The Need for Test Quarantine The Challenge of Flaky Tests Flaky tests are particularly prevalent in certain types of testing, such as UI testing, where the higher level of integration introduces greater complexity.
-
A Tale of Project Build Time Improvement
Introduction Build time is a key factor to engineers’ productivity. Slow build time can be frustrating and lead to hindered progress. There has been a great amount of effort by the community to tackle this complex problem. This blog post highlights various methodologies employed by our team (at Grab) to alleviate this pain point. Background The process of building an iOS project involves multiple steps, including compiling source code, processing resources (headers, assets, storyboards, etc.
-
On Using Python for Scripting in iOS Projects
As an iOS engineer, my recent focus has been on platform work, involving tasks like optimizing build times, integrating CI/CD pipelines, and devising testing solutions. This has led me to explore various scripting options, and I’ve found great satisfaction in using Python as our preferred choice. The first Python code Initially, scripting wasn’t a prominent aspect of my team’s workflow, largely due to the simplicity of our CI/CD setup and the prevalence of Bash scripts in our project.
-
Code Signing on CI
1. Introduction Code signing in iOS refers to the process of digitally signing an app’s executable code to ensure its authenticity and integrity. During feature development, developers usually do not have to worry about code signing because Xcode handles the complicated work. Most of the time, we build and run the app on simulators that do not require special code signing settings. However, distributing the app requires code signing. While working locally, you can rely on the “Automatically manage signing” option in the project settings.
-
Cocoapods Explained: Plugins
In the previous post, we talked about Podfile. In this post, we will look into CocoaPods plugins. Back in early days, very few maintainers maintain quite some features. It was difficult for them to stick to the main goals of the project given a number of features being requested. Some features definitely benefit a group of users but they don’t quite fit in the picture of a dependency manager. Instead of rejecting them, CocoaPods provided the support for plugins.
-
CocoaPods Explained: Podfile
In iOS development, CocoaPods has become one of the must-know tools. In a team where CocoaPods is adopted, engineers run pod install as often as git checkout. They know how to properly set up a project with CocoaPods, declare dependencies in Podfile, and update dependencies if needed. However, some have little understanding of what happens under the hood. This prevents them from troubleshooting CocoaPods issues if occurred or extending its usage.