Skip to content

Instantly share code, notes, and snippets.

import SwiftUI
@main
struct AsyncTestApp: App {
var body: some Scene {
WindowGroup {
ContentView()
.environmentObject(State())
}
}
@marktrobinson
marktrobinson / .swift
Last active June 4, 2021 05:35
DragAndDrop (Not working on macOS)
import SwiftUI
import UniformTypeIdentifiers
struct Square: View {
let id: String
let fillColor: Color
var body: some View {
Rectangle()
.fill(fillColor)
.frame(width: 100, height: 100)
@marktrobinson
marktrobinson / redux-optimistic.swift
Created February 3, 2016 22:01
Optimistic Updating History for Redux SwiftFlow
import UIKit
struct HistoryItem: Equatable {
let action: Int
let state: String
init(action: Int, state: String) {
self.action = action
self.state = state
}