I was unable to find this on the forums so I decided to post this.
I have a UIImageView with the following code which fades the images from one another.
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)];
imageNames = [NSArray arrayWithObjects:@"image1.jpg", @"image2.jpg", @"image3.jpg", @"image4.jpg", @"image5.jpg", nil];
imageview.image = [UIImage imageNamed:[imageNames objectAtIndex:0]];
[NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(transitionPhotos) userInfo:nil repeats:YES];
// Rounds corners of imageview
CALayer *layer = [imageview layer];
[layer setMasksToBounds:YES];
[layer setCornerRadius:5];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)transitionPhotos{
if (photoCount < [imageNames count] - 1){
photoCount ++;
}else{
photoCount = 0;
}
[UIView transitionWithView:imageview
duration:2.0
options:UIViewAnimationOptionTransitionCrossDissolve
animations:^{imageview.image = [UIImage imageNamed:[imageNames objectAtIndex:photoCount]]; }
completion:NULL];
}
I want to implement a code that will fade the borders of my imageview.
I know I can use the QuartzCore.framework, however I was unable to find a guide how to achieve the result that I want.
What would be the shortest possible code to do such a method?