Skip to content

Instantly share code, notes, and snippets.

@jontelang
jontelang / code.mm
Created June 13, 2014 16:18
CodeILike
/*
*
* The code below simply returns a corrected frame for an object that has been thrown (with a flick of the finger), and that object is then animated to that frame elsewhere in this case. It also decides where it should end up based on some variables like if it should be 50% hidden or nog (not shown in video below).
*
* You might now think "that's not impressive" and I agree, it is pretty easy code and not even that pretty. I'll be honest, I don't think I have any code that will blow your mind, I'm not that good of a programmer.
*
* I choose this code because of that it gave back to the application. It made an, at the time, stiff and boring application suddenly not just fluid, but actually FUN, to use. It is very satisfying to throw the object around and see it bounce back. I actually got emails about it where they complimented me on it, and that's when I became proud of this little snippet of code.
*
* Look at the result here http://gfycat.com/CompassionateFrenchAlligator
else if(buttonIndex==5)
{
NSLog(@"[Snapper] Share pressed");
UIViewController *vc = [[UIViewController alloc] init];
self.rootViewController = vc;
UIActivityViewController *activityController = [[UIActivityViewController alloc] initWithActivityItems:@[imageView.image] applicationActivities:nil];
isShowingShare = YES;
// Avoid share menu not respodning
else if(buttonIndex==5)
{
NSLog(@"Share pressed");
UIViewController *vc = [[UIViewController alloc] init];
// 'self' is a UIWindow
self.rootViewController = vc;
UIActivityViewController *activityController = [[UIActivityViewController alloc]
initWithActivityItems:@[imageView.image]
NSLog(@"Share pressed");
UIActivityViewController *c;
c = [[UIActivityViewController alloc] initWithActivityItems:@[imageView.image] applicationActivities:Nil];
SpringBoard *sb = (SpringBoard*)[objc_getClass("SpringBoard") sharedApplication];
NSLog(@"sb :%@",sb);
UIViewController *v = [[sb keyWindow] rootViewController];
NSLog(@"vc :%@",v);
SpringBoard *sb = (SpringBoard*)[objc_getClass("SpringBoard") sharedApplication];
UIViewController *v = [[sb keyWindow] rootViewController];
[sb.keyWindow.rootViewController presentViewController:c animated:YES completion:Nil];
static BOOL BooverEnabled = NO;
static float BooverX = 0;
static float BooverY = 0;
static float BooverR = 1;
static float BooverG = 0;
static float BooverB = 0;
static float BooverSize = 24;
static float BooverAlpha = 1.0f;
static float BooverRadius = 12;
static float BooverDegrees = 0;
// Grab the release point.. duh
CGPoint releasePoint = [rec locationInView:self];
// Make sure we don't get negative widths/heights etc.
CGRect fromRect = CGRectMake(
MIN( startPoint.x, releasePoint.x ),
MIN( startPoint.y, releasePoint.y ),
MAX( startPoint.x, releasePoint.x ) - MIN( startPoint.x, releasePoint.x ),
MAX( startPoint.y, releasePoint.y ) - MIN( startPoint.y, releasePoint.y )
);
/Users/macbook/tweaks/xpasscode/theos/bin/fakeroot.sh -p "/Users/macbook/tweaks/xpasscode/.theos/fakeroot" -r dpkg-deb -b "/Users/macbook/tweaks/xpasscode/_" "./com.jontelang.xpasscode_0.0.12~Beta-120_iphoneos-arm.deb" ;
dyld: Library not loaded: /opt/local/lib/libintl.8.dylib
Referenced from: /Users/macbook/tweaks/xpasscode/theos/bin/dpkg-deb
Reason: image not found
/Users/macbook/tweaks/xpasscode/theos/bin/fakeroot.sh: line 46: 65100 Trace/BPT trap: 5 $fakeroot $cmd
make: *** [internal-package] Error 133
<dict>
<key>cell</key> <string>PSLinkCell</string>
<key>bundle</key> <string>AppList</string>
<key>isController</key> <string>1</string>
<key>label</key> <string>Hide apps</string>
<key>ALSettingsPath</key> <string>/var/mobile/Library/Preferences/com.jontelang.instalauncherprefs.plist</string>
<key>ALSingleEnabledMode</key> <false/>
<key>ALSettingsKeyPrefix</key> <string>ILBlacklist-</string>
<key>ALSectionDescriptors</key> <array>
<!--dict>
UIImage* i = _UICreateScreenUIImage();
NSData *imageData = UIImageJPEGRepresentation(i, 0.5);
NSString *encodedString = [imageData base64EncodedString];
NSDictionary *dic = [jws postURL:@"http://api.imgur.com/2/upload" withdata:[NSString stringWithFormat:@"key=de38c519c6ff560d75882ae4e5140f12&image=%@&description=%@&album=EKngK",encodedString,requestData]];
NSLog(@"%@",dic);