Search code examples
photoeditorsdk

PhotoEditorSDK configuration


I am trying to configure the photoeditorSDK for iOS, but am struggling.

My current issues are the following: 1. When a user clicks on the brush toolMenuItem, it does not do anything. Other toolMenuItems do what they are supposed to (e.g. Size).

  1. Similarly, when a user adds text through the Text Menu Item, it works, however when they try to resize the text - they can't click it.

I believe these issues are related - that is why I opted them together.

Here's the code snippet used to configure the control:

NSError *dataCreationError;
NSURL *aLocalURL = [NSURL URLWithString:filepath];

NSData *imageData = [NSData dataWithContentsOfFile:aLocalURL.path options:0 error:&dataCreationError];

if (imageData && !dataCreationError) {
    PESDKConfiguration *configuration = [[PESDKConfiguration alloc] initWithBuilder:^(PESDKConfigurationBuilder * _Nonnull builder) {
                // See Configuration section
    }];
    NSMutableArray<PESDKPhotoEditMenuItem *> *menuItems = [[PESDKPhotoEditMenuItem defaultItems] mutableCopy];
    [menuItems removeLastObject]; // Remove last menu item ('Magic')

    PESDKPhotoEditViewController *photoEditViewController = [[PESDKPhotoEditViewController alloc] initWithData:imageData configuration:configuration];
    photoEditViewController.delegate = self;

    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:photoEditViewController];

    dispatch_async(dispatch_get_main_queue(), ^{
        [self.viewController presentViewController:navigationController animated:YES completion:nil];
    });

} else if (dataCreationError) {
    NSLog(@"Failed to open given path: %@", dataCreationError);
}

Solution

  • This is a bug on our side and will be fixed with the next release, which will go live this week. As a workaround, we updated your subscription. You just need to generate a new license file using our dashboard and replace the existing one in your app. This should fix both issues, but will add the Sticker tool to your menu items. You may remove it just like you did with the Magic tool.

    If you have further questions, just let me know!