Apologies
You must be signed in to watch this lesson.
Launching our Podcast Player
Podcasts
Looks like we're pretty much done with searching for podcasts and listing episodes inside our application. Now comes the most interesting part of the course where we begin implementing the feature that allows for audio playback. The first part of this section will involve the design of the player view, which I'll call PlayerDetailsView. When we tap on an episode cell, we'll load this custom view from our NIB file and add it to the application's window. Enjoy.

Comments (8)
Kilian Hiestermann
6 years ago
Is ?? "" a common practice in a real world application or a shortcut?
Raph
6 years ago
it is common practice in iOS development
Huo En Ci
6 years ago
Yes it is. Some reference material for you: https://stackoverflow.com/questions/26881838/how-do-you-use-the-optional-variable-in-a-ternary-conditional-operator
Raph
6 years ago
when I searched for the hunt talk ( although I dont like hunting ... :/ ) I get this in my console : to ATS policy 2018-03-02 14:18:46.594848+0100 Pocast Tutorial[7548:703677] NSURLConnection finished with error - code -1022 Optional("http://hunttalk.libsyn.com/rss") Does it for many other podcasts.... Help Brian, Help!! haha
Brian Voong
6 years ago
meher
5 years ago
Hi Brian , I am a little confused ,why do we access the "keyWindow" of our app and create a UIView using xib and show that UIView(PlayerDetailsView) on top of the "keyWindow" instead of just creating a "UIViewController" in xib and use the "present" method from "didSelectRowAt" function to go to that view controller we create?
Brian Voong
5 years ago
meher
5 years ago
thank you for the explanation, it makes sense now
dhekstro
5 years ago
Hi Brian, Tell me something, I still get a bit puzzled when it comes to decide where to put my components, either on an UIView or UIViewControler...And how to stack it on the Windows Views hierarchy, either using PushViewController and Pop or PresentViewController and Dismiss!! Which criteria should we consider to pick the right technique? For instance, on the episode 13 on the Podcast course where you build the PlayerDetailsView, you decided to use a UIView through XIB file instead of a UIViewController and present it via the "addSubview" on the window and then you added a .swift file to control and access it's properties...why? Couldn't you push or present it the PlayerDetailsView from the EpisodesController? Please help me to have a solid, clear understanding of these concepts so I can mae the right decision everytime I have to create a View to present something according to the context. Thanks in advance.
Brian Voong
5 years ago
dhekstro
5 years ago
Thanks a lot for the explanation.
humbleCoder
5 years ago
Hey Brian, I'm not sure if you go into this in a later video but instead of the dismiss button I added a swipe gesture recognizer to dismiss the view. Most of the videos/tutorials I've seen showing how to accomplish this used a view controller. Pretty cool framework out there called Hero which does this but with view controllers. I've seen the comments below, but was wondering if maybe in bonus content or a separate youtube video you can show some cool animations that show a view being dismissed from a swipe gesture?
Brian Voong
5 years ago
Maxnelson997
5 years ago
Love your name bro haha.
Maxnelson997
5 years ago
HumbleCoder
Kelvin Chen
4 years ago
Hi Brian, why we don't need to import SDWebImage before using sd_setImage? I remember we import that at both PodcastCell.swift & EpisodeCell.swift
Brian Voong
4 years ago
Adrian G Azpi
3 years ago
Works for me let window = UIApplication.shared.windows.filter {$0.isKeyWindow}.first let playerDetailsView = Bundle.main.loadNibNamed("PlayerDetails", owner: self, options: nil)?.first as! PlayerDetailsView playerDetailsView.episode = episode playerDetailsView.frame = self.view.frame window?.addSubview(playerDetailsView) }
weavers-web
3 years ago
After changing the description on Episode model, I am still getting HTML tag
HELP & SUPPORT