This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import WidgetKit | |
extension WidgetCenter { | |
func currentConfigurations() async throws -> [WidgetInfo] { | |
try await withCheckedThrowingContinuation { continuation in | |
getCurrentConfigurations { result in | |
continuation.resume(with: result) | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
pids=`ps axo pid,command | grep CoreSimulator | grep -v "grep CoreSimulator" | cut -c 1-5` | |
if [ "$1" = "go" ]; then | |
kill -9 $pids | |
elif [ "$1" = "echo" ]; then | |
echo $pids | |
else | |
pid_param=`echo $pids | tr -s ' ' ','` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env xcrun -sdk macosx swift | |
// Displays UI in an NSWindow which can interact with the commandline | |
// Usage: `echo "Bar" | ./swift-ui-commandline-tool.swift` | |
import Foundation | |
import SwiftUI | |
extension CommandLine { | |
static let input: String = { AnyIterator { readLine() }.joined() }() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// IncrementalUpdateTests.swift | |
// | |
// Copyright (c) 2015 Swift Studies. All rights reserved. | |
// | |
import Foundation | |
import XCTest | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
// Only needed until we have class variables | |
var __SwizzleSayHello = { (who:String) -> String in | |
return "Hello, \(who)" | |
} | |
class Swizzle { | |
//Only needed until we have class variables | |
class var _sayHello : (String)->String { get{ return __SwizzleSayHello } set (swizzle) {__SwizzleSayHello = swizzle} } |