ios - How to know a UIView is resizing to inner side or outer side? -


how know uiview resizing , frame increasing or decreasing (or inner side or outer side)?

for e.g. have uiimageview (and using third party library resize object). current frame is, (somex, somey, 200,50), if resize in way changes width 300 , in case changes 150. should able know that, increased/decreased.

you can key-value observing. example, if uiimageview *imageview can:

[imageview addobserver:self forkeypath:@"frame" options:0 context:null]; 

you need implement method in order react changes:

- (void)observevalueforkeypath:(nsstring *)keypath ofobject:(id)object change:(nsdictionary *)change context:(void *)context {     uiimageview *imageview = (uiimageview *)object;     // gotta do, save current size in      // instance variable can compare , see increase/decrease in size } 

Comments

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Java JSoup error fetching URL -

webstorm - PhpStorm file cache conflict with TypeScript compiler -