@interface Nqximagebrowswe:uitableview
/**
* @brief View Profile
*
* @param oldimageview Avatar's ImageView
*/
+ (void) ShowImage: (uiimageview*) Avatarimageview;
@end
#import "NQXImageBrowswe.h"
Static CGRect Oldframe;
@implementation Nqximagebrowswe
+ (void) ShowImage: (Uiimageview *) avatarimageview{
UIImage *image=avatarimageview.image;
UIWindow *window=[uiapplication Sharedapplication].keywindow;
UIView *backgroundview=[[uiview alloc]initwithframe:cgrectmake (0, 0, [UIScreen mainscreen].bounds.size.width, [ UIScreen mainscreen].bounds.size.height)];
Oldframe=[avatarimageview ConvertRect:avatarImageView.bounds Toview:window];
Backgroundview.backgroundcolor=[uicolor Blackcolor];
backgroundview.alpha=0;
Uiimageview *imageview=[[uiimageview Alloc]initwithframe:oldframe];
Imageview.image=image;
imageview.tag=1;
[Backgroundview Addsubview:imageview];
[Window Addsubview:backgroundview];
UITapGestureRecognizer *tap=[[uitapgesturerecognizer alloc]initwithtarget:self Action: @selector (hideImage:)];
[Backgroundview Addgesturerecognizer:tap];
[UIView animatewithduration:0.3 animations:^{
Imageview.frame=cgrectmake (0, ([UIScreen mainscreen].bounds.size.height-image.size.height*[uiscreen MainScreen]. Bounds.size.width/image.size.width)/2, [UIScreen mainscreen].bounds.size.width, Image.size.height*[uiscreen Mainscreen].bounds.size.width/image.size.width);
Backgroundview.alpha=1;
} completion:^ (BOOL finished) {
}];
}
+ (void) Hideimage: (uitapgesturerecognizer*) tap{
UIView *backgroundview=tap.view;
Uiimageview *imageview= (uiimageview*) [Tap.view viewwithtag:1];
[UIView animatewithduration:0.3 animations:^{
Imageview.frame=oldframe;
backgroundview.alpha=0;
} completion:^ (BOOL finished) {
[Backgroundview Removefromsuperview];
}];
}
@end
IOS Browse Photos Nqximagebrowswe