iTunes REST-API: Swift Tutorial
A free video tutorial from Michael Rudowsky
Swift Developer and Teacher
4.4 instructor rating • 1 course • 417 students
In this lecture, you are going to learn all about the iTunes REST-API.
Learn more from the full courseiOS 9 and Swift 2: Step It Up!
Learn By Doing & Take Your App Building Skills to the Next Level
17:34:51 of on-demand video • Updated June 2016
- Learn source control with Git/Github & Xcode integration
- Understand the model-view-controller design pattern & best coding practices
- Use available REST-APIs to build apps
- Understand the JSON format & use the JSON Editor
- Handle back-end processing using grand central dispatch
- Obj C Class - Reachability using Swift Bridging Header
- Add search bar
- Create a settings page
- Add refresh functionality
- Stream and play videos
- Implement Touch ID
- Implement social media sharing
- Implement In-App Email
English [Auto] Walk them back. This is Lesson 8 intro to the iTunes API in this lecture. I'm going to walk you through how we're going to build. Are you are able to use for our music video app now Apple. It gives us a Web site that we can go to where we can go through and answer questions through dropdown boxes and it dynamically builds our euro that we can to use for our app. Now as I mentioned earlier if you use other API you're going to have to go to their documentation because every API is different and and you're going to have to you know build your own your own based on whatever the doc mutation tells you. But in this situation I'm going to show you exactly what we need to do to build for our app that we're going to build. So let's go and look at the iTunes generator Web site. Now this is the Web site. It's called RSS on iTunes that Apple dot com. So a lot we go right to it now as you can see it has dropped down boxes. First part is country. So I have an option to say I want the top music videos. And I can specify which country for example if I want it from a from Vietnam I can get all top music videos from Vietnam. We're going to we're going to stick with the United States but whatever country you're from. Just select your country and you'll get all the music videos from that particular location or media type. They gave you a lot of options because if you decide you want to expand or fool around with the app and do other things you instead of just using music videos you have that option. You can do audio books you can do books apps. You can do everything in movies. We're going to go right here. Music videos. And as soon as you click the feed type says top music videos and that stays the same the size is how many I want to bring back in my case on file. So we're going to bring back the top 10 music videos in the iTunes store from the United States. The genre is all you have an option. You can go big band blues dance. We're going to stick with all. And of course explicit content. We're going to say no. And as you can see down here it actually dynamically built are l with parameters and values so we don't have to worry about doing that ourselves. But as you can see it says SML. So what we need to do is we change that X-amount to Jaison. So we when we execute this in our browser we're going to get the Jason response so what we're going to do is we're just going to copy this you're out. That was dynamically built from all the parameters from here. Put it up on top here and paste it into our browser and just type in Jason and hit enter and there you go. This is our this is our response. This is our Jaisalmer response from the top 10 top music videos from the United States in the iTunes store. Now this might look very confusing. And but it really isn't and I'm going to show you because we're going to we're going to go through now what is called a Jasen Ed. And it's going to put all this in and it's going to make it so easy for us to look at our our fields and determine what we want and need to take this Jaison and copy it on my clipboard so we're going to go right up here. Select all and copy and when I go to the chase on Ed. I can paste it in there and then we can go and see the results. Now let's go back to our presentation and we're going to work at it adjacent Ed.. Now the one we're going to use is Jason Editor-At-Large online dark. Now there are many Jason editors out there who feel free to use whatever you like. This is the one that I use all the time. I find it to be the easiest. I like them but they're all pretty much the same. So it's it's all preference. So let's click on. And if you go over to the on the left hand side it's going to be the Jason that we actually got when we executed our browser and on the right hand side is going to put it in a nice structured format and break everything down so we can read it. So we go over to the left hand side and I hit paste and then I hit this hour right here. It put everything over here. Now I'm going to do is I'm just going to move this to the left to get it out of the way I just highlight and move it over. Now I hit this but where is this feed. It broke everything down for me. Now as I mentioned earlier in the last lecture our root object is a dictionary. And if we look at the feet and it has these values. Now if you notice here the entry is 10. This is an array. So let's click it. All arrays start with zero base. When you when you see 0 that's really our first element and nine is the tenth. So let's click on the first element here and you can see here. This is the string. And this is the value so the name is hands to myself. If I go writes It's the name it's the record company label. If I want to look click this it's the price. So again this is these are dictionaries I mentioned before on the left hand side and then the right hand side of the value. Now another interesting this is the image and we have three images to show you with the three images are. And each of these have different levels of of how they are in terms of quality of the image. Now I'm going to show you when we actually get down to our ability our music video. A little trick that actually allow you to make that image to be any image any resolution you want. So that's kind of close this out for now. And then of course we have the artist which is the first one is a Selena Gomez the title as I mentioned here's the name of the title. The idea here and as you see here the idea here is is this is this is the unique identifier for this artist when we get down to the bonus section of the future we're going to expand our music video out. And later on what we're going to do is if we want to see all the music videos that belong to a specific artist we can actually specify this ID. And and that's another way of expanding our app and add more functionality to it. But we'll get that's something we're just going to store right now and I'll discuss that more with you when we finish our project. And if we go over to the link and this is really neat here too is I'll just show you some of the fields we have here. This is the this is our preview of our music video and right here is the you are l that we can put in our browser and play the music video. So let me do so before we actually play it. I just wanted to show you that we're going to look at these fields and we're going to decide what information that we want to capture in our data model that we want to have on our app. But as you see this it's very organized it's very easy to read and. And I'm also going to show you how we can parse this data in logic when we get down to our back and when we actually start doing our back end processing and building our music video app. But for this particular presentation I just wanted to show you the Jason enter and show you how easy it is to look at information. Now before we end the video I just wanted to show you if I would just take this this you're out because again in our music video out of stream video from the Internet in within our app and we're going to right click and copy it if I put this in my browser and I play it it plays the music video. It'll play about a 30 second clip. So let's go back to our presentation now. So anyway so this ends the presentation on iTunes API so that the next video we're going to talk about the challenge. This is our first challenge and I'll see the.