Skip to content

Instantly share code, notes, and snippets.

@raphkoebraam
raphkoebraam / .swift
Created April 25, 2025 07:59 — forked from dchohfi/.swift
Apple custom typography
import UIKit
// swiftlint:disable file_length
extension UIColor {
static var link: UIColor {
return UIColor(r: 0, g: 152, b: 238)
}
static var toastNotification: UIColor {
return .white
import Cocoa
final class AppDelegate: NSObject, NSApplicationDelegate {
private var statusItem: NSStatusItem!
func applicationDidFinishLaunching(_ aNotification: Notification) {
statusItem = NSStatusBar.system.statusItem(withLength: 450)
let contentView = ContentView()
contentView.translatesAutoresizingMaskIntoConstraints = false
if let button = statusItem.button {
@raphkoebraam
raphkoebraam / Best in Class iOS Checklist
Created November 18, 2023 23:19 — forked from DreamingInBinary/Best in Class iOS Checklist
This is a public checklist updated every year after the latest version of iOS and iPadOS are shipped. It's a boiled down version of a "Best in Class" app checklist created by Jordan Morgan.
# A Best in Class Checklist
A boiled down checklist adapted from this [post](https://www.swiftjectivec.com/a-best-in-class-app/), created by @jordanmorgan10.
> To use this, create a Github Issue in your own repo, and simply copy and paste this text.
## iOS Core Technology
_Things any iOS app can benefit from_
- [ ] iCloud Sync
- [ ] Focus Filter Support
@raphkoebraam
raphkoebraam / trigger webViewWebContentProcessDidTerminate in simulator
Created October 24, 2023 12:50 — forked from jasonbekolay/trigger webViewWebContentProcessDidTerminate in simulator
Killing a WKWebView content process in the iOS simulator to trigger a webViewWebContentProcessDidTerminate call
# In the command line, find the PID of your simulator process:
ps -p `pgrep launchd_sim`
# or if you have many simulators running:
ps -A | grep launchd_sim
# Find the PID of the WebContent process:
pgrep -P <simulator-pid> 'com.apple.WebKit.WebContent'
# kill it
@raphkoebraam
raphkoebraam / README.md
Created April 13, 2023 18:40 — forked from IsaacXen/README.md
(Almost) Every WWDC videos download links for aria2c.
@raphkoebraam
raphkoebraam / 1-setup.md
Created February 28, 2022 14:30 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

Last updated March 28, 2021

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

@raphkoebraam
raphkoebraam / ios-xcode-device-support.sh
Created June 10, 2021 14:15 — forked from steipete/ios-xcode-device-support.sh
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)

fastlane/fastlane#13833

This script may be useful to you if you use fastlane for iOS CI builds and your Apple developer portal account uses 2-factor authentication. There is reason to suppose that Apple may not be persisting these sessions for as long as they used to, and hence you might find yourself needing to update FASTLANE_SESSION for your CI projects more often than usual.

This script is a way to mostly automate the process of updating FASTLANE_SESSION if you use CircleCI as your CI provider. It expects to find your Apple username in env as FASTLANE_USER, your Apple password as FASTLANE_PASSWORD, and your CircleCI API token as CIRCLE_API_TOKEN. It then executes fastlane spaceauth and waits for you to put in your 2FA code. From there, it parses out the session data and then uses the CircleCI API to populate the specified projects with the newly updated FASTLANE_SESSION. You'll

@raphkoebraam
raphkoebraam / ios-cell-registration-swift.md
Created April 25, 2021 17:09 — forked from gonzalezreal/ios-cell-registration-swift.md
iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics

iOS Cell Registration & Reusing with Swift Protocol Extensions and Generics

A common task when developing iOS apps is to register custom cell subclasses for both UITableView and UICollectionView. Well, that is if you don’t use Storyboards, of course.

Both UITableView and UICollectionView offer a similar API to register custom cell classes:

public func registerClass(cellClass: AnyClass?, forCellWithReuseIdentifier identifier: String)
public func registerNib(nib: UINib?, forCellWithReuseIdentifier identifier: String)
@raphkoebraam
raphkoebraam / configure-ios
Last active October 2, 2015 12:07
Code snippet for configuring reSIProcate for arm64 - it's still under improvement and it will soon be ready for every architecture
#!/bin/sh
export CC="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-darwin"
export CPP="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -E"
export CXX="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-darwin"
export CPPFLAGS="-target arm64-apple-darwin -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/ -miphoneos-version-min=9.0"
export LDFLAGS="-target arm64-apple-darwin -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk"
./configure --host=aarch64-apple-darwin