start new:
tmux
start new with session name:
tmux new -s myname
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' | \
Of the many tools available for fuzzing, I've found that LLVM's libfuzzer is the easiest to use for Swift on macOS. Other tools seem to have a list of requirements taht are difficult to meet. libfuzzer on the other hand is built into LLVM and is available on macOS in the custom Swift toolchains: https://www.swift.org/download/
In this document I'll describe how to use libfuzzer with Swift and Swift Packages.
I used this setup to fuzz an SVG Renderer package that I am building. I was able to find and fix a number of bugs in my SVG parsing code using libfuzzer in basically no time at all.
/** | |
Provides the ability to verify key paths at compile time. | |
If "keyPath" does not exist, a compile-time error will be generated. | |
Example: | |
// Verifies "isFinished" exists on "operation". | |
NSString *key = SQKeyPath(operation, isFinished); | |
// Verifies "isFinished" exists on self. |
// | |
// A Swift property wrapper for adding "indirect" to struct properties. | |
// Enum supports this out of the box, but for some reason struct doesn't. | |
// | |
// This is useful when you want to do something recursive with structs like: | |
// | |
// struct Node { | |
// var next: Node? | |
// } | |
// |
// Smart little helper to find main thread hangs. Enable in appDidFinishLaunching. | |
// Only available with source code in DEBUG mode. | |
@interface PSPDFHangDetector : NSObject | |
+ (void)startHangDetector; | |
@end | |
@implementation PSPDFHangDetector | |
+ (void)startHangDetector { | |
#ifdef DEBUG |
// Convert an EXIF image orientation to an iOS one. | |
// reference see here: http://sylvana.net/jpegcrop/exif_orientation.html | |
+ (UIImageOrientation) exifOrientationToiOSOrientation:(int)exifOrientation { | |
UIImageOrientation o = UIImageOrientationUp; | |
switch (exifOrientation) { | |
case 1: o = UIImageOrientationUp; break; | |
case 3: o = UIImageOrientationDown; break; | |
case 8: o = UIImageOrientationLeft; break; | |
case 6: o = UIImageOrientationRight; break; |
/////////////////////////////////////////////////////////////////////////////////////////// | |
#pragma mark - Warn if we KVO a weak property | |
// Doesn't support key paths. | |
static BOOL PSPDFIsWeakProperty(id object, NSString *keyPath) { | |
objc_property_t property = class_getProperty([object class], keyPath.UTF8String); | |
if (property) { | |
// https://developer.apple.com/library/mac/documentation/cocoa/conceptual/objcruntimeguide/articles/ocrtpropertyintrospection.html | |
const char *attributes = property_getAttributes(property); | |
return attributes && strstr(attributes, ",W"); |
// | |
// GHReadWriteQueue.h | |
// GitHub | |
// | |
// Created by Justin Spahr-Summers on 2014-03-24. | |
// Copyright (c) 2014 GitHub. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
#import <objc/runtime.h> | |
#import <stdlib.h> | |
// declare some of the Objective-C runtime's private parts where we can see them | |
typedef struct _NXMapTable NXMapTable; | |
extern NXMapTable *gdb_objc_realized_classes; | |
extern void *NXMapInsert(NXMapTable *table, const void *key, const void *value); | |
@implementation NSObject (Poser) |