Update Sep 12 2022: This doesn't work anymore, as of iOS 16.0.0 at least.
The methods of loading the main app icon highlighted in other answers like from Rufat Mirza used to work, and still does for debug builds, but I got an app rejection from Apple saying the app was crashing on launch. Turns out that the builds that contained this code started crashing on iOS 16, but only when installed via App Store/TestFlight (builds using the "Release" Configuration). What's more weird is that builds using the "Release" Configuration compiled via Xcode also wouldn't crash, only when uploaded to App Store and downloaded from TestFlight, so keep this in mind.
The fix was, unfortunately, to create a new Image asset with the same content as the AppIcon asset.
Note that this workaround still works for macOS as of the 12.5.1 and whatever macOS version Apple is using when reviewing their apps as of today, but since I already had to duplicate the asset for iOS, I also used the same asset for macOS to avoid this little hack :)