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 | |
// MARK: - Constants | |
// Items in the dock: Add any application you’d like to see in here | |
let items = | |
[ | |
"file:///Applications/Xcode.app", | |
"file:///Applications/Safari.app", | |
"file:///System/Applications/Messages.app", |
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
extension View { | |
@ViewBuilder func innerShadow<ShapeType: Shape>(_ shape: ShapeType, color: Color, radius: CGFloat = 10, spread: CGFloat = 4, x: CGFloat = 0, y: CGFloat = 0) -> some View { | |
self | |
.overlay( | |
shape.stroke(Color.clear, lineWidth: spread * 2) | |
.shadow(color: color, radius: radius, x: x, y: y) | |
) | |
.clipShape(shape) | |
} | |
} |
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 ExampleView: View { | |
var body: some View { | |
Text("Example") | |
.if(true) { $0.foregroundColor(.red) } | |
} | |
} |
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
class Synthesizer { | |
// MARK: - Variables | |
var audioEngine: AVAudioEngine! | |
var sourceNode: AVAudioSourceNode! | |
var time = Float.zero | |
var frequencyRamp = Float.zero | |
var currentFrequency: Float = 20 { | |
didSet { |
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 Cocoa | |
// Representation of a pixel | |
struct Pixel { | |
var a: UInt8 | |
var r: UInt8 | |
var g: UInt8 | |
var b: UInt8 | |
} |