Skip to content

Instantly share code, notes, and snippets.

View arielelkin's full-sized avatar

Ariel Elkin arielelkin

View GitHub Profile
@arielelkin
arielelkin / SegueSlideFromTop.m
Created July 30, 2012 11:35
Custom Segue to slide a view controller from the top
-(void)perform{
UIViewController *splashScreen = self.sourceViewController;
UIViewController *mainScreen = self.destinationViewController;
[splashScreen.view addSubview:mainScreen.view];
mainScreen.view.center = CGPointMake(mainScreen.view.center.x, mainScreen.view.center.y-600);
[UIView animateWithDuration:1
@arielelkin
arielelkin / UnzipEmbeddedPack.m
Created June 29, 2012 10:02
unzipping an embedded tune pack
-(void)unzipEmbeddedPack{
NSString *embeddedPackPath = [NSString stringWithFormat:@"%@/packName.zip", [[NSBundle mainBundle] resourcePath]];
ZipArchive *za = [[ZipArchive alloc] init];
[za UnzipOpenFile:embeddedPackPath Password:@"abf26a4849e5d97882fcdce5757ae6028281192a"];
//make sure to unzip to tune packs on disk
NSError *deleteError = nil;
[[NSFileManager defaultManager] removeItemAtPath:embeddedPackPath error:&deleteError];
if(deleteError != nil) NSLog(@"error deleting: %@", deleteError);
@arielelkin
arielelkin / Navigator.m
Created June 26, 2012 16:15
Navigation with a huge memory footpring
@implementation CBNavigator
int currentPage = -1;
-(void)viewDidAppear:(BOOL)animated{
NSLog(@"Navigator appeared");
if(currentPage == -1){
currentPage++;
UIViewController *nextPageVC = [self.storyboard instantiateViewControllerWithIdentifier:[NSString stringWithFormat:@"%d", currentPage ]];
[self presentModalViewController:nextPageVC animated:YES];
@arielelkin
arielelkin / Recorder.h
Created June 14, 2012 22:04
SimpleAudioRecording
//
// Recorder.h
//
// Created by Ariel Elkin on 14/05/2012.
//
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
@interface NarrationManager : NSObject
@arielelkin
arielelkin / gist:2843907
Created May 31, 2012 14:48
Adding a loading wheel on top of some translucent shit
//You probably won't be able to use "self" in OF,
//so I'll let you figure out how to obtain the device's
//the width and height from OF
float screenWidth = self.view.frame.size.width;
float screenHeight = self.view.frame.size.height;
UIView *translucentShit = [[UIView alloc] initWithFrame:CGRectMake(0, 0, screenWidth, screenHeight)];
[translucentShit setBackgroundColor:[UIColor blackColor]];