Skip to content

Instantly share code, notes, and snippets.

View vincefried's full-sized avatar

Vincent Friedrich vincefried

View GitHub Profile
@vincefried
vincefried / SimpleRepresentable.swift
Created September 8, 2023 07:05
A small demonstration of how I would like a way to modify a wrapped UIView.
import SwiftUI
struct ContentView2: View {
var body: some View {
VStack {
SimpleRepresentable(text: "Test")
SimpleRepresentableWithPadding(text: "Test")
}
}
}
@vincefried
vincefried / ButtonRepresentable.swift
Created September 8, 2023 06:58
A small demonstration of my problems with sizing a wrapped UIButton in a UIViewRepresentable properly.
import SwiftUI
struct ContentView: View {
var body: some View {
ButtonRepresentable(title: "Test") {
print("press")
}
// .frame(maxWidth: .infinity) // Comment in or out for the two cases I want to support.
}
}
//
// Ampel.swift
// Ampel
//
// Created by Vincent Friedrich on 19.03.19.
// Copyright © 2019 neoxapps. All rights reserved.
//
import Foundation