Closed BillyJohn3 closed 7 years ago
Hi @BillyJohn3
You can do that by initializing OLKiteViewController without any assets:
OLKiteViewController *vc = [[OLKiteViewController alloc] initWithAssets:@[]];
and add your URL assets in the following way:
OLImagePickerProviderCollection *dogsCollection = [[OLImagePickerProviderCollection alloc] initWithArray:@[[OLAsset assetWithURL:[NSURL URLWithString:@"https://s3.amazonaws.com/psps/sdk_static/5.jpg"]], [OLAsset assetWithURL:[NSURL URLWithString:@"https://s3.amazonaws.com/psps/sdk_static/6.jpg"]], [OLAsset assetWithURL:[NSURL URLWithString:@"https://s3.amazonaws.com/psps/sdk_static/7.jpg"]], [OLAsset assetWithURL:[NSURL URLWithString:@"https://s3.amazonaws.com/psps/sdk_static/8.jpg"]]] name:@"Dogs"];
[vc addCustomPhotoProviderWithCollections:@[dogsCollection] name:@"Dogs" icon:[UIImage imageNamed:@"dog"]];
You can add a second OLImagePickerProviderCollection
to organize your images in albums (1st attached screenshot) or you can call addCustomPhotoProviderWithCollections:name:icon:
a second time to add a second tab (2nd attached screenshot).
Finally, you can hide the camera roll like this:
vc.disableCameraRoll = YES;
My examples are written in Objective-c but it should work similarly in Swift.
Positively amazing, thanks.
Is it the case that I can only use OLAssetWithURL for jpeg images? I'm getting an error 'JPEGDecompressSurface : Picture decode failed e00002d1'
Thanks once again, adding onto an app really is as easy is it says.
PNGs should also work fine. If this continues to be a problem, please open a new issue and I'll look into it.
I have function in my app to collect up all the URLs of images I wish to display and make an OLAsset assetWithURL for each URL. But, when I present the view controller and pass it this array of OLAssets when the user comes to select the images they with to use (say for a print) all the images in the Array I passed are selected. How can I make it default to not having any selected?
Also how can I hide the 'camera role' selecting ability?