aslanyanhaik / youtube-iOS

youtube iOS app template written in swift 5
MIT License
2.54k stars 573 forks source link

Build Failed #5

Closed markantonyz closed 7 years ago

markantonyz commented 8 years ago

Tried to run the project on xCode, i got the same below error multiple times.

'default' label can only appear inside a 'switch' statement expected member name following '.'

aslanyanhaik commented 8 years ago

@markantonyz can you please tell me which version of xCode you are using? The current code is working under xCode 8 beta 5

tobitech commented 8 years ago

I'm using Xcode 7 and build failed

tobitech commented 8 years ago

Okay I updated to Xcode 8 and it built successful. Nice work man.

aslanyanhaik commented 8 years ago

updated to Xcode 8. Thank you guys very much for your contribution

tobitech commented 8 years ago

I Love your work. Just that some of us haven't started writing Swift. Please, can you make the Objective-C version if you have the time? Your implementations are quite handy @aslanyanhaik

aslanyanhaik commented 8 years ago

@tobitech this has been build using tutorials. https://www.youtube.com/watch?v=3Xv1mJvwXok&list=PL0dzCUj1L5JGKdVUtA5xds1zcyzsz7HLj I think you can make the objective-c version, by following him.

tobitech commented 7 years ago

@aslanyanhaik Using your code to build an app. I have an issue with passing data from the home screen to the video player. I mean I want to pass things like videoID and videoUrl to the video player when an item is selected on the home screen. I'm getting an exception if I don't pre-set the properties on the Video Player controller. How do I go about this, please?

aslanyanhaik commented 7 years ago

@tobitech in PlayerVC you will find a property named "link" which is a URL. Every time user selects video from the list, you should pass the video link to that property.

tobitech commented 7 years ago

@aslanyanhaik Thanks, but the issue I have with that is that if I set the video URL to the property link, the app throws an exception that link is nil even before the user select any video. You set the link to a global variable, but I want to set the link only when the user selects a video (which I know how to pass) but it's nil even before the user selects a video and I'm not supposed to pre-define the value of "link" like you did. So how do I make the video player to init with URL only if a video is selected (thus a link passed)?

aslanyanhaik commented 7 years ago

@tobitech make the link optional, so if it's nil it will not crash. Otherwise you can override the setter of that property to automatically set the link for the video player in order to avoid resetting again

tobitech commented 7 years ago

@aslanyanhaik Please In my own app, I have the view controllers embedded in a UITabBarController. So I have TabBars at the bottom (as normal). The issue now is that, when I drag the video player down to minimise, it covers the tabs tot the right. How do I get the height of the tab bar and change the position of the minimised state of the video player?

aslanyanhaik commented 7 years ago

@tobitech The floating player coordinates calculation is done to use whole screen. You should modify "positionDuringSwipe" method to fix that bug

tobitech commented 7 years ago

Hello! Thanks. I was able to move the minimised player upwards above the tab bar with proper spacing, but the tab bar items under it were still not selectable. Please how do I fix this?