Create Your Own Simple Music Player App In iOS

Cem Kazım
2 min readAug 22, 2020

Would you like to listen to your selected music on your own mobile app? Today, I will introduce you how to create your own music player in iOS. Let’s begin now.

How To Create This App?

Step 1: Create a new project in XCode.

Step 2: Open the “ViewController.swift” class and import AVFoundation library.

  • What is AVFoundation? -> AVFoundation is the full featured framework for working with time-based audiovisual media on iOS, macOS, watchOS and tvOS.

Step 3: Create a variable of type AVAudioPlayer.

Step 4: Add a song to your project.

Step 5: Create a function to play the sound.

  • forResource: Enter the name of your song here.

Step 6: Describe your objects in the Storyboard.

Step 7: Customize the “playButtonClicked” function.

Now try it.

Thank you for reading.

--

--