MFMailComposer sending attached Image scaled down - ios

I'm using a UIImagePicker to take a picture and browse the Camera Roll.. I also added a link to mail the picture which is displayed in a popup window. The attached image comes up in it's native size (which is pretty enormous). What I want to do is scale down that image.. but only for the MFMailComposer's view. When send is selected I want the full image to be sent.

The attachment can only be specified before showing the MFMailComposer view and that's the attachment it will show. Usually, it tries to fit the image within the bounds of MFMailComposer view.
Do you mean to say you have to scroll left, right and bottom to view the complete image ?

Related

How to navigate between screens with shared element?

I want to show a fullscreen popup dialog to display a user-scaleable image already displayed as a thumbnail in a list screen. How can I smoothly scale the image from the thumbnail, and return to its original position when I close it?

How to remove Launch screen from project in iOS?

I want to remove the launch screen from my project because I want to add a GIF image as a launch screen. I tried to set Main.Storyboard as Launch screen file in target but it is not working.
You don't remove the launch screen. You must have a standard, static launch screen storyboard. It's used before your app is even running. You can't change that.
Add whatever static image you want to the launch screen.
If you need anything dynamic that you wish to show before the main storyboard is shown then you need to show it on your main storyboard or some other storyboard/root view controller you want to show before the main storyboard (but after the launch storyboard).
But do your users a favor and don't do anything that delays their ability to start using your app.
As you cannot set Gif image directly to launchscreen storyboard Try this way
Take first frame of your gif image as png and set it on the LaunchScreen storyboard.
Then in the next view controller to be shown after the LaunchScreen storyboard, create a view, put imageview in it and show gif image in it , it should be the same size as the image in your LaunchScreen storyboard.
Please refer this link https://github.com/kirualex/SwiftyGif
Nice example is given here to show gif image in UIImageView.
You can try Uber.
I have no idea how to remove the launch screen, but you can make the launch screen looks same as the first frame of your gif. After the static launch screen disappear, you can start your GIF.
Here is a video I take. Video
You will have to follow the same solution as rmaddy suggested. You will have to add a viewController which shows you animation, before you show your main storyboard, or your first viewcontroller whatever it is.
What you can do it, you can set an image which is identical to the first frame of your gif, as your default launch screen, so that it looks like there is an animation on the launch screen, when you show your gif containing launch screen.
Hope you get it.

Issue with displaying an alert like view

In Android, on the click of a button I get a screen coming up (the one on the left with just the First Name and Last Name) and on click of the more button the other fields are also displayed (the image on the right).
I tried to achieve this by loading another view on the click of the button, but this shows a view completely filling the screen and not like the one in the image with limited height and the background view being greyed out.
Also to get a screen like the one on the left I made their height constraints equal to 0, but though it showed just 2 textfields, the screen filled the whole screen and not like the one on the left.
Any idea as to how this can be achieved?
To show custom transition while presenting a controller i.e.
your first requirement - a view completely filling the screen & not like the one in the image with limited height and the background view being greyed out.
you can use UIViewControllerAnimatedTransitioning.
I have created a sample here:
https://github.com/pgpt10/Custom-Animator

Image Automatically Resized In Run-time But Not On Interface Builder

Alright, this is struggling me by now. I have a PNG image which has the size of 10x36px.
When I try to use that in any of my views it gets resized. Not the frame property, this one remains intact. But visually the image is not the same.
The real image is like this . (Sorry if you can barely see it. That's because it has a white background on a white foreground).
But when I am in the simulator (it happens on a device too) it looks like this.
.
I'm not using contraints(I turned off AutoLayout in order to find the bug).
I printed the frame of that button and it's width, height, x and y values are just as they are in the interface builder. And I printed them everywhere and in response to different events too(I know, that's not the reason. I'm just desperate).
This happens only with this PNG specifically cause other UIButton I have in the very same view, but with differents Images, are working just fine.
What could be the cause of this error?
EDIT:
Trying as a background image it got better. But still not perfect.
Place the png image inside an empty 36x36 png image in Photoshop/Pixelmator to stop it resizing and preserve the original ratio.
Or try setting the views content mode to "aspect fit" in Interface Builder or programmatically:
yourImageView.contentMode = UIViewContentModeScaleAspectFit;
The cause could be that UIBarButtons treat images differently than UIButtons. UIBarButtons are typically used in UINavigationBars or UIToolbars while UIButtons are used typically in the View.
Make sure you are using Button background image and not Button image.
Button background image covers the whole button background.
Button image places the images on a portion of the background.
Also, use xcassets. It comes with the project template. If you don't have it (deleted it), add a new one and create an image set. Once you do that, add your images. Make sure to select "Render as original image" for each image in your image set.
The PNG image you linked to isn't 10x36 pixels, but 10x30. Oops?

Showing a circle crop in UIImagePicker edit view

I am using the default ios camera in my app. I don't want to create an overlay for the whole camera, but I would like to change something the edit view that shows after the user takes a photo. Normally, it shows a square to crop, but I would like it to show a circle how would I do this.

Resources