Warning Warning
Info Info
/// Captures a Cocoa object as a parameter to a `@Sendable` function or closure. | |
@propertyWrapper | |
public struct Copy<Wrapped>: @unchecked Sendable where Wrapped: NSCopying { | |
// from: <https://github.com/apple/swift-evolution/blob/main/proposals/0302-concurrent-value-and-concurrent-closures.md?plain=1#L568> | |
public let wrappedValue: Wrapped | |
public init(wrappedValue: Wrapped) { | |
self.wrappedValue = wrappedValue.copy() as! Wrapped // swiftlint:disable:this force_cast | |
} | |
} |
@resultBuilder | |
struct ArrayBuilder<Element> { | |
static func buildExpression(_ expression: Element) -> [Element] { | |
[ expression ] | |
} | |
static func buildBlock(_ elements: [Element]...) -> [Element] { | |
elements.flatMap { $0 } | |
} |
import Foundation | |
import SwiftSyntax | |
class AtGlobalVisitor: SyntaxVisitor { | |
struct Result { | |
let name: String | |
let type: String | |
let location: SourceRange | |
let url: URL |
// | |
// NSObject+Blocks.h | |
// Filemator | |
// | |
// Created by Zachary Waldowski on 4/12/11. | |
// Copyright 2011 Dizzy Technology. All rights reserved. | |
// | |
@interface NSObject (Blocks) |
// swift-tools-version: 5.5 | |
// WARNING: | |
// This file is automatically generated. | |
// Do not edit it by hand because the contents will be replaced. | |
import PackageDescription | |
import AppleProductTypes | |
let package = Package( |
/// Customizes the behavior of automatically-generated `Equatable` and `Hashable` conformances. | |
@propertyWrapper | |
public struct AssumeEqualUntilModified<Wrapped> { | |
var modificationCount = 0 | |
public var wrappedValue: Wrapped { | |
didSet { | |
modificationCount += 1 | |
} |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>BackgroundColor</key> | |
<string>0d2733</string> | |
<key>CharColor</key> | |
<string>cc256f</string> | |
<key>ClassColor</key> | |
<string>c1371f</string> |
#!/usr/bin/env xcrun swift | |
import Foundation | |
import ApplicationServices | |
func sendEventToSystemProcess(eventToSend: AEEventID) throws { | |
let target = NSAppleEventDescriptor(bundleIdentifier: "com.apple.loginwindow") | |
let event = NSAppleEventDescriptor(eventClass: numericCast(kCoreEventClass), eventID: eventToSend, targetDescriptor: target, returnID: numericCast(kAutoGenerateReturnID), transactionID: numericCast(kAnyTransactionID)) | |
try event.sendEventWithOptions([.NoReply, .NeverInteract, .DontRecord], timeout: 2.0) | |
} |