Swift – Build Your First App in 30 minutes – For Beginners – Music Player

In the first video of my Swift Beginner Series, you will build your first iOS App in Swift in 30 minutes in Xcode. Together, we will build a basic music player app that will play random songs from your iTunes library filtered by whatever genre you like.

If you’re just starting out learning Swift, go ahead and subscribe. More Beginner videos are on the way!

Source Code:

Follow me on Twitter:

List of Music Genre’s (make sure you match exactly):

Children’s Music
New Age
Christian & Gospel
Easy Listening
Fitness & Workout
Spoken Word
French Pop
German Pop
German Folk


James Noble says:

drake’s about to roll on through to sue sean allen for copyright infringement lmao

chris paulino says:

hey Allen thank you so much for this video. I just have one little problem when I finished I pressed build and when it pop’s up it say “thread 1: signal SIGABRT” witch its not letting me finish my build. what can I do??

Lohith Kumar says:

Hello Sean, i have an idea about making an amazing app with the music and i would like to get the whole list of songs where the users will have more options to get from. can you let me know how to pull the information and populate it on the tableview?
thanks a lot for making this amazing videos man. I’m a subscriber from around ~620. i think you are doing an amazing change where a lot of people can change this world. thanks a lot again Sean! hope you have a fantastic day!

Miles Niemeyer says:

Great video, thanks for being descriptive, I am completely new to this topic. Thanks

Max Ramirez says:

Hey Sean, firstly, thanks for the great tutorial! Secondly,I know you said you wouldn’t get into the topic of unwrapping, but I would like to know how you would unwrap this using either an if let statement, or guard statement. Just want to know how I can avoid force unwrapping if possible, and get better at optional-chaining. Thank You

Endemic Life says:


Where's Willy says:

How do you get it from your computer to your phone please so that you can run it

Ashwin Pande says:

I’m just getting a white background with nothing else when I test this on my iPhone 6s. Could you please help?

Jivat F says:

It tells me that i need to have OS X version 10.12.6, is there anything I can do to resolve this? It’s a mid 2014 Mac.

Saud Albukhari says:

Hi , when i want to build the app it just says failed << sorry for the bad English

Ziriko RuiGe says:

what about an app icon?

Like4Moon says:

Thank you for this great video! Keep up the good work 🙂

Giorgos Theodoropoulos says:

Bring back the Beginner Series Sean. We are hungry for knowledge!

Ziriko RuiGe says:

I just coded this for iPhone X display and I get two yellow triangles with an exclamation mark saying the width constraints may cause clipping, is that going to be an issue?

vLAd3 says:

Cannot call value of non-function type ‘MPMusicPlayerController’ – Error message

Roberto Reviglio della Veneria says:

Excellent !! I tried it and it’s work flawlessy…thank u very much !

sniper 3point says:

How can I keep the music playing in the background while the app closed? Nice vid

Christopher McElvogue says:

Would be cool if you did a video showing how to get the app onto the phone. Awesome tutorial!

steven Gao says:

regarding to the making app topic, i have a queston that i have searched everywhere, that why there is no video teach students how to make app setting page, for instance a switch button to enable or disable certain functions like notification etc., it maybe too easy, but i just can’t figure out how to do it, maybe Mr.Allen that you can make one course about it, or maybe anyone can give me a link about it. thanks in advance

hotmandead1 says:

Thanks For the great video
but I’m getting a warning that sender.currenttitle should be used on main thread …

Quick fix ?

Nick Alderslade says:

Great video – really like your enthusiasm 🙂

Kaiser HS Computer Science Club says:

If you guys want an alternative course with short videos, here is a good one : https://www.youtube.com/playlist?list=PLRGivqRHAr3o2kt_IduKju-rH-VW_0wXk

bhavna nemade says:

Binary operator ‘==’ cannot be applied to operands of type ‘MPMediaLibraryAuthorizationStatus’ and ‘_’ this error is showing on if status == .authorizes { }this if condition give me solution that what is the problem?

Sammy Pajammy says:

Dear Sean,
I really appreciate the video! I’m starting up as a developer now and there are a lot of tips and tricks that this video helped to clear up, so I want to thank you for that!

I also was hoping you could help me out with something. I’m declaring  our musicPlayer variable as so:

var musicPlayer = MPMusicController.applicationMusicPlayer()

And the compiler keeps returning with:
Cannot call value of non-function type ‘MPMusicPlayerController’

It’s a sigbart error, so (from what I gather) it’s supposed to be a linking issue, but I was wondering if you came across the same issue as myself.


Sean Allen says:

If you run into any issues while building this, please let me know. Happy to help clear things up and get you going again.

Slava Slava says:

thank you for my first app on iOS!

Sebastian Farias says:

Sean, I love your videos, really clean way to teach this stuff, Looking forward to more of these awesome videos!!

Hero Boss says:

HI so this is my very first App that im programming so im really new to this
And so i have a question: I have done everything like you did and i load id on my iphone 6 to test it. And i bought for this a Dance song from the i tunes store but it doesn’t work. Ich checked the code that we have written twice and i didn’t found any mistake. I really would be happy if you could help my as soon as you can because this is for my scool project that im have to present on Wednesday  evening (Europe time)

thomas39624 says:

Really enjoying your videos, easy to follow and great information! Really appreciate too how down to earth you are and relatable, the programming world can be intimidating but you make it feel attainable!

Antonio Hernandez says:

Thank you so much, I will become a app developer.

Abhiraj Sidhu says:

UIButton.currentTitle must be used from main thread only        —Can anyone reply me a fix for this error

Артем Зіньков says:

Hi, Sean!!

Which app would you advice to write – for juniors, that helps to understand what also need to learn more or better to apply for a job?

And also – are you planning to continue this series of vids but for intermediate and/or advanced developers?

Many thanks!
Stay awesome as you are 🙂

 Write a comment


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!