Accessing Samples from Mic in iOS Swift and SwiftUI

It took ages to find out this. All the code I found was incomplete and caused errors like any of the following: