Skip to content

Instantly share code, notes, and snippets.

//
// ContentView.swift
// FlowLayoutST
//
// Created by Chris Eidhof on 22.08.19.
// Copyright © 2019 Chris Eidhof. All rights reserved.
//
import SwiftUI
struct FlowLayout {
@chriseidhof
chriseidhof / ob-swiftui.el
Last active May 25, 2020 23:56 — forked from xenodium/ob-swiftui.el
Preview SwiftUI layouts using Emacs org blocks
(use-package org
:hook ((org-mode . org-display-inline-images))
:config
(use-package ob
:bind (:map org-mode-map
("C-c C-c" . org-ctrl-c-ctrl-c))
:config
(use-package ob-swift
//: A Cocoa based Playground to present user interface
import SwiftUI
struct ContentView: View {
var body: some View {
HStack {
Text("Highlight :")
.background(Color.green)
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .topTrailing)
@chriseidhof
chriseidhof / ContentView.swift
Created February 20, 2021 17:19 — forked from steipete/ContentView.swift
FB9013209: SwiftUI: Preview and actual layout differ in this example. (SwiftUI Bug)
//
// ContentView.swift
// Shared
//
// Created by Peter Steinberger on 20.02.21.
//
import SwiftUI
struct SettingsGroup<Content: View>: View {
import SwiftUI
extension View {
func pipe<R>(@ViewBuilder _ f: (Self) -> R) -> R {
f(self)
}
}
struct ContentView: View {
@State var flag: Bool = false
@chriseidhof
chriseidhof / SimpleRepresentable.swift
Last active September 8, 2023 07:12 — forked from vincefried/SimpleRepresentable.swift
A small demonstration of how I would like a way to modify a wrapped UIView.
import UIKit
import SwiftUI
struct ContentView2: View {
var body: some View {
VStack {
SimpleRepresentable(text: "Test")
}
}
}