Skip to content

Instantly share code, notes, and snippets.

View billburgess's full-sized avatar

Bill Burgess billburgess

View GitHub Profile
@jonathan-beebe
jonathan-beebe / clean_old_code_simulators.sh
Last active February 12, 2019 19:40
Clean out unused Xcode Simulators
# Close Xcode & the iOS Simulator
# http://stackoverflow.com/a/30940055
# Remove any old runtimes from this directory.
cd /Library/Developer/CoreSimulator/Profiles/Runtimes
# e.g.
sudo rm -rf iOS\ 8.1.simruntime
# http://stackoverflow.com/a/11790983
# Remove the download receipts for simulators you don't need anymore.
@asmallteapot
asmallteapot / .gitattributes
Last active March 31, 2022 11:43
Diff Xcode localizable strings files in Git.
*.strings utf16 diff=localizablestrings
@jverkoey
jverkoey / shouldAutorotate_nonintrusive.m
Last active August 29, 2015 13:57
Implementing UINavigationController/UITabBarController support for shouldAutorotate without subclassing or extending.
// Add this to your app delegate.
// Neither `UINavigationController` nor `UITabBarController` have the slightest decency to ask their
// visible view controller whether IT would like to rotate and just go on and do whatever the hell
// they please. This'll show 'em.
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
UIViewController* topViewController = window.rootViewController;
do {
// Navigate modal controllers.
@JaviSoto
JaviSoto / gist:6516942
Created September 10, 2013 22:57
iOS 7 Parallax effect
@interface UIView (JSParallaxEffect)
- (void)js_addParallaxEffectWithMaxOffset:(CGFloat)maxOffset;
@end
@soffes
soffes / Podfile
Created May 13, 2013 15:46
Seesaw Podfile
platform :ios, '5.0'
# Awesome networking
pod 'AFNetworking'
# Backported UICollectionView
pod 'PSTCollectionView'
# Rich text
pod 'TTTAttributedLabel'
@mattt
mattt / uiappearance-selector.md
Last active March 19, 2024 12:52
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' | \
@asmallteapot
asmallteapot / objc-style.mdown
Created August 21, 2012 20:58
Objective-C with Teapot Characteristics

(This is a first draft)

Some notes

  • I strongly prefer hard tabs, and set my editor to render them four columns wide.
    • I do, however, understand the rationale behind using four-wide soft tabs, and will expand on this in a later draft.
  • BSD Kernel Normal Form is the one true indentation style.

Object literals

@nfarina
nfarina / UIView+FrameAdditions.h
Created August 21, 2012 06:40
UIView Frame helper getter/setter category methods
#import <UIKit/UIKit.h>
@interface UIView (SMFrameAdditions)
@property (nonatomic, assign) CGPoint $origin;
@property (nonatomic, assign) CGSize $size;
@property (nonatomic, assign) CGFloat $x, $y, $width, $height; // normal rect properties
@property (nonatomic, assign) CGFloat $left, $top, $right, $bottom; // these will stretch the rect
@end
@asmallteapot
asmallteapot / Prefix.pch
Created March 26, 2012 15:28
Macro to make accessing custom methods on your app delegate easy.
#import "STAppDelegate.h"
#define ST_APP_DELEGATE (STAppDelegate *)[[UIApplication sharedApplication] delegate]
// UIImage+Alpha.h
// Created by Trevor Harmon on 9/20/09.
// Free for personal or commercial use, with or without modification.
// No warranty is expressed or implied.
// Helper methods for adding an alpha layer to an image
@interface UIImage (Alpha)
- (BOOL)hasAlpha;
- (UIImage *)imageWithAlpha;
- (UIImage *)transparentBorderImage:(NSUInteger)borderSize;