Context:
Using Xcode 13.2 and building on iOS 15.2 devices
When installing the app for the 1st time on a device or simulator.
https://developer.apple.com/forums/thread/696804
Solution
Before iOS 15.2 version we could register PHPhotoLibrary.shared().register(self) without authorization, in iOS 15.2 it is not possible, you will get an error. You have to request authorization(requestAuthorization(_:)) for register PHPhotoLibrary.shared().register(self).
How to implement it?