Skip to content

Instantly share code, notes, and snippets.

#import <UIKit/UIKit.h>
@interface UIImage (Tint)
- (UIImage *)translucentImageWithAlpha:(CGFloat)alpha;
- (UIImage *)tintedGradientImageWithColor:(UIColor *)tintColor;
- (UIImage *)tintedImageWithColor:(UIColor *)tintColor;
@end
#import <UIKit/UIKit.h>
IB_DESIGNABLE
@interface FlatButton : UIButton
@property (nonatomic, getter=isFilled) IBInspectable BOOL filled;
@property (nonatomic) IBInspectable CGFloat cornerRadius;
@property (nonatomic) IBInspectable CGFloat borderWidth;
@stephsharp
stephsharp / EmbedSegue.h
Last active October 28, 2015 10:08
Embed segue for iOS 6 & 7 (using constraints to pin edges of subview to container view)
//
// EmbedSegue.h
// Created by Stephanie Sharp on 20/02/14.
//
#import <UIKit/UIKit.h>
@interface EmbedSegue : UIStoryboardSegue
@property (nonatomic) UIView *containerView;
@stephsharp
stephsharp / iOS5EmbedSegue.h
Created June 14, 2013 01:35
Embed Segue for iOS5
//
// iOS5EmbedSegue.h
// Created by Stephanie Sharp on 2/05/13.
//
#import <UIKit/UIKit.h>
@interface iOS5EmbedSegue : UIStoryboardSegue
@property (nonatomic, strong) UIView * containerView;
@stephsharp
stephsharp / ReadFromPList.m
Last active December 18, 2015 11:58
Snippet to read data from a property list
// Helpful tutorial:
// http://www.theappcodeblog.com/2011/05/30/property-list-tutorial-using-plist-to-store-user-data/
// Get property list from main bundle
NSString * plistPath = [[NSBundle mainBundle] pathForResource:@"PListName" ofType:@"plist"];
// Read property list into memory as an NSData object
NSData * plistXML = [[NSFileManager defaultManager] contentsAtPath:plistPath];
NSString * errorDesc = nil;
NSPropertyListFormat format;
@stephsharp
stephsharp / LoadingView.h
Created July 28, 2013 23:40
Simple iOS loading view
//
// LoadingView.h
// Created by Stephanie Sharp on 26/05/13.
//
// http://www.sitepoint.com/all-purpose-loading-view-for-ios/
// http://www.cocoawithlove.com/2009/04/showing-message-over-iphone-keyboard.html
#import <UIKit/UIKit.h>
@interface LoadingView : UIView
# Mac OS X
*.DS_Store
# Xcode
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
*.xcuserstate
project.xcworkspace/
@stephsharp
stephsharp / ViewController.h
Last active December 21, 2015 10:09
Insert an object into a property of type NSArray by creating a mutable copy.
@property (nonatomic, retain) NSArray * pins;
@stephsharp
stephsharp / README.md
Last active December 25, 2015 09:59
Sample code for Stack Overflow question about using colour swatches in a Shopify theme (http://stackoverflow.com/questions/19227823/how-can-i-create-smarter-swatches-for-a-shopify-theme)
@stephsharp
stephsharp / UIImage+Tint.h
Last active August 29, 2017 19:32
UIImage+Tint
//
// UIImage+Tint.h
// Created by Stephanie Sharp on 5/03/2014.
//
#import <UIKit/UIKit.h>
@interface UIImage (Tint)
- (UIImage *)translucentImageWithAlpha:(CGFloat)alpha;