Following on from the Core Graphics tutorial, this download-able demo app presents an easy way to look at the various effects available both through documented and undocumented code.
Transitions Demonstration
Demonstration of the various effects available using Core Graphics and Core Image.
Usage
As easy as
- Download the package.
- In Xcode, open AnimatingTabsDemo.xcodeproj, then click build and run, or press Command + R. The Application will build, and the demo will run!
- Run through the demo and play around with all the different transitions you can use!
After you’ve built it once, you can simply run the “Transitions Demo.app” package that is created in the “build” folder by double-clicking it without going through the prior steps again.
Real World Usage
When using the NSTabView subclass, you can change the default transition by setting transitionsStyle to one of the following. (Hover your mouse over for a description)
- CGNone
- CGFade
- CGZoom
- CGReveal
- CGSlide
- CGWarpFade
- CGSwap
- CGCube
- CGWarpSwitch
- CICopyMachine
- CIDisintegrate
- CIDissolve
- CIFlash
- CIMod
- CIPageCurl
- CIRipple
- CISwipe
For example, in the AnimatingTabView’s awakeFromNib: method, the following code sets the transition style to a cube effect:
transitionStyle = CGCube;
If you’re not in the AnimatingTabView’s implementation, you can use the - setTransitionStyle method. The following code sets the transition style to a ripple effect:
[AnimTabView setTransitionStyle:CIRipple];
where AnimTabView is the outlet to the AnimatingTabView
You can also get the current transition style by using the `-transitionStyle` method on the AnimatingTabView.
Transitions starting with “CG” are Core Graphics transitions and the result in the whole window being animated, while those starting with “CI” are Core Image transitions and only animate the tab view rather than the whole window.
Version History
Version 0.1
- Initial pre-release demonstration
Version 0.1.1
- Fixed bug with linking QuartzCore framework. (Thanks Jason Harris)
All contents copyright 2006-07 Ankur Kothari
24 Comments so far
Leave a commentWhen I try to compile that project, I get several errors:
/usr/bin/ld: Undefined symbols:
.objc_class_name_CIFilter
.objc_class_name_CIImage
.objc_class_name_CIVector
/Users/loganwilliams/Desktop/Core Transitions/build/AnimatingTabsDemo.build/Development/Transitions.build/Objects-normal/ppc/AnimatingTabView.o reference to undefined .objc_class_name_CIFilter
/Users/loganwilliams/Desktop/Core Transitions/build/AnimatingTabsDemo.build/Development/Transitions.build/Objects-normal/ppc/AnimatingTabView.o reference to undefined .objc_class_name_CIImage
/Users/loganwilliams/Desktop/Core Transitions/build/AnimatingTabsDemo.build/Development/Transitions.build/Objects-normal/ppc/AnimatingTabView.o reference to undefined .objc_class_name_CIVector
collect2: ld returned 1 exit status
Any reason why?
uttered by Logan Williams on October 22, 2006 3:31 pm | Permalink
Let me guess, you’re using an Intel computer?
Try going to Project->Edit Project Settings. Under the build tab, double-click Architectures and uncheck PowerPC. Then go to Project->Edit Active Target ‘Transitions’ and do the same thing.
Let me know if it works.
mentioned by Ankur on October 22, 2006 3:54 pm | Permalink
Nope, PowerBook G4 here. Tried unchecking Intel on both of those, but it did not resolve the situation.
revealed by Logan Williams on October 22, 2006 3:58 pm | Permalink
If you’re running Tiger, it should run… Try the compiled universal binary and see if that works for you.
Nice site by the way.
proclaimed by Ankur on October 22, 2006 4:02 pm | Permalink
The compiled binary did not run. Here is the crash log, if that helps. The original tutorial ran, and I have had no problem compiling applications in Xcode for ppc only in the past. What about a compiled PPC only binary?
Thanks.
posted by Logan Williams on October 22, 2006 4:21 pm | Permalink
Oops, typo. Real crash log is here.
disclosed by Logan Williams on October 22, 2006 4:22 pm | Permalink
PPC Only app is here.It should theoretically work since all the code in it is documented at http://developer.apple.com/documentation/GraphicsImaging/Conceptual/CoreImaging/index.html and Apple provide examples for half this stuff anyway. I’ll dig up a little more and see what I can find.
voiced by Ankur on October 22, 2006 5:21 pm | Permalink
Ok, a Core Image example project is available from the Apple website here. If that doesn’t work, then we it’s not this specific project that’s failing. It could be because of the G4 processor / something to do with the graphics card not supporting it.
posted by Ankur on October 22, 2006 5:25 pm | Permalink
Hey, but that’s awesome, too!
revealed by SeoxyS on October 22, 2006 6:30 pm | Permalink
Glad you like it
recorded by Ankur on October 22, 2006 6:45 pm | Permalink
Ankur, you’re seeing the compilation problem because the app isn’t linking with QuartzCore. Project -> Add to Project. Choose /System/Library/Frameworks/QuartzCore.framework.
stated by Jason Harris on October 22, 2006 8:12 pm | Permalink
Thanks for that Jason.
Core Image has always worked for me without linking to Quartz Core, so I always leave it out, but it seems this doesn’t work on other computers. I guess that’s bad coding practice on my part. Thank you for picking that up, I’ve updated the source (and compiled files) and have now re-uploaded them.
spoken by Ankur on October 22, 2006 9:10 pm | Permalink
I was so impressed with the slickness of the demo that I actually chuckled out loud. Fantastic work.
disclosed by Scott Stevenson on October 28, 2006 6:15 pm | Permalink
Thanks Scott. Glad you liked it. Feel free to use the code if need be.
composed by Ankur on October 28, 2006 10:06 pm | Permalink
Wow, this is fantastic. I’m really looking forward to finding out more about Core Image.
stated by Adam on December 12, 2006 1:21 am | Permalink
Hi Ankur…man this is awesome…I am learning Core Image and core Graphics and was looking for some code to get started up. Your app seems like the perfect one.Thanks man…and god bless
posted by Mithun on February 8, 2007 5:08 pm | Permalink
Thanks Adam and Mithun. Hope it comes in handy.
expressed by Ankur on February 10, 2007 9:12 am | Permalink
is there anyway that when people give downloads they could automatically just say what the minimum system requirements are?
reported by ben on September 30, 2007 3:13 am | Permalink
Sorry Ben. I’ll try to keep that in mind.
declared by Ankur on September 30, 2007 11:35 am | Permalink
Very impressive. Would it be possible to create a plugin that applied this to existing cocoa windows?
stated by Tyler on October 24, 2009 10:55 am | Permalink
Leave a comment