Skip to content

Instantly share code, notes, and snippets.

Avatar

Steven Troughton-Smith steventroughtonsmith

View GitHub Profile
View RCGRightClickInteraction.swift
//
// RCGRightClickGestureRecognizer.swift
// RightClickGestureRecognizer
//
// Created by Steven Troughton-Smith on 27/07/2022.
//
import UIKit
class RCGRightClickInteraction: UIContextMenuInteraction {
@steventroughtonsmith
steventroughtonsmith / UICollectionView+Swizzles.swift
Created Apr 22, 2022
UICollectionView _shouldBecomeFocusedOnSelection Mac Catalyst
View UICollectionView+Swizzles.swift
//
// MRDSwizzleController.swift
// MobileRadio
//
// Created by Steven Troughton-Smith on 22/12/2021.
// Copyright © 2021 High Caffeine Content. All rights reserved.
//
import UIKit
View tbdswizzler.m
//
// main.m
// tbdswizzler
//
// Created by Steven Troughton-Smith on 10/12/2016.
// Copyright © 2016 High Caffeine Content. All rights reserved.
//
#import <Foundation/Foundation.h>
@steventroughtonsmith
steventroughtonsmith / palettes.txt
Created Jun 9, 2020
Pastel 1.0 default palettes
View palettes.txt
{
"Autumn Approaches" => {
"colors" => [
0 => "#220204"
1 => "#9f311b"
2 => "#e17817"
3 => "#6a1d18"
4 => "#d64019"
]
}
@steventroughtonsmith
steventroughtonsmith / PSTLDraggableColorSwatchView.h
Last active May 6, 2021
Color Swatch view for Mac Catalyst that implements inter-app drag & drop
View PSTLDraggableColorSwatchView.h
//
// PSTLDraggableColorSwatchView.h
// Pastel
//
// Created by Steven Troughton-Smith on 06/03/2020.
// Copyright © 2020 Steven Troughton-Smith. All rights reserved.
//
@import UIKit;
@steventroughtonsmith
steventroughtonsmith / MRDMenuView.h
Created Mar 1, 2020
Simplified iOS menu view wired up to UIMenuBuilder
View MRDMenuView.h
//
// MRDMenuView.h
// MobileRadio
//
// Created by Steven Troughton-Smith on 29/02/2020.
// Copyright © 2020 High Caffeine Content. All rights reserved.
//
#import <UIKit/UIKit.h>
@steventroughtonsmith
steventroughtonsmith / Info.plist
Created Oct 27, 2019
[Catalyst] Registering for & responding to AppleScript events in a Mac Catalyst app
View Info.plist
<key>NSAppleScriptEnabled</key>
<true/>
<key>OSAScriptingDefinition</key>
<string>ScriptableTasks.sdef</string>
@steventroughtonsmith
steventroughtonsmith / UIColor+AccentColor.m
Created Oct 27, 2019
[Catalyst] Provides access to macOS Accent Color
View UIColor+AccentColor.m
@implementation UIColor (AppleAccentColor)
+(UIColor *)CATALYSTAccentColor
{
BOOL hasAccentSet = ([[NSUserDefaults standardUserDefaults] objectForKey:@"AppleAccentColor"] != nil);
NSInteger systemAccentColor = [[NSUserDefaults standardUserDefaults] integerForKey:@"AppleAccentColor"];
UIColor *returnColor = [UIColor systemBlueColor];
if (hasAccentSet)
@steventroughtonsmith
steventroughtonsmith / UIView+Tooltips.h
Last active May 6, 2021
WIP tooltips for Mac Catalyst
View UIView+Tooltips.h
//
// UIView+Tooltips.h
// Crossword
//
// Created by Steven Troughton-Smith on 13/09/2019.
// Copyright © 2019 Steven Troughton-Smith. All rights reserved.
//
#import <UIKit/UIKit.h>
@steventroughtonsmith
steventroughtonsmith / bitcode2intel
Created May 18, 2019
Converts an ARM64 iOS app with Bitcode into an X86_64 variant
View bitcode2intel
#!/bin/bash
TARGET="$( cd "$(dirname "$1")" ; pwd -P )/$1"
SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
TARGET_ARCH=x86_64
export IPHONEOS_DEPLOYMENT_TARGET=12.2
rm -r /tmp/bitcode2intel
mkdir -p /tmp/bitcode2intel
pushd /tmp/bitcode2intel