This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// Layout | |
// | |
// Created by Matt Gallagher on 7/6/19. | |
// Copyright © 2019 Matt Gallagher. All rights reserved. | |
// | |
import SwiftUI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AppDelegate.swift | |
// make1012work | |
// | |
// Created by Dad on 9/23/19. | |
// Copyright © 2019 Geek & Dad, LLC. All rights reserved. | |
// | |
import UIKit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
// based on clever example from Nick Lockwood: https://gist.github.com/nicklockwood/833fabacbc4b2d11ae7c7d4752b8fd18 | |
// I only needed Encodable so trimmed it down to just that. | |
protocol AnyEncodableValue: Encodable {} | |
extension AnyEncodableValue { | |
func encode(to container: inout SingleValueEncodingContainer) throws { | |
try container.encode(self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// TestSwiftUI1 | |
// | |
// | |
import SwiftUI | |
struct ContentView: View { | |
@Environment(\.viewController) private var viewControllerHolder: UIViewController? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// point free video 65 at the 14:50 point. | |
// https://www.pointfree.co/episodes/ep65-swiftui-and-state-management-part-1#t887 | |
// | |
// This code has an issue whereby a navigation link cannot be activated twice unless | |
// the other navigation link is actived in between the two activations of a particular | |
// link. | |
import SwiftUI | |
struct ContentView: View { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// paste into new macOS playground | |
// Xcode 11.3 on 10.15.2 | |
import Cocoa | |
protocol InfoTypeProtocol {} | |
protocol Base { | |
associatedtype InfoType: InfoTypeProtocol | |
var info: InfoType { get set } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from the blog post: https://geekanddad.wordpress.com/2020/01/23/snippet-swiftui-view-printmessage-extension/ | |
import SwiftUI | |
import PlaygroundSupport | |
struct ContentView: View { | |
var body: some View { | |
VStack { | |
TestView(label: "hello", idx: 22) | |
.font(.title) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// PreviewsTips2020.01.24 | |
// Updated 2021.09.24 | |
// | |
// Dad | |
// @GeekAndDad | |
// | |
// Code from blog post: | |
// https://geekanddad.wordpress.com/2020/01/24/tiny-hints-a-couple-of-xcode-11-3-swiftui-preview-tips/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ContentView.swift | |
// bugtest | |
// | |
// Copyright © 2020 Geek & Dad, LLC All rights reserved. | |
// | |
import SwiftUI | |
struct PreferenceTest: View { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
@State private var showSheet: Bool = false | |
@State private var name: String = "Default Name" | |
var body: some View { | |
VStack { | |
Text("Hello, World!") | |
.frame(maxWidth: .infinity, maxHeight: .infinity) |
OlderNewer