Question: how to add avfoundation.framework to xcode project?
Answer: The first thing we'll need to do is to add the AVFoundation framework to the project. In the General tab of your Xcode project properties, the frameworks and libraries section is all the way at the bottom. If you click the “+” icon, you'll get a dialog and you can search for the AVFoundation Framework to add it.