View TestDecodingFunTests.swift
// | |
// TestDecodingFunTests.swift | |
// TestDecodingFunTests | |
// | |
// Created by Dad on 9/22/20. | |
// | |
// Poster wanted to be able to parse (visual) "components" out of a json file that would | |
// have various components of various types. |
View confusing.swift
// macOS playground source | |
// swift 5.3, Xcode 12b2 | |
import Cocoa | |
struct Foo<A> { | |
var subVal: Any? | |
let defaultValue: A | |
init(defaultValue: A) { |
View detweet.swift
#!/usr/bin/swift sh | |
import Foundation | |
import PromiseKit // @mxcl ~> 6.5 | |
import Swifter // @mattdonnelly == b27a89 | |
let swifter = Swifter( | |
consumerKey: "FILL", | |
consumerSecret: "ME", | |
oauthToken: "IN", | |
oauthTokenSecret: "https://developer.twitter.com/en/docs/basics/apps/overview.html" |
View ContentView.Swift
// | |
// ContentView.swift | |
// TestAlert | |
// | |
// | |
import SwiftUI | |
struct ContentView: View { | |
@State private var showAlert1: Bool = false |
View RemindersListToTextEdit.scpt
tell application "Reminders" | |
set listNames to {} | |
repeat with aList in lists | |
copy name of aList to end of listNames | |
end repeat | |
set listName to choose from list listNames with prompt "Select the list to print:" | |
-- now find list object for the choosen list | |
set listToPrint to "" | |
repeat with aList in lists |
View ContentView.swift
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) |
View SampleView.swift
// | |
// ContentView.swift | |
// bugtest | |
// | |
// Copyright © 2020 Geek & Dad, LLC All rights reserved. | |
// | |
import SwiftUI | |
struct PreferenceTest: View { |
View ContentView.swift
// | |
// ContentView.swift | |
// PreviewsTips2020.01.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/ |
View View_printMessage_playground.swift
// 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) |
View OpaqueTypesPlayground.swift
// 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 } |
NewerOlder