简体   繁体   中英

Aviary SDK issue

I am using Aviary sdk in ios project. I added all frameworks and header files which is mentioned in documentation. Now i call below method in viewdidload.

- (void)displayEditorForImage:(UIImage *)imageToEdit
{
    AFPhotoEditorController *editorController = [[AFPhotoEditorController alloc] initWithImage:imageToEdit];
    [editorController setDelegate:self];
    [self presentViewController:editorController animated:YES completion:nil];
}

but it gives warning below in log and not showing Aviary window.

Warning: Attempt to present <AFSDKViewController: 0x7e1aeb0> on <ViewController: 0x7934af0> whose view is not in the window hierarchy!

how can i integrate aviary sdk in my project

If you present Modal View Controller in ViewDidLoad the error will occur coz the view is still not loaded into widow hierarchy. you can call that method in viewDidAppear.

But if you do so every time the view is appear displayEditorForImage method will be called.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM