When issues occur only in different Build Configurations (such as slow UI updates in the Release environment due to main thread interference), I examined the differences between each Build Configuration. One of the differences I found two weeks ago was “there is a difference in API response speed,” and another discovered difference was variations in logging libraries. Upon checking the logging libraries one by one, it became apparent that the usage of FirebaseAnalytics had an impact.
It turned out that I had recently upgraded the FirebaseAnalytics version from 10.19.0 to 10.27.0.
After downgrading back to 10.19.0 and testing, it was confirmed as a version issue, and the change was made.
Since FirebaseAnalytics cannot be downgraded independently, products that have dependencies on it were also downgraded. Additionally, when installing FireStore as a binary, FireStoreSwift may not be installed along with it.
I need to be cautious when changing the versions of third-party libraries.
If you want to conveniently navigate links within the app, you can use the open(_:options:completionHandler:) method. However, when returning from an external URL, the view may not receive touch events.
Since the ViewController’s lifecycle is not called, I manually handled the appearance transition of the ViewController in the completionHandler’s closure.
DispatchQueue.main.async {
if let window = Application.window,
let rootViewController = window.rootViewController {
rootViewController.setNeedsLayout()
rootViewController.layoutIfNeeded()
}
}
beginAppearanceTransition(_:animated:)
is called when the view begins to appear on the screen.endAppearanceTransition()
is called when the transition is completed.viewWillAppear
, viewDidAppear
, viewWillDisappear
, viewDidDisappear
) are called correctly.To display HTML strings on the screen, I processed tags, but I also needed to handle Entities.
Since I needed to display HTML strings in a UILabel, I thought about ways to replace them.
HTML Entities are codes or identifiers used to safely represent specific characters in HTML. While I was about to write code to replace all Entities, I found the swift-html-entities library, so I used that library instead.