Contents of MyApp.swift
import SwiftUI
@main
struct AnimateOnObservedPropertyChangeApp: App {
@State var trigger = false
var body: some Scene {
import AIProxy | |
let openAIService = AIProxy.openAIService( | |
partialKey: "partial-key-from-your-developer-dashboard", | |
serviceURL: "service-url-from-your-developer-dashboard" | |
) | |
do { | |
let response = try await openAIService.chatCompletionRequest(body: .init( | |
model: "o1-mini", |
import Foundation | |
import SwiftUI | |
import AIProxy | |
final actor ImageLoader { | |
static func create(fromPrompt prompt: String) async -> UIImage? { | |
let service = AIProxy.stabilityAIService( | |
partialKey: "your-partial-key", | |
serviceURL: "your-service-url") | |
do { |
## WWDC notes | |
2019 Introducing SwiftUI | |
- Views are structs, value types, passed by value, allocated on the stack. | |
- If you have something like `let room: Room` as a property, and Room is a | |
struct, then the surrounding struct has "the size and weight of a room, no | |
additional allocation or reference counting overhead" | |
- 17:30 | |
"make liberal use of small, single purpose views in SwiftUI" | |
"views in SwiftUI are incredibly lightweight" |
Contents of MyApp.swift
import SwiftUI
@main
struct AnimateOnObservedPropertyChangeApp: App {
@State var trigger = false
var body: some Scene {
diff --git a/plugin-typings/plugin-api.d.ts b/plugin-typings/plugin-api.d.ts | |
index d299a90..c4ea706 100644 | |
--- a/plugin-typings/plugin-api.d.ts | |
+++ b/plugin-typings/plugin-api.d.ts | |
@@ -12,7 +12,8 @@ declare type ArgFreeEventType = | |
interface PluginAPI { | |
readonly apiVersion: '1.0.0' | |
readonly command: string | |
- readonly editorType: 'figma' | 'figjam' | |
+ readonly editorType: 'figma' | 'figjam' | 'dev' |
// Start repl with: | |
// $ xcrun swift -F /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks | |
// Or run as script: | |
// $ xcrun swift -F /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks % | |
import Foundation | |
if dlopen("/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/Versions/A/XCTest", RTLD_NOW) == nil { |
var res : __res_9_state = __res_9_state() | |
res_9_ninit(&res) | |
var addr: in_addr = in_addr() | |
inet_aton("224.0.0.251", &addr) | |
res.nsaddr_list.0.sin_addr = addr | |
res.nsaddr_list.0.sin_family = sa_family_t(AF_INET) | |
res.nsaddr_list.0.sin_port = in_port_t(5353).bigEndian | |
res.nscount = 1 |
// (string, swift, bytes, data, buffer, cstring) | |
print("--- using nulTerminated ---") | |
let x : String = "hello" | |
let buf = x.nulTerminatedUTF8 | |
print(buf) | |
print("\n--- using [UInt8] ---") | |
let buf2 : [UInt8] = [UInt8](x.utf8) | |
print(buf2) |
#import "JPUtils.h" | |
extern void | |
JPUpdateDelegates(id<JPManagerDelegate,JPDeviceDelegate> aDelegate) | |
{ | |
JPManager *manager = [JPManager sharedManager]; | |
[manager setDelegate:aDelegate]; | |
for(JPDevice *dev in [manager connectedDevices]) | |
{ | |
[dev setDelegate:aDelegate]; |