Skip to content

Instantly share code, notes, and snippets.

#define DEG2RAD(angle) (angle * M_PI) / 180.0
#define RAD2DEG(rad) (rad * 180.0) / M_PI
- (CAShapeLayer *)createPieSliceLayer {
CGPoint center = CGPointMake(100, 100);
CGFloat radius = 100;
CGPathRef fromPath = [self createPieSlicePathWithCenter:center radius:radius startAngle:-60 endAngle:60];
CGPathRef toPath = [self createPieSlicePathWithCenter:center radius:radius startAngle:120 endAngle:-120];
@marcelomp
marcelomp / gist:399d7dfbf9a08083512918ff62492cad
Created October 25, 2016 12:40 — forked from sponno/gist:7228256
Xcode build lipo script
# define output folder environment variable
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# Step 1. Build Device and Simulator versions
xcodebuild -target ${PROJECT_NAME} ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}"
BUILD_ROOT="${BUILD_ROOT}" xcodebuild -target ${PROJECT_NAME} -configuration ${CONFIGURATION} -sdk iphonesimulator -arch i386 BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"
# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)