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 | |
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
// | |
// Apple.swift | |
// Playground | |
// | |
// Created by Navdeep Singh on 7/14/20. | |
// | |
import SwiftUI | |
struct Apple: View { |
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 | |
struct RGBAWheelView: WheelPickable { | |
typealias DataType = RGBAData | |
let data: DataType | |
@State var thumbOffset = CGPoint() | |
var _$thumbOffset: Binding<CGPoint> { $thumbOffset } | |
let angularGradient: Gradient | |
let radialGradient: Gradient | |
init(data: DataType) { |
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
// | |
// ContentView.swift | |
// Widgets | |
// | |
// Created by Kyle Halevi on 7/3/20. | |
// | |
import SwiftUI | |
struct Widget: View { |
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
// A fun little game written in SwiftUI | |
// Copyright (c) John Sundell 2020, MIT license. | |
// This is a hacky implementation written just for fun. | |
// It's only verified to work on iPhones in portrait mode. | |
import SwiftUI | |
final class GameController: ObservableObject { | |
@Published var plane = GameObject.plane() | |
@Published private(set) var clouds = [GameObject]() |
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
// | |
// ContentView.swift | |
// | |
// | |
// Created by Bernstein, Joel on 7/4/20. | |
// | |
import SwiftUI | |
struct ElementModel: Identifiable |
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
# Script to download all the WWDC 2020 session videos in the highest 4K video and audio | |
# You may have to update ffmpeg before using this script. I needed version 4.3 or higher to successfully download the videos. | |
# | |
# If you want the lower bitrate audio, do a find/replace of "audio_english_192" with "audio_english_64" | |
# If you want lower bitrate or lower resolution video, do a find/replace of "hvc_2160p_16800" with any of the following: | |
# "hvc_2160p_11600" | |
# "hvc_1440p_8100" | |
# "hvc_1080p_5800" | |
# "hvc_1080p_4500" | |
# "hvc_720p_3400" |
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 | |
// constants | |
let cardWidth: CGFloat = 343 | |
let cardHeight: CGFloat = 212 | |
let spacing = 36 | |
let animation = Animation.spring() | |
let cardColors = [ | |
Color(UIColor.systemRed), |
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 |