Skip to content

Instantly share code, notes, and snippets.

View Changzw's full-sized avatar
🎯
Focusing

Fri. Changzw

🎯
Focusing
View GitHub Profile
@Changzw
Changzw / CIFilter+Extension.swift
Created April 22, 2022 15:09 — forked from trilliwon/CIFilter+Extension.swift
CIFilter+Extension.swift
//
// Created by はるふ on 2017/12/11.
// Copyright © 2017年 ha1f. All rights reserved.
//
import Foundation
import CoreImage
import AVFoundation
extension CIFilter {
@Changzw
Changzw / Slow_Compiling_Swift_Code.swift
Last active May 24, 2021 10:55 — forked from tylermilner/Slow_Compiling_Swift_Code.swift
Code samples of common sources of slowdowns for the Swift 2/3 compiler.
//
// The code snippets below showcase common "problem code" that can take a long time to compile.
// These examples were primarily observed in Swift 2/3 and may no longer be relevant in Swift 4 or higher.
//
/// 1. Array concatenation
// Observed by Robert Gummesson - https://medium.com/@RobertGummesson/regarding-swift-build-time-optimizations-fc92cdd91e31#c75c
// Joining two arrays together with the '+' operator can be expensive to compile.
let someArray = ["a", "b"] + ["c", "d"]
@Changzw
Changzw / cloudSettings
Last active September 18, 2020 06:10
Trim, crop, remove audio from video.
{"lastUpload":"2020-09-18T06:10:17.714Z","extensionVersion":"v3.4.3"}
@Changzw
Changzw / universal-framework.sh
Created October 25, 2018 09:23 — forked from cromandini/universal-framework.sh
This run script will build the iphoneos and iphonesimulator schemes and then combine them into a single framework using the lipo tool (including all the Swift module architectures).
#!/bin/sh
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
# 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}" clean build
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
@Changzw
Changzw / PathIntersection.m
Created October 8, 2018 07:11
judge CGPath Intersection
BOOL CGPathIntersectsCircle(CGPathRef path, CGPoint center, CGFloat radius){
CGPathRef extendPath;
extendPath = CGPathCreateCopyByStrokingPath(path, NULL, radius,
kCGLineCapRound,
kCGLineJoinRound, 0.0);
if (CGPathContainsPoint(extendPath, NULL, center, NO)){
CGPathRelease(extendPath);
return YES;
}
CGPathRelease(extendPath);
@Changzw
Changzw / gestureSubclass.md
Last active September 21, 2018 05:10
the method of realizing one finger rotation