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
// Demo: https://imgur.com/a/NsexCm2 | |
/// This SegmentedPicker will take some Equatable array(Int, String, etc.) | |
public struct SegmentedPicker<T: Equatable, Content: View>: View { | |
// Tells SwiftUI which views can be animated together | |
@Namespace private var selectionAnimation | |
/// The currently selected item, if there is one | |
@Binding var selectedItem: T? | |
/// The list of options available in this picker | |
private let items: [T] |
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
// | |
// UDPListener.swift | |
// | |
// Created by Michael Robert Ellis on 12/16/21. | |
// | |
import Foundation | |
import Network | |
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
// | |
// Focus State Example | |
// | |
// Created by Michael Robert Ellis on 12/7/21. | |
// | |
import SwiftUI | |
struct MyObject: Identifiable, Equatable { | |
var id: String |
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
// | |
// UDPClient.swift | |
// | |
import Network | |
import Foundation | |
protocol UDPListener { | |
func handleResponse(_ client: UDPClient, data: Data) | |
} |
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 Network | |
import Foundation | |
class UDPClient { | |
var connection: NWConnection | |
var address: NWEndpoint.Host | |
var port: NWEndpoint.Port | |