How to Duplicate a UIView. requirement is there should be two views inside a view for ex consider View A and View B. changing one view also should change another view.
for example consider am added a mpmediaplayer in view A means view B should show same video which is there in view A and if i moving anything in view A means ie forwarding video, volume control etc.. the scond view shold display the same thing.
There is no easy way to clone a view and then to update two views by one line of code. Because their underlying CALayers are different. But for duplicating a UIView, here is a new method you can use: Use UIView's method:
- (UIView *)snapshotViewAfterScreenUpdates:(BOOL)afterUpdates
This is the fastest way to draw a view. Available in iOS 7.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With