Skip to content

Instantly share code, notes, and snippets.

View ajself's full-sized avatar
🏠
Working from home

AJ Self ajself

🏠
Working from home
  • Ford Motor Company
  • Minneapolis, MN
View GitHub Profile
@shaps80
shaps80 / UINavigationController-Gesture.m
Last active September 23, 2020 08:35
Custom UINavigationController back button item, without losing iOS 7 swipe back gesture.
navigationController
.interactivePopGestureRecognizer
.delegate = (id<UIGestureRecognizerDelegate>)navigationController;
@ZevEisenberg
ZevEisenberg / resetAllSimulators.sh
Last active June 20, 2024 17:13
Reset all iOS simulators with this one weird trick
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all
//
// MockingServer.swift
// Frip
//
// Created by 최완복 on 2016. 1. 6..
// Copyright © 2016년 Wanbok. All rights reserved.
//
import UIKit
import AMYServer
struct LazyView<Content: View>: View {
let build: () -> Content
init(_ build: @autoclosure @escaping () -> Content) {
self.build = build
}
var body: Content {
build()
}
}
@insidegui
insidegui / PlatformViewRepresentable.swift
Created August 10, 2022 18:13
Protocol that automatically adds UIViewRepresentable or NSViewRepresentable conformance to implementers according to the current platform
import SwiftUI
#if os(iOS) || os(tvOS)
public typealias PlatformView = UIView
public typealias PlatformViewRepresentable = UIViewRepresentable
#elseif os(macOS)
public typealias PlatformView = NSView
public typealias PlatformViewRepresentable = NSViewRepresentable
#endif
@aperfect
aperfect / CloudKit.swift
Created April 13, 2023 08:52
CloudKit server-to-server Swift authentication example
// Swift example for Apple CloudKit server-to-server token authentication
// See: https://developer.apple.com/library/archive/documentation/DataManagement/Conceptual/CloudKitWebServicesReference/SettingUpWebServices.html#//apple_ref/doc/uid/TP40015240-CH24-SW6
import Foundation
import CryptoKit
import Network
// Set up your body JSON