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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -