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 SafariServices | |
import PlaygroundSupport | |
// lil news api | |
let apiURL = "https://api.lil.software/news" | |
struct News: Codable { | |
var articles: [Article] | |
} |
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 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 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 | |
// constants | |
let deviceWidth: CGFloat = 320 | |
let deviceHeight: CGFloat = 568 | |
let hasFaceID = true // false for TouchID | |
struct Device: View { | |
var body: some 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
import SwiftUI | |
import PlaygroundSupport | |
// constants | |
let cardWidth: CGFloat = 343 | |
let cardHeight: CGFloat = 212 | |
let spacing = 36 | |
let animation = Animation.spring() | |
let cardColors = [ | |
Color(UIColor.systemRed), |
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 PlaygroundSupport | |
struct Symbols: View { | |
var body: some View { | |
Image(systemName: "person.crop.circle.fill") | |
.font(.system(size: 96)) | |
.foregroundColor(.blue) | |
} | |
} |
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 PlaygroundSupport | |
struct Desktop: View { | |
var body: some View { | |
ZStack { | |
// Image(uiImage: #imageLiteral(resourceName: "IMG_6281.JPG")) | |
Color(UIColor.systemBlue) | |
macOS() | |
} |
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 PlaygroundSupport | |
struct Keypad: View { | |
var body: some View { | |
VStack(spacing: 24) { | |
HStack { | |
Spacer() | |
Text("1") |
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 PlaygroundSupport | |
struct ContentView: View { | |
@State var notificationsEnabled = true | |
var body: some View { | |
Toggle("Notifications", isOn: $notificationsEnabled) | |
.padding() | |
.frame(width: 375, height: 64) |
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 PlaygroundSupport | |
struct UserCell: View { | |
var body: some View { | |
HStack(spacing: 16) { | |
Image(systemName: "person.crop.circle.fill") | |
.font(.system(size: 48)) | |
VStack(alignment: .leading, spacing: 2) { |
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 PlaygroundSupport | |
struct ContentView: View { | |
var body: some View { | |
Text("Hello World") | |
} | |
} | |
PlaygroundPage.current.setLiveView(ContentView()) |