This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Created by はるふ on 2017/12/11. | |
// Copyright © 2017年 ha1f. All rights reserved. | |
// | |
import Foundation | |
import CoreImage | |
import AVFoundation | |
extension CIFilter { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2020-09-18T06:10:17.714Z","extensionVersion":"v3.4.3"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |