I copied this tutorial; https://www.youtube.com/watch?v=uTbi_0LFxm0
I think the code is deprecated because the vid was posted 4 years ago.Especially because it used the old 'appdidfinishlaunching' method. Is this workable?
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
//this was a uiwindow in .h
@synthesize whatsup=whatsup;
- (void)viewDidLoad
{
UIImage * image = [UIImage imageNamed:@"sexy.jpg"];
UIImageView * imgView = [[UIImageView alloc]initWithImage:image];
[imgView setFrame:(CGRect){{0,0},image.size}];
[imgView setCenter:(CGPoint){160,240}];
[whatsup addSubview:imgView];
CABasicAnimation * fullRotation=[CABasicAnimation animationWithKeyPath:@"transform.rotation"];
fullRotation.fromValue=[NSNumber numberWithFloat:0];
fullRotation.toValue=[NSNumber numberWithFloat:((360*M_PI)/180)];
fullRotation.duration = 6;
fullRotation.repeatCount= 1;
[imgView.layer addAnimation:fullRotation forKey:@"360"];
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
Nothing really loads. Should i just nix it? Do you think this works?