Skip to content

Instantly share code, notes, and snippets.

@lysanntranvouez
lysanntranvouez / Cocos2D-SpriteBuilder.3.4.3-rc.0.podspec
Last active December 12, 2017 11:25
Podspec for Cocos2d-SpriteBuilder version 3.4.3-rc0
Pod::Spec.new do |s|
s.name = 'Cocos2D-SpriteBuilder'
s.version = '3.4.3-rc.0'
s.summary = 'Cocos2D-SpriteBuilder is a framework for building 2D games, demos, and other graphical/interactive applications for iOS, Mac and Android.'
s.homepage = 'http://cocos2d.spritebuilder.com/'
s.license = { :type => 'MIT', :file => 'LICENSE_cocos2d.txt' }
s.authors = 'Apportable Inc.'
s.platform = :ios, '6.0'
@gragera
gragera / gist:fab8a2eaa11dc63b9b9f
Last active September 3, 2018 13:15
Using swift generics for easier storyboard ViewController instantiation
import UIKit
extension UIStoryboard {
func instantiate<T>(identifier: String, asClass: T.Type) -> T {
return instantiateViewControllerWithIdentifier(identifier) as! T
}
func instantiate<T>(identifier: String) -> T {
return instantiateViewControllerWithIdentifier(identifier) as! T
@mayoff
mayoff / makeAnimatedGif.m
Created February 16, 2013 23:00
Example of creating an animated GIF on iOS, with no 3rd-party code required. This should also be easy to port to OS X.
#import <UIKit/UIKit.h>
#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/MobileCoreServices.h>
static UIImage *frameImage(CGSize size, CGFloat radians) {
UIGraphicsBeginImageContextWithOptions(size, YES, 1); {
[[UIColor whiteColor] setFill];
UIRectFill(CGRectInfinite);
CGContextRef gc = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(gc, size.width / 2, size.height / 2);