1

As you see in the image below iOS camera supports square photos. But I couldn't find how to do this in the documentation or in the web. All of the examples are adding a custom overlay on the camera which then calculates how to crop the image etc..

I do not want to do this because there may be device incompatibilities and since Apple has done it I figured out there is an easy way to do this by accessing the native library. Any idea how?

enter image description here

Esqarrouth
  • 38,543
  • 21
  • 161
  • 168

2 Answers2

1

If you can't figure it out, an alternative is to crop your image after it's returned:

SquareCropViewController

Anna Dickinson
  • 3,307
  • 24
  • 43
  • this looks like a great custom way, but it looks too complicated for a process that should be really simple, creating a new storyboard view, adding lots of classes. bonus points for swift – Esqarrouth Nov 05 '14 at 13:16
  • But it uses almost no code. And it works for all devices and rotations. It's mostly an example of cool things you can do with autolayout, but it's a good cropper as well. – Anna Dickinson Nov 05 '14 at 14:11
  • sorry, i try to avoid autolayout for things like this :( – Esqarrouth Nov 05 '14 at 14:32
0

On your image picker you can set property allowEditing to YES and it will force the user to crop the image

Hans Knöchel
  • 11,422
  • 8
  • 28
  • 49
wootage
  • 936
  • 6
  • 14
  • 2
    I know, 1st it doesn't allow user to see the picture while taking it. 2nd its controller is kind of weird, it doesn't allow me to crop the picture very close to the sides of it. It animates back to the original location unless I zoom in – Esqarrouth Nov 05 '14 at 13:05