ios - how to retrieve multiple images got from server and show them in UIImageView with swipe -
how add swipe gesture multiple images retrieved server. str=@"but1.jpg,but2.jpg" server.how show both these images stored in string swipe. single image showing server getting response server based on key "image_names" ,am storing in string.my code below
url=@"http:.........."; str=[dict1 valueforkey:@"image_names"]; if (str!=nil) { strimg=[url stringbyappendingstring:str]; dispatch_async(dispatch_get_global_queue(0,0), ^{ nsdata *data = [[nsdata alloc] initwithcontentsofurl:[nsurl urlwithstring:strimg]]; if ( data == nil ) return; dispatch_async(dispatch_get_main_queue(), ^{ uiimage *img=[uiimage imagewithdata: data]; imgview.image=img; }); }); }
i not getting question can add swipe gesture image below lines of code.
uiswipegesturerecognizer *swipeleftgesture = [[uiswipegesturerecognizer alloc] initwithtarget:self action:@selector(swipeleftgesture:)]; uiswipegesturerecognizer *swiperightgesture = [[uiswipegesturerecognizer alloc] initwithtarget:self action:@selector(swiperightgesture:)]; [swipeleftgesture setdirection:uiswipegesturerecognizerdirectionleft]; [swiperightgesture setdirection:uiswipegesturerecognizerdirectionright]; // adding both swipe gesture uiimageview [imageview addgesturerecognizer:swipeleftgesture]; [imageview addgesturerecognizer:swiperightgesture];
Comments
Post a Comment