I experienced the same problem of the original poster. Tried to change the code posted by sam181818, but it still crashes. However, I can build/run Apple's sample code provided with the tutorial, and everything runs. Could this be due to the expected deployment iOS? I'm building while expecting to use iOS 15.2, but Apple's Xcode project is built for iOS 14.0.
Thanks for any comments!