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 Combine | |
struct Location { | |
} | |
//protocol WeatherService { | |
// func getTemperature(location: Location) -> AnyPublisher<Double, Error> | |
//} | |
// |
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 | |
// EditDemo | |
// | |
// Created by Ray Fix on 7/25/20. | |
// | |
import SwiftUI | |
// This is a hack! | |
func hideKeyboard() { |
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 | |
// Ring | |
// | |
// Created by Ray Fix on 6/20/20. | |
// Copyright © 2020 Ray Fix. 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
func combinations<S1: Sequence, S2: Sequence>(_ sequence1: S1, _ sequence2: S2) -> AnySequence<(S1.Element, S2.Element)> { | |
AnySequence( | |
sequence1.lazy.flatMap { element1 in | |
sequence2.lazy.map { element2 in | |
(element1, element2) | |
} | |
} | |
) | |
} |
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 | |
import Combine | |
final class ViewModel: ObservableObject { | |
var subs: Set<AnyCancellable> = [] | |
// For some reason this does not work! | |
init() { |
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 View { | |
func printType() -> Self { | |
print(type(of: self)) | |
return self | |
} | |
} | |
// Need to make a key; all it needs is a default value. |
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 | |
// Pub | |
// | |
// Created by Ray Fix on 5/16/20. | |
// Copyright © 2020 Ray Fix. All rights reserved. | |
// | |
import SwiftUI | |
import Combine |
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 | |
// | |
// Created by Ray Fix on 5/9/20. | |
// Copyright © 2020 Ray Fix. All rights reserved. | |
// | |
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
// Load the Swift Package: https://github.com/AppPear/ChartView | |
import SwiftUI | |
import SwiftUICharts | |
struct ContentView: View { | |
@State var tabIndex:Int = 0 | |
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 scale: CGFloat = 1 | |
@State private var angle = Angle(radians: 0) | |
@State private var color = UIColor.blue | |
var body: some View { | |
Image(systemName: "heart.fill") |