Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS : Create dynamic URL for KTPhotoBrowserDataSource
    primarykey
    data
    text
    <p>I am using this <a href="https://github.com/kirbyt/KTPhotoBrowser" rel="nofollow">API</a> to create an online image gallery for my application but the problem is I need create a dynamic gallery this code from sample code shows just a few images from flickr, I need show images from a URL here is the code:</p> <p>For example: <code>www.mysite.com/gallery</code></p> <p>And on this URL there are many photos!</p> <pre><code>- (id)init { self = [super init]; if (self) { // Create a 2-dimensional array. First element of // the sub-array is the full size image URL and // the second element is the thumbnail URL. images_ = [[NSArray alloc] initWithObjects: [NSArray arrayWithObjects:@"http://farm5.static.flickr.com/4001/4439826859_19ba9a6cfa_o.jpg", @"http://farm5.static.flickr.com/4001/4439826859_4215c01a16_s.jpg", nil], [NSArray arrayWithObjects:@"http://farm4.static.flickr.com/3427/3192205971_0f494a3da2_o.jpg", @"http://http://farm4.static.flickr.com/3427/3192205971_0f494a3da2_o.jpg" , nil]; } return self; } #pragma mark - #pragma mark KTPhotoBrowserDataSource - (NSInteger)numberOfPhotos { NSInteger count = [images_ count]; return count; } - (void)imageAtIndex:(NSInteger)index photoView:(KTPhotoView *)photoView { NSArray *imageUrls = [images_ objectAtIndex:index]; NSString *url = [imageUrls objectAtIndex:FULL_SIZE_INDEX]; [photoView setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"photoDefault.png"]]; } - (void)thumbImageAtIndex:(NSInteger)index thumbView:(KTThumbView *)thumbView { NSArray *imageUrls = [images_ objectAtIndex:index]; NSString *url = [imageUrls objectAtIndex:THUMBNAIL_INDEX]; [thumbView setImageWithURL:[NSURL URLWithString:url] placeholderImage:[UIImage imageNamed:@"photoDefault.png"]]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload