kylehowells / ikyle.me-code-examples

Smaller code examples from my blog posts on ikyle.me
https://ikyle.me/blog/
The Unlicense
42 stars 17 forks source link

Video Picker ObjC #1

Open Jan-E opened 3 years ago

Jan-E commented 3 years ago

Hi @kylehowells

I just want to say a big thanks. Your example Photo Picker ObjC gave me a jump start to use PHPickerViewController in stead of UIImagePickerController for importing videos from the Photos library into my B2B app. See here:

Jan-E/ikyle.me-code-examples

There will be a time when Apple deprecates UIImagePickerController. I am ready for it now.

Demo of the use of my B2B app in the Xcode Simulator, still with the UIImagePickerController: https://player.toolsforresearch.com/iPhone12.php

Thanks again, Jan

Jan-E commented 3 years ago

Quote from you blog:

NOTE: There is an assetIdentifier property defined on PHPickerResult, which is documented as Local identifier of the selected asset. However, (as of iOS 14.0 beta 1, in my testing this is always nil; regardless of whether or not the app has been granted full photo library access. I presume that is meant to be the PHAsset's assetIdentifier allowing us to retrieve the asset object with a call to asset = PHAsset.fetchAssets(withLocalIdentifiers: [photoID], options: nil).firstObject.

I solved this by https://github.com/Jan-E/ikyle.me-code-examples/commit/90de6e922cc3d1e9aac8a825dc9c03787f3d11bc

See https://developer.apple.com/forums/thread/650902 for the Swift code by ‘Frameworks Engineer’ that put me in the right track.