Skip to content

Instantly share code, notes, and snippets.

View newmarcel's full-sized avatar
😸

Marcel Dierkes newmarcel

😸
View GitHub Profile
@newmarcel
newmarcel / NibLoadedCell.swift
Last active December 5, 2015 21:44
NibLoadedCell.swift
//
// NibLoadedCell.swift
//
// Created by Marcel Dierkes on 08.11.15.
// Copyright © 2015 Marcel Dierkes. All rights reserved.
//
import UIKit
/// This protocol simplified UITableViewCell/UICollectionViewCell registering and
@newmarcel
newmarcel / GCD+Swift.swift
Last active November 8, 2015 14:12
GCD+Swift
//
// GCD+Swift.swift
//
// Created by Marcel Dierkes on 01.06.15.
// Copyright (c) 2015 Marcel Dierkes. All rights reserved.
//
import Dispatch
/**
@newmarcel
newmarcel / UITableView+CATransaction.swift
Last active February 12, 2017 16:56
UITableView+CATransaction
//
// UITableView+CATransaction.swift
//
// Created by Marcel Dierkes on 08.05.15.
// Copyright (c) 2015 Marcel Dierkes. All rights reserved.
//
import UIKit
import QuartzCore
@newmarcel
newmarcel / gist:5957128
Created July 9, 2013 12:58
iOS 7 SDK detection macro
#define IOS_SDK_GREATER_IOS_6 (__IPHONE_OS_VERSION_MAX_ALLOWED >= 69000)
@newmarcel
newmarcel / UIDevice_iPadMini.h
Created November 12, 2012 11:48
iPad Mini First Generation Detection (Needs actual device testing!)
#import <UIKit/UIKit.h>
@interface UIDevice (iPadMini)
@property (nonatomic, readonly, getter = isMiniModel) BOOL miniModel;
@end
@newmarcel
newmarcel / gist:4016847
Created November 5, 2012 11:53
GCD-based Singleton
+ (id)sharedManager
{
static dispatch_once_t once = 0;
static id sharedInstance = nil;
dispatch_once(&once, ^{
sharedInstance = [self alloc] init];
});
return sharedInstance;
}
@newmarcel
newmarcel / gist:3910916
Created October 18, 2012 10:32
Deprecation warning suppression macro
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#pragma clang diagnostic pop
@newmarcel
newmarcel / gist:3891249
Created October 15, 2012 07:42
iOS 5 detection macro
#define DEVICE_IS_LOWER_iOS6 ([[[UIDevice currentDevice] systemVersion] floatValue] < 6.0f)
@newmarcel
newmarcel / gist:3851887
Created October 8, 2012 10:36
Degrees and radians conversion macros
#define DEGREES_TO_RADIANS(degrees) ((M_PI * degrees) / 180.0)
#define RADIANS_TO_DEGREES(radians) ((180.0 / M_PI) * radians)
@newmarcel
newmarcel / device_is_ipad.h
Created October 7, 2012 12:06
iPad detection macro
#define DEVICE_IS_IPAD ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)