Skip to content

Instantly share code, notes, and snippets.

View OskarGroth's full-sized avatar

Oskar Groth OskarGroth

View GitHub Profile
struct ContentView: View {
@State var flip = false
var body: some View {
VStack {
Toggle("Refresh", isOn: $flip)
.toggleStyle(.switch)
StateSubView(model: .init(source: "State subview"))
ObservedSubView(model: .init(source: "Observed subview"))
}
import SwiftUI
public struct MouseTrackingView: View {
public var callbacks: NSMouseTrackingView.Callbacks
public var isEnabled: Bool
public var options: NSTrackingArea.Options
public var hitEnabled: Bool
public var flipYAxis: Bool
struct ContentView: View {
var body: some View {
VStack {
StateViewA()
StateViewB()
StateViewC()
StateViewD()
}
}
}
struct ContentView: View {
@State var selected: Bool = false
var body: some View {
Color.clear
.frame(width: 900, height: 400)
.toolbar {
ToolbarItem {
Button(action: {}, label: {
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------
Process: Hopper Disassembler v4 [6257]
Path: /Applications/Hopper Disassembler v4.app/Contents/MacOS/Hopper Disassembler v4
Identifier: com.cryptic-apps.hopper-web-4
Version: 4.8.2 (4.8.2)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
//
// ContentView.swift
// AppleLogo
//
// Created by Oskar Groth on 2021-06-17.
//
import SwiftUI
struct ContentView: View {
Process: Hopper Disassembler v4 [5343]
Path: /Applications/Hopper Disassembler v4.app/Contents/MacOS/Hopper Disassembler v4
Identifier: com.cryptic-apps.hopper-web-4
Version: 4.7.3 (4.7.3)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
User ID: 501
Date/Time: 2021-06-10 13:37:03.5151 +0200
import Cocoa
import SwiftUI
@main
struct StatusBugApp: App {
@StateObject var coordinator = StatusCoordinator()
var body: some Scene {
import SwiftUI
@main
struct SwiftApp: App {
@State var someState = false
var body: some Scene {
WindowGroup {
Rectangle()
struct ContentView: View {
var body: some View {
Image(nsImage: NSImage(named: .init(NSImage.applicationIconName))!)
.resizable()
.frame(width: 100, height: 100)
.tapWithHighlight(onTap: {
print("Tap")
}, onLongPress: {
print("Long Press")
})