Skip to content

Instantly share code, notes, and snippets.

Videos

//
// KBCollectionExtensions.h
//
// Created by Guy English on 25/02/08.
// Copyright 2008 Kickingbear. All rights reserved.
//
#import <Cocoa/Cocoa.h>
/*
/** Block type used by tkvar_iterate_list.
*
* @param entry The current argument in the vararg list.
*/
typedef void (^TKVAR_Block)(id entry);
/**
* Iterate over a va_list, executing the specified code block for each entry.
*
@Toothpick2012
Toothpick2012 / gist:53972665b23f5b2e4431
Last active August 29, 2015 14:01
该宏定义便于声明一个没有引用计数的变量,谢谢@AlanQuatermain。A simple macro to create a non-retaining reference to an object for use within a block. For variable 'foo' will create non-retained variable '_block_foo' of type 'id'.
#if __has_feature(objc_arc)
# if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_5_0
# define block_unretained(obj) typeof(obj) _block_##obj __weak = (obj)
# else
# define block_unretained(obj) typeof(obj) _block_##obj __unsafe_unretained = (obj)
# endif
#else
# define block_unretained(obj) typeof(obj) _block_##obj __block = (obj)
#endif
//
// NSInvocation+SimpleCreation.h
// MAPI
//
// Created by Tiago Alves on 08/12/13.
// Copyright (c) 2013 Iterar. All rights reserved.
//
#import <Foundation/Foundation.h>
//
// UIView+DEFrameAdditions.h
//
// Copyright (c) 2011-2013 Double Encore, Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
// Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
// Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the distribution. Neither the name of the Double Encore Inc. nor the names of its
// contributors may be used to endorse or promote products derived from this software without specific prior written permission.
// Taken from the commercial iOS PDF framework http://pspdfkit.com.
// Copyright (c) 2013 Peter Steinberger. 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.
#import <objc/runtime.h>
#import <objc/message.h>
// Compile-time selector checks.