View FBMessages.py
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
DELETE ME - Must create a new gist with an initial file |
View GetFromPublisher.swift
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 | |
extension URL { | |
func getFromPublisher<T: Codable>(property: inout Published<T>.Publisher) { | |
URLSession.shared.dataTaskPublisher(for: self) | |
.receive(on: DispatchQueue.main) | |
.map(\.data) | |
.decode(type: T.self, decoder: JSONDecoder()) | |
.assertNoFailure() | |
.assign(to: &property) |
View WheelView.swift
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 RGBAWheelView: WheelPickable { | |
typealias DataType = RGBAData | |
let data: DataType | |
@State var thumbOffset = CGPoint() | |
var _$thumbOffset: Binding<CGPoint> { $thumbOffset } | |
let angularGradient: Gradient | |
let radialGradient: Gradient | |
init(data: DataType) { |
View main.swift
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 | |
print("Whatever you say is repeated") | |
var inputString = String() | |
while inputString != "quit" | |
{ | |
inputString = readLine()! | |
print("You said: \(inputString)") | |
} | |
print("The program has ended") |