What's my best option for creating animations with existing single view application code? - objective-c

I already have my app finished but i want to polish it with some nice animations. Nothing to crazy, I just need to loop through some sprites to make it look like a plant is growing. For obvious reasons, I don't want to try and work this into a cocos2d framework. I found a couple animation classed on the web, but the animation look crappy and unnatural. Any ideas as to how I can best achieve this?

UIImageView animations would be the easiest. http://mobile.tutsplus.com/tutorials/iphone/uiimageview-animation/

Related

Go to keyframe of Spritebuilder timeline

I have a timeline where I basically want the user to have the ability to tap on the screen to fast forward the animation (well, more like skip part of the animation) to a later part. Obviously, this would have to be done using code.
I've researched this quite a bit and I don't think there's an easy solution. CCBSequence and CCBSequenceProperty offer a bit of hope, but my ideas have run dry and can't see a way to do it.
Obviously I'm aware of the animation manager and using it to run timelines and stop timelines, or even call something when the timeline is completed, but my capabilities with manipulating timelines made in Spritebuilder doesn't extend too far beyond that.
I can think of a messy workaround, where basically I just duplicate the section of the timeline I want to skip to and when the screen is tapped stop the current timeline and go to that, but it seems cumbersome and messy and I'd like to avoid that if possible.
Thanks for help!
I found the easy solution after a bit more looking
So if you have a look in CCAnimationManager there is a method for this called:
- (void)jumpToSequenceNamed:(NSString*)name time:(float)time;
So with your node you can call
[node.animationManager jumpToSequenceNamed:#"MyTimeline" time:1.0]; // 1 Second
If your animations aren't extremely complicated, try to implement it via cocos2d actions http://www.cocos2d-swift.org/docs/api/index.html
Using engine API you can create animation with custom speed on every tap.

Infinite UIScrollView

I would like to implement a timeline, much like one you can find in iMovie or Final Cut, which you can scroll in either direction. Scrolling to the left would go back in time ( months ) and scrolling to the right would go forward in time, creating a smooth continues path.
What would be the best way to implement this?
Do tricky things with UIScrollView
Subclass UIView and try to re-create inertial scrolling
A disadvantage of recreating the inertial scrolling is if Apple ever decides to change it that my app will feel weird. I personally do not like it when an app does not feel system integrated, this includes games like tower madness where they made their own scrollview which works really bad and feels wrong.
Apple has and example project featuring infinite scrolling it's called StreetScroller, the description says:
Demonstrates how a UIScrollView subclass can scroll infinitely in the
horizontal direction.
I hope this helps you.
StreetScroller can only support no paging mode. I wrote a class based on the StreetScroller and support paging & no paging at the same time.
https://github.com/hellohalo/InfiniteScrollView

Recreate the BookCase in iBooks

I just wanted to know how you could implement a bookcase, like in iBooks, into your iPhone app.
I presume you would need to use a UIScrollView, but then I read somewhere that you need to use a UITableView. Which is it?!
You'd use code that others have already written, such as AQGridView.
I'm not sure if there's a better way, but you could create multiple small views or images (these would represent each book) then add these small views/images to the subview of a larger view in a linear format (leaving a space between each element). Then just set the background of your larger view as an image of a bookcase. Sorry I don't know of a better way.
And for the above solution I would use a UIScrollView.
You can implement it anyway you like, but it seems to me that a UITableView would be the easiest (which will scroll anyway). All of the magic will happen in your UITableViewDataSource, which is where you will decide what books are placed on what row.
Once you have decided which books to display you will have create a custom tableview cell that draws the appropriate objects.
To be honest, while not too difficult of a task, it will take a lot of effort to get looking right. If you are not comfortable with custom drawing then be prepared to spend time learning about the various image/graphic APIs.

Cocoa Touch - Hypothetical Lag Comparisons

Hey all, I'm developing a rhythm game for the iPhone at the moment, just wondered if anyone had any thoughts on the best pieces to use for reaction time.
I have all the coding worked out, and I've narrowed it down to about 2 ways:
1: Using instances of UIButton that bypass the UIControlEvent or whatever, in order to use touchesBegan and touchesEnded. I've found this to be a bit faster in the past.
2: Using UIViews with custom functions to change the state of the buttons. They would also use touches began.
The rhythm pads (eight of them) need to be able to play a sound with minimal lag, and provide some sort of feedback, i.e. changing the image of the button.
My question: Is it better to Use UIViews and make my own buttons, or actual UIButtons that have been subclassed to use touchesBegan etc?
For anyone that finds this while searching, using touchesBegan, ended, and moved is WAY faster. In terms of a rhythm game or application requiring fast input, this is the way to go.

Zoom-able/ resizable grid with Objective-C

Hi i'm thinking about making midi step sequencer and I need to make a note grid/matrix that resizes/ adapts when you zoom. I've been searching for different ways of doing this but cant figure out a way that works well.
I thought about drawing cell objects made with (NSRect) but I couldn't figure out how to get the right interaction when resizing.
This is my first "biggish" OBJ-c project so please don't kill me, im still battling with the frameworks and the syntax is so foreign to me.
You could use Core Animation layers to create your grid.
Take a look at Apple's Geek Game Board sample code project:
http://developer.apple.com/library/mac/#samplecode/GeekGameBoard/Introduction/Intro.html
The code shows a way to display different kinds of card/board games using CALayer.
The Checkers game looks to be the closest to the grid you want to create.