-(void) Fullbuttonaction: (UIButton *) sender{
UIWindow *keywindow = [uiapplication sharedapplication]. Keywindow;
if ([sender. Titlelabel. Text isequaltostring:@ " close "]) {
cgrect inwindowframe = [self. Lastsuperview convertrect:self. Frame Fromview: Keywindow];
self. Frame = inwindowframe;
[UIView animatewithduration:2 animations: ^{
[self. Lastsuperview addsubview:self];
self. Transform = cgaffinetransformmakerotation(0);
self. Frame = self. Lastframe;
[self. Rootview requestlayout];
} Completion: ^ (BOOL finished) {
[self. Fullscreenbutton settitle:@ " full screen " forstate:uicontrolstatenormal];
}];
return;
}
self. Lastsuperview = self. Superview;
self. Lastframe = self. Frame;
[Keywindow addsubview:self];
[Keywindow bringsubviewtofront:self];
}
-(void) didmovetosuperview{
UIWindow *keywindow = [uiapplication sharedapplication]. Keywindow;
if (self. Superview = = Keywindow) {
cgrect inwindowframe = [self. Lastsuperview convertrect:self. Frame Toview: Keywindow];
self. Frame = inwindowframe;
[UIView animatewithduration:2 animations: ^{
cgsize windowsize = [uiscreen mainscreen]. Bounds. Size;
self. Frame = cgrectmake(0, 0, windowsize. Height, windowsize. width);
self. Transform = cgaffinetransformmakerotation(m_pi_2);
self. Center = cgpointmake(windowsize. Width/2, windowsize. Height/2);
[self. Rootview requestlayout];
} Completion: ^ (BOOL finished) {
[self. Fullscreenbutton settitle:@ " close " forstate:uicontrolstatenormal];
}];
}
}
Fullbuttonaction: Response to Full screen button in cell
Transition animations are implemented with transform.
The Didmovetosuperview method is the callback method after the object is added to a view
Convert cell to Full screen horizontal screen display