View MKLocalSearchExample.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 | |
import MapKit | |
struct SearchTest: View { | |
@StateObject var infoService = LocationSearchService() | |
let center = CLLocationCoordinate2D(latitude: 34.0536909, longitude: -118.242766) | |
let radius = 100.0 | |
var body: some View { | |
List(infoService.locationItems, id:\.self) { item in |
View LocationPickerView.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 | |
import CoreLocationUI | |
struct LocationPickerView: View { | |
@StateObject var locationManager = LocationManager() | |
@State private var locationName:String = "" | |
View chartExemple.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
// | |
// ChartTests.swift | |
// DataViewer | |
// | |
// Created by Labtanza on 8/3/22. | |
// | |
import SwiftUI | |
import Charts |
View EnumPicker
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
// | |
// EnumPicker.swift | |
// DataViewer | |
// | |
// Created by Carlyn Maw on 8/1/22. | |
// | |
import SwiftUI | |
View linear_solver.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
//https://developer.apple.com/documentation/accelerate/working_with_matrices | |
// e.g. https://www.youtube.com/watch?v=wBxUa9tHkkE&list=PLMiyQ6EW11_lJT2YKm7kz_Uaa7M0LbBkP | |
typealias Number = Double | |
static func solveLinearPair(cx1:Number, cy1:Number, s1:Number, cx2:Number, cy2:Number, s2:Number) -> SIMD2<Number> { | |
let a = simd_double2x2(rows: [ | |
simd_double2(cx1, cy1), | |
simd_double2(cx2, cy2) | |
]) |
View ScaledValue.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
enum ScaleStyle { | |
case square | |
case squareRt | |
case beaufortScale | |
case log | |
case invlog | |
case linear | |
case inverted | |
case invertedSquare | |
} |
View TaperSlider.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
//MOST RECENT VERSION: https://github.com/carlynorama/TaperSlider | |
// | |
// CustomTaperSlider.swift | |
// | |
// | |
// Created by Carlyn Maw on 7/15/22. | |
// License MIT |
View CollapsableView.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
//Based off of https://rensbr.eu/blog/swiftui-escaping-closures/ | |
struct CollapsableView<Content: View>: View { | |
let content: Content | |
@Binding var isVisible:Bool | |
init(value:Binding<Bool>, @ViewBuilder content: () -> Content) { | |
self.content = content() | |
self._isVisible = value | |
} | |
View Compass.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 | |
import SwiftUI | |
//TEST | |
print("----") | |
print("North") | |
print(Compass(degrees: 0).rawValue) | |
print(Compass(degrees: 5).rawValue) | |
print(Compass(degrees: 360-5).rawValue) | |
print("----") |
View WindScale.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
// | |
// WindDescriptions.swift | |
// Wind | |
// | |
// Created by Carlyn Maw on 6/23/22. | |
// | |
// Combination of Beaufort Wind Scale and Saffir-Simpson Hurricane Wind Scale | |
// windVelocity = 0.836 pow(B,3/2) m/s | |
import Foundation |
NewerOlder