Skip to content

Instantly share code, notes, and snippets.

@KaQuMiQ
KaQuMiQ / convertFrameworks.sh
Created January 19, 2021 12:02
Convert fat binary framework into XCFramework
#! /bin/bash
mkdir ./arm64
mkdir ./x86_64
find "./" -name '*.framework' -type d | while read -r FRAMEWORK
do
echo "Preparing framework: $FRAMEWORK"
FRAMEWORK_EXECUTABLE_NAME=$(/usr/libexec/PlistBuddy -c "Print CFBundleExecutable" "$FRAMEWORK/Info.plist")
@nesium
nesium / class_addMethod.swift
Created June 12, 2018 10:18
Add method to Obj-C class from Swift
let cls: AnyClass = NSClassFromString("NSConcreteValue")!
let types = "d@:" // [NSString stringWithFormat:@"%s%s%s", @encode(double), @encode(id), @encode(SEL)]
let block: @convention(block) (AnyObject?) -> Double = { (self: AnyObject!) -> (Double) in
return 1.0
}
let imp = imp_implementationWithBlock(unsafeBitCast(block, to: AnyObject.self))
class_addMethod(cls, Selector("doubleValue"), imp, types)
@aldo-jlaurenstin
aldo-jlaurenstin / MakeTransparentHoleOnOverlayView.swift
Last active May 27, 2024 12:09
Make a Transparent Hole on an Overlay UIView
//
// MakeTransparentHoleOnOverlayView.swift
//
// Created by James Laurenstin on 2015-04-10.
// Copyright (c) 2015 Aldo Group Inc. All rights reserved.
//
import UIKit
class MakeTransparentHoleOnOverlayView: UIView {