Skip to content

Instantly share code, notes, and snippets.

View buh's full-sized avatar
📦
Swift

Alexey Bukhtin buh

📦
Swift
  • Amsterdam
View GitHub Profile
@buh
buh / ContentView.swift
Created June 19, 2022 22:06 — forked from wtsnz/ContentView.swift
Playing around with hosting SwiftUI Views in an NSWindow from inside a View 🙃 (also works for the NSStatusBar item!)
import SwiftUI
struct ContentView: View {
@State var now = Date()
@State var showWindow = false
@State var text: String = ""
let timer = Timer.publish(every: 1, on: .current, in: .common).autoconnect()