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 | |
public struct UniformWindowGroup<Content: View>: Scene { | |
var id: String? | |
var maxWidth: CGFloat | |
var maxHeight: CGFloat | |
var aspectRatio: CGFloat | |
var content: Content | |
@State private var setSize: CGSize? |
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
// 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 |
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
// | |
// ContentView.swift | |
// GradientEffect | |
// | |
// Created by Christian Privitelli on 18/7/20. | |
// | |
import SwiftUI | |
struct ContentView: View { | |