IOS6 in Practice 记录1

- (UIImage*)imageWithImage:(UIImage*)image 
              scaledToSize:(CGSize)newSize;
{
    UIGraphicsBeginImageContext( newSize );
    [image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
    UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    return newImage;
}

 Presenting view controllers on detached view controllers is discouraged

http://stackoverflow.com/questions/19890761/warning-presenting-view-controllers-on-detached-view-controllers-is-discourage

 可以移动的imageview

- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event 
{
    [super touchesMoved:touches withEvent:event];
    
    float deltaX = [[touches anyObject] locationInView:self].x - [[touches anyObject] previousLocationInView:self].x;
    float deltaY = [[touches anyObject] locationInView:self].y - [[touches anyObject] previousLocationInView:self].y;
    self.transform = CGAffineTransformTranslate(self.transform, deltaX, deltaY);
}

 

发邮件

NSData *imageAsData = UIImagePNGRepresentation(i);
    [mailController addAttachmentData:imageAsData mimeType:@"image/png" fileName:@"PicDecor.png"];
    [mailController setSubject:@"My PicDecor Image"];
   
    [self.view.window.rootViewController presentViewController:mailController
                                                     animated:YES completion:nil];

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。