CGSize pageSize = myScrollView.frame.size; UIGraphicsBeginImageContext(pageSize); CGContextRef resizedContext = UIGraphicsGetCurrentContext(); int offsetX = -1*myScrollView.contentOffset.x; int offsetY = -1*myScrollView.contentOffset.y; CGContextTranslateCTM(resizedContext, offsetX, offsetY); [myScrollView.layer renderInContext:resizedContext]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); UIImageWriteToSavedPhotosAlbum(viewImage, nil, nil, nil);
This method link a toggle function to change between lanscape to protrait
if(UIInterfaceOrientationIsPortrait(self.interfaceOrientation)){ [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight]; }else{ [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationPortrait]; }
1. import font into xcode project 2. add UIAppFonts properties into info.plist with your file name of your font eg ‘filename.tlf’ 3. Use the font name like iOS font system
UIFont *font = [UIFont fontWithName: @"Font Name" size: 60]; _textLabel.font = font;