Skip to content

Instantly share code, notes, and snippets.

View jaredsinclair's full-sized avatar

Jared Sinclair jaredsinclair

View GitHub Profile

Set value

GCC_PREPROCESSOR_DEFINITIONS = FOO=My Value

Add Constants.m

It is particularly important to check that the definition of your value exists here, as it will not cause a compilation failure, but instead result in the generation of @"FOO".

@import Foundation;

Repackaging a Fat Static Library as an xcframework

Consider this directory tree from a vendor:

OwningTheLibs/
  OwningTheLibs.a
  include/
    OwningTheLibs/
      OwningTheLibs.h
ACTION = build
AD_HOC_CODE_SIGNING_ALLOWED = NO
ALTERNATE_GROUP = staff
ALTERNATE_MODE = u+w,go-w,a+rX
ALTERNATE_OWNER = grantdavis
ALWAYS_SEARCH_USER_PATHS = NO
ALWAYS_USE_SEPARATE_HEADERMAPS = YES
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer
APPLE_INTERNAL_DIR = /AppleInternal
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation
@jaredsinclair
jaredsinclair / Warnings.xcconfig
Created July 5, 2016 04:34 — forked from steipete/Warnings.xcconfig
The warnings configuration we use in the PSPDFKit iOS framework - http://pspdfkit.com
//
// Warnings.xcconfig
//
// The list of warnings we (don’t) use, and the reasons why.
//
// :MARK: Warnings in use:
// :MARK: -everything
// We want the best possible diagnostics, so we simply enable everything that exists, and then opt–out of what doesn’t make sense for us.
//
// :MARK: - Warnings not to be promoted:
@jaredsinclair
jaredsinclair / gist:6b608ea1a557d81a4b8e
Created September 25, 2014 23:44 — forked from steipete/gist:d76549ec262430354e7c
Maximum Warning Overdrive
-Weverything -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Woverlength-strings -Wshadow -Wundeclared-selector -Wunreachable-code -Wformat=2 -Woverriding-method-mismatch -Wno-objc-missing-property-synthesis -Wno-unused-parameter -Wno-covered-switch-default -Wno-direct-ivar-access -Wno-assign-enum -Wno-float-equal -Wno-switch-enum -Wno-implicit-retain-self -Wno-vla -Wno-pedantic -Wno-explicit-ownership-type -Wno-bad-function-cast -Wno-documentation-unknown-command -Wno-packed
@jaredsinclair
jaredsinclair / gist:2204400
Created March 26, 2012 10:46 — forked from omz/gist:1102091
Creating arbitrarily-colored icons from a black-with-alpha master image (iOS)
// Usage example:
// input image: http://f.cl.ly/items/3v0S3w2B3N0p3e0I082d/Image%202011.07.22%2011:29:25%20PM.png
//
// UIImage *buttonImage = [UIImage ipMaskedImageNamed:@"UIButtonBarAction.png" color:[UIColor redColor]];
// .h
@interface UIImage (IPImageUtils)
+ (UIImage *)ipMaskedImageNamed:(NSString *)name color:(UIColor *)color;
@end