IFTTT/FastttCamera

Square preview image

Closed this issue · 1 comments

How do I automatically crop the camera to a square UIView as it says in the README?

Preferably in swift.

FastttCamera will crop the photos you take to whatever the size of its view is. To make a camera that takes square photos, just make your FastttCamera's view square when you lay it out in the parent view controller.

If you check out the Example project, you can see how we've set it up using Masonry auto layout. You can use SnapKit to do something similar in Swift.

[self.fastCamera.view mas_makeConstraints:^(MASConstraintMaker *make) {
        make.center.equalTo(self.view);
        make.height.and.width.lessThanOrEqualTo(self.view.mas_width).with.priorityHigh();
        make.height.and.width.lessThanOrEqualTo(self.view.mas_height).with.priorityHigh();
        make.height.and.width.equalTo(self.view.mas_width).with.priorityLow();
        make.height.and.width.equalTo(self.view.mas_height).with.priorityLow();
    }];