Ive just found this code on Ray Wenderlich.
What's going on with this line of code?
.origin is a property I assume? But a property of what? And it's written in curly brackets, like a block, but seems to be casted as CGRect. I'm so confused, this has blown me out of the water.
What exactly is this code assigning self.imageview.frame as?
Thanks
Source: http://www.raywenderlich.com/10518/how-to-use-uiscrollview-to-scroll-and-zoom-content
Code:
UIImage *image = [UIImage imageNamed:@"photo1.png"];
self.imageView = [[UIImageView alloc] initWithImage:image];
self.imageView.frame = (CGRect){.origin=CGPointMake(0.0f, 0.0f), .size=image.size};
What's going on with this line of code?
Code:
self.imageView.frame = (CGRect){.origin=CGPointMake(0.0f, 0.0f), .size=image.size}
.origin is a property I assume? But a property of what? And it's written in curly brackets, like a block, but seems to be casted as CGRect. I'm so confused, this has blown me out of the water.
What exactly is this code assigning self.imageview.frame as?
Thanks
Source: http://www.raywenderlich.com/10518/how-to-use-uiscrollview-to-scroll-and-zoom-content