Skip to content

Instantly share code, notes, and snippets.

@4brunu
4brunu / SwiftUI-multiple-alerts
Created September 23, 2021 14:29
SwiftUI - show multiple alerts
struct BlankView: View {
var body: some View {
Text("")
.frame(width: 0, height: 0)
.hidden()
}
}
struct MyScreenView: View {
var body: some View {
@4brunu
4brunu / AsyncAwaitBuildLogs.txt
Created December 20, 2021 00:06
AsyncAwaitBuildLogs.txt
Building SwiftAsyncAwaitExample (Debug|iPhoneSimulator)
Build started 12/19/2021 11:48:58 PM.
Prerequisite 'SwiftAsyncAwaitFramework.xcframework/ios-arm64_x86_64-simulator/SwiftAsyncAwaitFramework.framework/_CodeSignature/CodeResources' is older than the target 'bin/Debug/NativeLibrary.resources/SwiftAsyncAwaitFramework.xcframework/ios-arm64_x86_64-simulator/SwiftAsyncAwaitFramework.framework/_CodeSignature/CodeResources'.
Target 'bin/Debug/NativeLibrary.resources/SwiftAsyncAwaitFramework.xcframework/ios-arm64_x86_64-simulator/SwiftAsyncAwaitFramework.framework/_CodeSignature/CodeResources' is up-to-date
Prerequisite 'SwiftAsyncAwaitFramework.xcframework/ios-arm64_x86_64-simulator/SwiftAsyncAwaitFramework.framework/SwiftAsyncAwaitFramework' is older than the target 'bin/Debug/NativeLibrary.resources/SwiftAsyncAwaitFramework.xcframework/ios-arm64_x86_64-simulator/SwiftAsyncAwaitFramework.framework/SwiftAsyncAwaitFramework'.
Target 'bin/Debug/NativeLibrary.resources/SwiftAsyncAwaitFramework.xcframework/ios-arm
@4brunu
4brunu / fixup-old-macos-sdks.sh
Created November 6, 2021 23:33 — forked from natbro/fixup-old-macos-sdks.sh
script to link older macOS SDKs into newer Xcode so you can target older platforms properly
#!/bin/bash
# ---------------------------------------------------------------------------------------------------------
# place as many old macOS SDKs into the directory with this script e.g. if you have
#
# my-macpro:SDKs natb$ ls -ahl
# total 4254792
# drwxr-xr-x 17 natb admin 578B Nov 21 2017 .
# drwxrwxr-x 24 root admin 884B Aug 29 06:46 ..
# drwxr-xr-x 5 natb admin 170B Oct 17 2017 MacOSX10.10.sdk
@4brunu
4brunu / xcode-previous-older-sdks.md
Created November 6, 2021 23:33 — forked from kenji21/xcode-previous-older-sdks.md
Use previous/older SDKs with Xcode
@4brunu
4brunu / change-sdk.sh
Created November 6, 2021 23:30 — forked from bodja/change-sdk.sh
Download MacOSX SDK version and change minimum sdk version in info.plist
SDK_VERSION=$1
SDK_NAME="MacOSX${SDK_VERSION}.sdk"
TAR_FILE_NAME="${SDK_NAME}.tar.xz"
DOWNLOAD_URL="https://github.com/phracker/MacOSX-SDKs/releases/download/MacOSX10.11.sdk/${TAR_FILE_NAME}"
TAR_FILE_DEST="/tmp/${TAR_FILE_NAME}"
SDK_MIN_VERSION_FILE="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Info.plist"
SDK_DIR="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/"
echo Downloading $SDK_NAME
curl -L $DOWNLOAD_URL -o $TAR_FILE_DEST --progress-bar
@4brunu
4brunu / google-play-services-verification.kt
Created April 15, 2021 09:09
google-play-services-verification.kt
checkGooglePlayServices = { activity ->
val apiAvailability = GoogleApiAvailability.getInstance()
val resultCode = apiAvailability.isGooglePlayServicesAvailable(this)
if (resultCode != ConnectionResult.SUCCESS) {
if (apiAvailability.isUserResolvableError(resultCode)) {
apiAvailability.getErrorDialog(
activity,
resultCode,
PLAY_SERVICES_RESOLUTION_REQUEST
)
@4brunu
4brunu / buildlogs-OSLog.txt
Created April 7, 2021 13:49
Xamarin binding build logs for OSLog
Building MyiOSLib (Debug|iPhoneSimulator)
Build started 4/7/2021 2:49:01 PM.
Environment at start of build:
MONO_DEBUG = disable_omit_fp
LANGUAGE = en
__CFBundleIdentifier = com.microsoft.visual-studio
DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR = /usr/local/share/dotnet
PATH = /Library/Frameworks/Mono.framework/Commands:/Applications/Visual Studio.app/Contents/Resources:/Applications/Visual Studio.app/Contents/MacOS:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:~/.dotnet/tools:/usr/local/share/dotnet
LOGNAME = user
@4brunu
4brunu / buildlogs-os_log_t.txt
Created April 7, 2021 13:47
Xamarin binding build logs for os_log_t
Building MyiOSLib (Debug|iPhoneSimulator)
Build started 4/7/2021 2:46:02 PM.
Environment at start of build:
MONO_DEBUG = disable_omit_fp
LANGUAGE = en
__CFBundleIdentifier = com.microsoft.visual-studio
DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR = /usr/local/share/dotnet
PATH = /Library/Frameworks/Mono.framework/Commands:/Applications/Visual Studio.app/Contents/Resources:/Applications/Visual Studio.app/Contents/MacOS:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:~/.dotnet/tools:/usr/local/share/dotnet
LOGNAME = user
#! /usr/bin/env bash
# IOS.cmake
# Architectures: i386 armv7 armv7s x86_64 arm64
# declare -a ABIs=("SIMULATOR" "OS")
# declare -a ABIs=("SIMULATOR")
# declare -a ABIs=("OS")
# declare -a BUILD_TYPES=("Debug" "Release")
#! /usr/bin/env bash
while [[ $# -gt 1 ]]
do
key="$1"
case $key in
-p|--prefix)
IFS=';' read -ra PREFIX <<< "$2"
shift # past argument