How to get TTPhotoViewController to display UIImage?

I have a UIImage that I want to display using TTPhotoViewController, but TTPhotoViewController does not accept UIImage as an argument. TTPhoto is required as an argument, so I'm wondering if there is a way to convert UIImage to TTPhoto or if there is any other way to get TTPhotoViewController to display my UIImage other than setting defaultImage, t work too well.

+3
source share
4 answers

You need to create an object that matches the protocol TTPhotoSourceusing the necessary methods. Then you need to populate this data source with objects that match the protocol TTPhoto.

Then you must set the image source property to TTPhotoViewController and use Three20 magic.

In my own experience, I used this infrastructure with only URLs for images and downloaded them using the Three20 framework TTModel. I'm not quite sure how this affects loading images locally.

+3
source

I use a little hack to do this:

NSString *url = [[TTURLCache sharedCache] createUniqueTemporaryURL];    
[[TTURLCache sharedCache] storeImage:baseImage forURL:url force:YES];

PEPhotoViewController *album=[[[PEPhotoViewController alloc] initWithImageURL:url] autorelease];
+7
source

. bandle:// documents://. TTCatalog.

+1

self.defaultImage . .

0

Source: https://habr.com/ru/post/1751032/


All Articles