Skip to content

Instantly share code, notes, and snippets.

Avatar
🪴

Christian Privitelli Priva28

🪴
View GitHub Profile
View ios16ButtonIssue.swift
import SwiftUI
struct ContentView: View {
var body: some View {
Button {
} label: {
Text("Press this button")
.foregroundColor(.white)
.padding(12)
@Priva28
Priva28 / AudioPlayThrough.swift
Last active October 8, 2022 04:27
This is a basic Swift function that allows for incoming system audio to be played to the system output. It uses the modern Swift syntax for setting up and using RemoteIO Audio Units. I hope someone can use it to avoid the pains of having to use AVAudioEngine and understand how to setup RemoteIO Audio Units in Swift just a little bit easier :)
View AudioPlayThrough.swift
// This is a basic Swift function that allows for incoming system audio (like the microphone or USB input) to be
// played to the system output. It uses the modern Swift syntax for setting up and using RemoteIO Audio Units.
// Of course, before running this function, you would have to setup your AVAudioSession with the playAndRecord category,
// as well as whatever other options you might like. This is just a barebones function that demonstrates the capability
// and you should implement some better error handling and respond to audio session route changes or interruptions.
// I've only created this gist because even though it seems like it would be a simple thing, there is essentially
// zero documentation on anyone trying to do this on the entire internet, and if there was any, it was basically
// ancient and using Objective-C and outdated APIs. Now with this I hope someone can use it to avoid the pains of
// having to use AVAudioEngine and understand how to setup RemoteIO Audio Units in Swift just
@Priva28
Priva28 / GradientEffect.swift
Last active June 14, 2022 16:25
Gradient effect to emulate Apple Music Lyrics/Now Playing screen.
View GradientEffect.swift
//
// ContentView.swift
// GradientEffect
//
// Created by Christian Privitelli on 18/7/20.
//
import SwiftUI
struct ContentView: View {