Skip to content

Instantly share code, notes, and snippets.

View paulweichhart's full-sized avatar
:octocat:

Paul Weichhart paulweichhart

:octocat:
View GitHub Profile
struct PortfolioList: View {
let symbols: [Symbol]
@EnvironmentObject private var coordinator: Coordinator
var body: some View {
List {
ForEach(symbols, id: \.id) { symbol in
NavigationLink(destination: coordinator.navigate(to: .shareView(symbol: symbol))) {
import Foundation
import SwiftUI
final class Coordinator: ObservableObject {
enum Destination {
case loadingView
case rootView
case shareView(symbol: Symbol)
}
@paulweichhart
paulweichhart / MVVM.swift
Last active November 24, 2022 21:40
MVVM+SwiftUI
//
// MVVM.swift
// MVVM+SwiftUI+Combine
//
// Created by Paul Weichhart on 07.09.20.
//
import Combine
import Foundation
import SwiftUI
@paulweichhart
paulweichhart / Template.swift
Created December 8, 2019 20:10
SwiftUI Playground Template
import Foundation
import PlaygroundSupport
import SwiftUI
struct Content: View {
var body: some View {
Text("👋🏻, 🌍!")
}
}
@paulweichhart
paulweichhart / SwiftUI.swift
Last active October 16, 2019 22:08
SwiftUI Re-rendering
import Foundation
import PlaygroundSupport
import SwiftUI
// This View will be re-rendered because it's property value changed
struct Headline: View {
var headline: String
var body: some View {
Text(headline)
@paulweichhart
paulweichhart / ClosureSet.swift
Last active March 24, 2018 09:42
ClosureSet
import Foundation
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
final class ClosureSet<T> {
private var closure: ((T) -> Void)?
init () { }
@paulweichhart
paulweichhart / gist:4027445
Created November 6, 2012 20:50
Yuma2/Annotorious GUI elements - sample page early version
.yuma-hint {
line-height: normal;
font-family:Arial, Verdana, Sans;
font-size:11px;
color:#000;
background-color:#fff;
margin:0px;
padding:5px;
border-radius: 5px;
-moz-border-radius: 5px;