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
// | |
// CustomTabBarExample.swift | |
// | |
// Created by Matt Pfeiffer on 10/22/23. | |
// | |
import SwiftUI | |
struct CustomTabBarExample: View { | |
@State var index: Int = 0 |
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
struct RepeatedFadeBetweenViews<ViewA: View, ViewB: View>: View { | |
var animationDuration: Double = 2.0 | |
let viewA: () -> ViewA | |
let viewB: () -> ViewB | |
@State private var isViewAVisible = false | |
var body: some View { | |
Group { | |
if isViewAVisible { |
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 Tonic | |
import Foundation | |
extension ChordType: Codable { | |
public init(from decoder: Decoder) throws { | |
let values = try decoder.container(keyedBy: CodingKeys.self) | |
let chordKey = try values.decode(String.self, forKey: .chordKey) | |
self.init(chordKey: chordKey) | |
} | |
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 | |
struct BlobView: View { | |
@State private var mainPosition: CGPoint = .zero | |
@State private var positions: [CGPoint] = [] | |
private let blurRadius = 20.0 | |
private let alphaThreshold = 0.875 | |
private let ballCount = 20 | |
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 RealityKit | |
import RealityKitContent | |
@main | |
struct WindowWatchingApp: App { | |
@State private var windowManager: WindowManager | |
init() { | |
_windowManager = State(initialValue: WindowManager()) |
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 | |
struct AnimatingMeshCircle: View { | |
var body: some View { | |
AnimatingMeshView() | |
.mask(Circle().frame(width:300, height: 300)) | |
} | |
} | |
#Preview { |
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 | |
struct AnimatingMaskedMeshView: View { | |
let referenceDate: Date = .now | |
@State private var mainPosition: CGPoint = .zero | |
@State private var positions: [CGPoint] = [] | |
private let blurRadius = 20.0 | |
private let alphaThreshold = 0.875 |
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 RealityKit | |
import SwiftUI | |
import GameplayKit | |
struct MorphingSphereRealityView: View { | |
@State private var currentEntity: Entity? | |
@State private var morphFactor: Float = 0.0 | |
@State private var frameDuration: TimeInterval = 0.0 | |
@State private var lastUpdateTime = CACurrentMediaTime() | |
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 RealityKit | |
import SwiftUI | |
struct DiscoBallRealityView: View { | |
@State private var currentEntity: Entity? | |
@State private var morphFactor: Float = 0.0 | |
@State private var frameDuration: TimeInterval = 0.0 | |
@State private var lastUpdateTime = CACurrentMediaTime() | |
static let animationFrameDuration: TimeInterval = 1.0 / 120.0 |
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 RealityKit | |
import SwiftUI | |
struct BubbleRealityView: View { | |
@State private var currentEntity: Entity? | |
@State private var morphFactor: Float = 0.0 | |
@State private var frameDuration: TimeInterval = 0.0 | |
@State private var lastUpdateTime = CACurrentMediaTime() | |
static let animationFrameDuration: TimeInterval = 1.0 / 120.0 |
OlderNewer