Breaking News
Home / iOS / iOS Snippets (page 3)

iOS Snippets

How can you cache CCAnimation in Cocos2D?

Cocos2D provides a simple way to cache you Animations using CCAnimationCache class. The CCAnimationCache is implemented as a singleton which can be accessed using the [CCAnimationCache sharedAnimationCache] method.This approach is particularly useful if the animation steps are common across more than one sprites. [[CCAnimationCache sharedAnimationCache] addAnimation:animationToCache name:@"NameOfAnimation"];     CCAnimation …

Read More »

How to hide UITextView Keyboard in OS?

Basically UITextView is for Multi line Text. However if you want to hid the keyboard when the user presses the Return Key using the following snippet: – (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {      if([text isEqualToString:@"n"])       {                  [textView …

Read More »
Advertisment ad adsense adlogger