Using Transient CIFilters for CATransition

I am trying to use the CATransition filter property with new iOS 6 transition animations (CIBarsSwipeTransition, CICopyMachineTransition, etc.). The CIFilter documentation says that they are available on iOS 6, and nothing on the CATransition documentation says that the filter property cannot be used.

But I can’t get them to work. I don’t know if Apple just doesn’t mention the inaccessibility of the functionality, or I just missed something to make it work. Here is how I installed it:

 CIFilter *transitionFilter = [CIFilter filterWithName:@"CIBarsSwipeTransition"]; [transitionFilter setDefaults]; CATransition *transition = [CATransition new]; transition.duration = 0.4f; transition.filter = transitionFilter; [self.view.layer addAnimation:transition forKey:kCATransition]; 

Any pointers are appreciated.

+7
source share
2 answers

I'm not sure if this is possible on iOS. From the CATransition documentation:

If specified, the filter should support both the kCIInputImageKey input keys and kCIInputTargetImageKey , and the kCIOutputImageKey output kCIOutputImageKey .

From CIFilter Documentation (Constants Section) (emphasis mine)

kCIInputTargetImageKey

The key for the CIImage object, which is the destination image for the transition. Available in OS X v10.5 and later. Not available on iOS .

The filter exists, and inputTargetImage is one of the input keys, but even if you yourself create the kernel image data and assign it to the properties (which are displayed correctly in the debugger), you still do not get the effect.

Creating the same effect for OS X is as simple as the code in your question. I filed this as a radar (13281399).

+3
source

I know the question is pretty old, but I got my work by following this link

https://developer.apple.com/library/mac/#documentation/graphicsimaging/conceptual/CoreImaging/ci_tasks/ci_tasks.html

Check out the 11 steps in the section "Using transition effects", it also works on iOS

+4
source

All Articles