MFMailComposer - attachment size

In my iphone application, in MFMailComposer, I add an attachment. When I click "Submit", he asks to choose the size - "Small", "Medium", "Large". I do not want it. I always want to set the attachment size on Medium. Can i control this?

+4
source share
1 answer

I found what to do ..

I used to do it

UIImage* image1 = [UIImage imageWithData:imageData1]; NSData *imageData = [NSData dataWithData:UIImageJPEGRepresentation(image1, 1]; 

I changed it to

 UIImage* image1 = [UIImage imageWithData:imageData1]; NSData *imageData = [NSData dataWithData:UIImageJPEGRepresentation(image1, 0.5]; 

This change is the compression quality of the image attached when it is “1”, this is the maximum size, and by default, the MFMailComposer function prompts the user to resize the image to a fairly large size by default. If you change this to “0.5,” the image will be compressed and the size will be smaller and it will not ask the user to resize.

+3
source

Source: https://habr.com/ru/post/1434538/


All Articles