开发者

Access Method Objects from Outside of Its Scope?

开发者 https://www.devze.com 2023-04-01 09:03 出处:网络
I create and apply animation to an indefinite number of UIImageView\'s within my method. Later at some point I need to 开发者_运维问答access UIImageView\'s to animate them differently or apply some tr

I create and apply animation to an indefinite number of UIImageView's within my method. Later at some point I need to 开发者_运维问答access UIImageView's to animate them differently or apply some transitions.

I want to find out the best possible way to access them from another method. I thought of using a View Controller's Mutable Array to add them there and later loop through it to retrieve the object I need but I do not know if it's possible.

Thanks in advance.


You should be able to use the [self.view subviews] array. You could loop through that and test if the view is a UIImageView. Alternatively, you could set the "tag" property of the views you need to animate when you create them and test for that.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号