Skip to content

Instantly share code, notes, and snippets.

View Lascorbe's full-sized avatar
👋
Hi there!

Luis Ascorbe Lascorbe

👋
Hi there!
View GitHub Profile
@Abizern
Abizern / .gitignore
Created November 21, 2010 12:45
Global git ignore file
# Mac OS X
*.DS_Store
# Xcode
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
*.xcuserstate
project.xcworkspace/
@Jaybles
Jaybles / UIDeviceHardware.h
Created October 28, 2011 19:33
UIDeviceHardware - Determine iOS device being used
//
// UIDeviceHardware.h
//
// Used to determine EXACT version of device software is running on.
#import <Foundation/Foundation.h>
@interface UIDeviceHardware : NSObject
- (NSString *) platform;
@ksm
ksm / gist:1875946
Created February 21, 2012 11:20
CALayer shadowPath done the right way
/*
Source: Apple Developer - Understanding iOS View Compositing
*/
// setup the layer
CALayer *layer = view.layer;
layer.bounds = sublayer_bounds;
layer.backgroundColor = random_color();
// set the shadow properties on the layer
@0xced
0xced / XCDFakeCarrier.m
Last active March 5, 2023 22:07
Hack to choose the displayed carrier name in the iOS simulator
//
// Copyright (c) 2012-2015 Cédric Luthi / @0xced. All rights reserved.
//
#import <Foundation/Foundation.h>
#if TARGET_OS_SIMULATOR
static const char *fakeCarrier;
static const char *fakeTime;
@mattt
mattt / uiappearance-selector.md
Last active June 4, 2024 13:28
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \
@rgm
rgm / stamp-icon.rb
Last active September 11, 2023 12:40
Add the current version and build number on your iOS app icon
#!/usr/bin/env ruby
# Requires ImageMagick: `brew install imagemagick`
# Requires version.sh from https://gist.github.com/osteslag/1089407
#
# Set RGM_STAMP_VERSION_ON_ICONS=1 in your build settings to enable/disable
# stamping on Debug/Relase configurations.
#
# Make base unstamped versions Icon.base.png, &c. in the source tree. The
# script will make stamped versions Icon.png, &c. It relies on Xcode to copy
@rcabamo
rcabamo / Archive & upload IPA
Last active December 17, 2015 19:49
Archive and upload ipa
#!/bin/sh
# Requeriments: https://github.com/nomad/shenzhen by @mattt
#constants
MY_USERNAME = "rcabamo"
CONFIGURATION_NAME="Release"
PROJDIR="/Users/${MY_USERNAME}/Develop/iOS/rubis"
APPLICATION_NAME="rubis"
# Compile && Archive
@steipete
steipete / PSPDFUIKitMainThreadGuard.m
Last active May 27, 2024 12:11
This is a guard that tracks down UIKit access on threads other than main. This snippet is taken from the commercial iOS PDF framework http://pspdfkit.com, but relicensed under MIT. Works because a lot of calls internally call setNeedsDisplay or setNeedsLayout. Won't catch everything, but it's very lightweight and usually does the job.You might n…
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (http://opensource.org/licenses/MIT)
//
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
// PLEASE DUPE rdar://27192338 (https://openradar.appspot.com/27192338) if you would like to see this in UIKit.
#import <objc/runtime.h>
#import <objc/message.h>
@chriseidhof
chriseidhof / gist:5687433
Created May 31, 2013 19:36
A method that you can use in your test cases so you'll have a managed object context around.
- (NSManagedObjectContext*)managedObjectContextForTesting {
NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"YourModelName" withExtension:@"momd"];
NSManagedObjectModel* model = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
NSPersistentStoreCoordinator* coordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model];
[coordinator addPersistentStoreWithType:NSInMemoryStoreType configuration:nil URL:nil options:nil error:NULL];
NSManagedObjectContext* managedObjectContext= [[NSManagedObjectContext alloc] init];
managedObjectContext.persistentStoreCoordinator = coordinator;
return managedObjectContext;
}
@eternalstorms
eternalstorms / Apple Evangelists.txt
Created June 12, 2013 09:07
Apple Evangelists (WWDC 2013)
UI- and App Frameworks Evangelist - Jake Behrens, behrens@apple.com, twitter: @Behrens
- What's new in Cocoa
- Accessibility in iOS
- Building User Interfaces for iOS 7
- Getting Started with UIKit Dynamics
- What's new in Cocoa Touch
- What's New With Multitasking
- Best Practices for Cocoa Animation
- Improving Power Efficiency with App Nap
- Introducing Text Kit