There are two issues about SFSafariViewController.
After rotate from landscape to portrait,
- The topAnchor is destroyed.
- The specified bar tint color and control tint color are invalidated.(Returns to system color)
Regarding the second issue, I’ve found a temporary workaround.
Override the viewWillTransition(to:with:)
and keep it empty. Don't call super.viewWillTransition(to:with:)
.
Since UIKit is not open source, I don’t know the exact cause, but I found something that could be the key to the issue. So, I reported it to Apple Feedback Assistant. You can check the details and the sample project in the GitHub repository below.