I'm trying to force users to crop their photo to a square with Aviary. As described in the Aviary documentation here, it is possible to disable custom crops and specify the presets manually. I am attempting the following:
[AFPhotoEditorCustomization setCropToolOriginalEnabled:NO];
[AFPhotoEditorCustomization setCropToolCustomEnabled:NO];
NSDictionary *SIZE = [[NSDictionary alloc] initWithObjectsAndKeys:
@"kAFCropPresetName",@"square",
@"kAFCropPresetWidth",@"1.0f",
@"kAFCropPresetHeight",@"1.0f",
nil];
[AFPhotoEditorCustomization setCropToolPresets:[[NSArray alloc] initWithObjects:SIZE, nil]];
But this does not work. This results is 0 cropping options:
You should use the below code:
[AFPhotoEditorCustomization setCropToolOriginalEnabled:NO];
[AFPhotoEditorCustomization setCropToolCustomEnabled:NO];
NSDictionary * square = @{kAFCropPresetName: @"Square", kAFCropPresetHeight : @(1.0f), kAFCropPresetWidth : @(1.0f)};
[AFPhotoEditorCustomization setCropToolPresets:@[square]];