I have a `UIWebView` that plays video. I'd like the video to continue playing when the app goes to the background state. In Apple's [Technical Q&A QA1668](https://developer.apple.com/library/ios/qa/qa1668/_index.html), they state:

> 
> If the AVPlayer's current item is displaying video on the device's
>  display, playback of the AVPlayer is automatically paused when the app
>  is sent to the background. There are two ways to prevent this pause:
> 
> 
> Disable the video tracks in the player item (file-based content only).
>  See Listing 2. Remove the AVPlayerLayer from its associated AVPlayer
>  (set the AVPlayerLayer player property to nil). See Listing 3.
> 
> 
> 

The following code is what's shown under Listing 3. 

```
#import <UIKit/UIKit.h>
#import <AVFoundation/AVFoundation.h>

@interface MyPlayerLayerView : UIView
@end

@implementation MyPlayerLayerView

- (AVPlayerLayer *)playerLayer {
  return (AVPlayerLayer *)[self layer];
}

+ (Class)layerClass {
  return [AVPlayerLayer class];
}

@end

@interface MyAppDelegate : UIResponder <UIApplicationDelegate>
...
@end

@implementation MyAppDelegate

...

/* Remove the AVPlayerLayer from its associated AVPlayer
    once the app is in the background. */
- (void)applicationDidEnterBackground:(UIApplication *)application {
  MyPlayerLayerView *playerView = <#Get your player view#>;
  [[playerView playerLayer] setPlayer:nil]; // remove the player
}

/* Restore the AVPlayer when the app is active again. */
- (void)applicationDidBecomeActive:(UIApplication *)application {
  MyPlayerLayerView *playerView = <#Get your player view#>;
  [[playerView playerLayer] setPlayer:_player]; // restore the player
}

...

@end

```

I'm trying to convert it to Swift but am confused as to what to do at `<#Get your player view#>;` Can someone clarify what that means and/or how to go about this in Swift?