Skip to content

Instantly share code, notes, and snippets.

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep -H UI_APPEARANCE_SELECTOR ./* | sed 's/ __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0) UI_APPEARANCE_SELECTOR;//'

UIActivityIndicatorView

#import <UIKit/UIKit.h>
#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/MobileCoreServices.h>
static UIImage *frameImage(CGSize size, CGFloat radians) {
UIGraphicsBeginImageContextWithOptions(size, YES, 1); {
[[UIColor whiteColor] setFill];
UIRectFill(CGRectInfinite);
CGContextRef gc = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(gc, size.width / 2, size.height / 2);
# !/bin/bash
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
@Anish-kumar-dev
Anish-kumar-dev / gist:4d563ac1e9483ae70320
Last active September 22, 2015 07:05 — forked from steipete/gist:6133152
Create a hash from a CGRect
NSUInteger PSPDFHashFromCGRect(CGRect rect) {
return (*(NSUInteger *)&rect.origin.x << 10 ^ *(NSUInteger *)&rect.origin.y) + (*(NSUInteger *)&rect.size.width << 10 ^ *(NSUInteger *)&rect.size.height);
}
@Anish-kumar-dev
Anish-kumar-dev / ioslocaleidentifiers.csv
Created September 24, 2015 08:34 — forked from jacobbubu/ioslocaleidentifiers.csv
iOS Locale Identifiers
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@Anish-kumar-dev
Anish-kumar-dev / routeOnMap.m
Created December 28, 2015 12:47 — forked from siqin/routeOnMap.m
Draw route on MKMapView
#pragma mark -
- (void)drawTestLine
{
// test code : draw line between Beijing and Hangzhou
CLLocation *location0 = [[CLLocation alloc] initWithLatitude:39.954245 longitude:116.312455];
CLLocation *location1 = [[CLLocation alloc] initWithLatitude:30.247871 longitude:120.127683];
NSArray *array = [NSArray arrayWithObjects:location0, location1, nil];
[self drawLineWithLocationArray:array];
}
- (void)setMenuViewAsRootViewContoller{
UIViewController* rearViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"navigationController"];
UIViewController* frontViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"leftMenuViewController"];
MFSideMenuContainerViewController *container = [MFSideMenuContainerViewController
containerWithCenterViewController:rearViewController
leftMenuViewController:frontViewController
rightMenuViewController:nil];
// Create a basic animation changing the transform.scale value
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
// Set the initial and the final values
[animation setFromValue:[NSNumber numberWithFloat:1.5f]];
[animation setToValue:[NSNumber numberWithFloat:1.f]];
// Set duration
[animation setDuration:0.5f];
@Anish-kumar-dev
Anish-kumar-dev / Display.swift
Created February 8, 2017 15:11 — forked from hfossli/Display.swift
Display mode
import UIKit
public enum DisplayType {
case unknown
case iphone4
case iphone5
case iphone6
case iphone6plus
static let iphone7 = iphone6
static let iphone7plus = iphone6plus
// Following methods will slow down all animation used in app.
extension UIWindow {
var slowAnimationsEnabled: Bool {
get {
return layer.speed != 1
}
set {