Search code examples
iphoneanimationphotos

Photos App Animation Advice


I have scoured the net for this question and have came up empty handed. I have an app that I'm making which I want the user to be able to view an image i have hooked up to the UIImageView to show fullscreen. Basically by tapping the UIImageView it would make the buttons and status bar disappear until image is tapped again. I know this is probably a simple animations block that i would throw in my viewdidload or where I call my image from. I'm just unsure where it goes.

here is where my image comes from if the helps.this is in my .m file

-(void)viewDidLoad {////Loads UIImageView from URL
todaysWallpaper.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL   URLWithString:@"http://www.inkdryercreative.com/daily/archive/mondays/images/062-mondays-960x640-A.jpg"]]];

I have four buttons that appear on screen. i want it to resemble the feel you get in the native photos app when you look and a picture and everything else on screen dissolves. Any help or guidance would be great. I can send additional code if needed


Solution

  • CGRect *oldFrame = todaysWallpaper.frame; // store this somewhere for when you go back
    CGRect *newFrame = [[UIScreen mainScreen] bounds];
    
    [UIView animateWithDuration:0.5 animations:^{
       todaysWallPaper.frame = newFrame;        
    }];