We’re extremely excited to announce that, for the first time ever, we have added exclusive new technology from Adobe Labs into the most recent version of the iOS Creative SDK. With Magic Selection View, you can use our latest technology to identify and pull selected portions of the image out of the foreground – with just two fingers! This new feature, Magic Selection View can be found in the AdobeCreativeSDKLabs.framework. This is just one example of how we’re continuing to evolve our creative tools and reimagine them for new mobile workflows.
The AdobeLabsUXMagicSelectionView class is similar to a combination of UIScrollView and UIImageView – it will display an image and let you scroll and pan the image. Simply instantiate it, add it as a subview to your view, and call setImage:
magicSelectionView = [[AdobeLabsUXMagicSelectionView alloc] initWithFrame: self.view.bounds]; [magicSelectionView setImage: myImage withCompletionBlock: myCompletionBlock]; [self.view addSubview: magicSelectionView];
Note: setImage is asynchronous and requires the use of a completionBlock for robust operation. See the sample app (link below) for details.
Once the image is set, the magic selection view is ready to use:
Unlike UIScrollView, panning is done with two fingers; the single finger gesture in the Magic Selection View is used for painting the magic selection:
Once the selection is painted you can extract the selected foreground bits from the image:
In order to use the Magic Selection View, you must add both the AdobeCreativeSDKLabs.framework and the AdobeCreativeSDKFoundation.framework in addition to a few dependent frameworks to your xCode app project’s “Link Binary With Libraries” build phase. Be sure to also add AdobeCreativeSDKFoundationResources.bundle to your “Copy Bundle Resources” build phase:
Finally, Magic Selection View requires an iOS Deployment Target of 8.0 or greater and requires the -ObjC Other Linker Flag:
And that’s it! With the Creative SDK you can give your users this powerful technology in just a few steps. You can find a complete example of this by downloading a sample project here.
Disclaimer: This Adobe Labs component is a beta product, and is provided with limited support. As with all of our SDKs, feedback is welcome.