ios - Move view from UITableViewCell to Window and back to same cell -
i'm creating sdk have view performs various tasks such expanding , flipping not go detail.
in 1 possible use case, user may place view in uitableviewcell. make expand work properly, have view removed superview , added subview of window. so:
[mysdkview removefromsuperview]; uiwindow* window = [uiapplication sharedapplication].keywindow; if (!window) { window = [[uiapplication sharedapplication].windows objectatindex:0]; } [window addsubview:mysdkview];
now need figure out how put table cell! either automatically abstracted user (preferred) or implementation can leave in doc them follow.
upon expand, store superview of mysdkview (named savedsuperview below).
upon unexpand do:
if (savedsuperview) { [savedsuperview addsubview:mysdkview]; } else { [viewcontroller.view addsubview:mysdkview]; }
Comments
Post a Comment