This file contains hidden or 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 PlaygroundSupport | |
| // NOTE: this example currently only works with US-based coordinates | |
| // constants | |
| // New York | |
| let latitude = 40.709335 | |
| let longitude = -73.956558 |
This file contains hidden or 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 SafariServices | |
| import PlaygroundSupport | |
| // lil news api | |
| let apiURL = "https://api.lil.software/news" | |
| struct News: Codable { | |
| var articles: [Article] | |
| } |
This file contains hidden or 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 | |
| import PlaygroundSupport | |
| struct Location { | |
| var title: String | |
| var latitude: Double | |
| var longitude: Double | |
| } |
This file contains hidden or 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 WebKit | |
| import PlaygroundSupport | |
| struct ContentView: View { | |
| @State var webView = WebView() | |
| @State var url = "" | |
| var body: some View { | |
| VStack { |
This file contains hidden or 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 PlaygroundSupport | |
| struct SignUpView: View { | |
| @State var username = "" | |
| @State var password = "" | |
| var body: some View { | |
| NavigationView { |
This file contains hidden or 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 PlaygroundSupport | |
| struct ContentView: View { | |
| var body: some View { | |
| VStack(spacing: 24) { | |
| Text("Apple TV") | |
| .font(.headline) | |
| Rectangle() |
This file contains hidden or 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 PlaygroundSupport | |
| struct ContentView: View { | |
| @State var text = "" | |
| var body: some View { | |
| SearchBar(text: $text) | |
| } | |
| } |
This file contains hidden or 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 PlaygroundSupport | |
| struct ContentView: View { | |
| @State var gradientAngle: Double = 0 | |
| var colors = [ | |
| Color(UIColor.systemRed), | |
| Color(UIColor.systemOrange), | |
| Color(UIColor.systemYellow), | |
| Color(UIColor.systemGreen), |
This file contains hidden or 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 PlaygroundSupport | |
| struct Sunset: View { | |
| @State var backgroundColor = Color.blue | |
| @State var sunSetted = false | |
| let sunGradient = [Color.yellow, Color.orange] | |
| let moonGradient = [Color.gray, Color.black] | |
| @State var alignment = Alignment.top | |