Reputation: 109
I am trying to update this deprecated method: 'presentMoviePlayerViewControllerAnimated' however I am not able to import AVKit and use AVPlayerViewContoller. It seems like my Xcode is not seeing this framework somehow.
Here is my code:
MatchDetailsVC.m
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath (NSIndexPath *)indexPath {
YoutubeVideoModel* video = [_videos objectAtIndex:indexPath.row];
XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [[XCDYouTubeVideoPlayerViewController alloc] initWithVideoIdentifier:video.videoID];
=>[self presentMoviePlayerViewControllerAnimated:videoPlayerViewController];
Cannot access the AVKit files: using CM + click
MatchDetalisVC.m UPDATE
[self presentViewController:videoPlayerViewController animated:YES completion:nil];
Changed the last line with this. No errors. It seems I don't have to #import AVKit in my ViewController as well. Is it correct though?
Upvotes: 1
Views: 4595