Integration testing for SwiftUI views

Introduction I have been looking for information about implementation details of integration testing. I found a lot of information, but it was theoretical and all information looked the same. I did not find a meaningful example, so I tried to come up with my own definition and sample. Integration testing means testing the behavior between modules or views to ensure they work as expected after user actions. There are two ways of conducting integration testing: The first is by unit tests, where you try to test the flowing data between view models....

May 10, 2024 · 2 min · Dmytro Chumakov

UI testing SwiftUI views using XCTest Framework

Introduction After spending some time developing my personal iOS app, I found myself in a position where I needed to add UI tests to my application. The reason behind this decision was the necessity to change the architecture to make it more scalable. However, this task proved to be challenging due to certain parts of the code being tightly coupled. The situation was quite frustrating. To address this problem, I decided to incorporate UI tests that could help identify issues during the refactoring process....

May 8, 2024 · 2 min · Dmytro Chumakov

Building Dynamic Island for Video Streaming App

Introduction I was curious about how to add Dynamic Island and implement it into a Video Streaming App. Here are a few steps on how you can achieve this. Caveats Debugging Dynamic Island can be a bit tricky; it only works when the main app is running. If you try to run it separately, you will encounter the error SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget". The solution is to configure live activities and run them through the main app....

May 6, 2024 · 2 min · Dmytro Chumakov

Building Video Streaming Widget for iOS App

Introduction I was exploring the idea of creating a YouTube-like widget for the lock screen on iOS devices. It wasn’t easy because most articles on the Internet discussed general implementations, such as for a coffee shop or a to-do list. Even when I found some similar versions, the project wouldn’t compile. I made the decision to approach it my way, so here’s what I found out: Caveats After being stuck for two or more hours without understanding why, after tapping on a button, I wasn't able to receive a callback from it and the widget always opened the main iOS app, I realized that I forgot to add AppIntent - without it, you can’t handle actions for iOS 17....

May 5, 2024 · 2 min · Dmytro Chumakov

Building Video Streaming iOS App

Introduction I was looking for a way to add a video player to my iOS app that could be able to play remote videos. Caveats Problem I found that you can’t open Vimeo or Youtube videos because of AVFoundationErrorDomain Code=-11850 "Operation Stopped" UserInfo={NSLocalizedFailureReason=The server is not correctly configured Domain=NSOSStatusErrorDomain Code=-12939 error. I don’t know exactly what this means, but I’m speculating it’s related to some protection. Solution My solution was to find another video that is not related to those platforms....

May 3, 2024 · 1 min · Dmytro Chumakov