Skip to content
Stephan Yannick edited this page Apr 5, 2016 · 1 revision

Use in Swift :

extension MNArticleViewController: ASMediasFocusDelegate {

func parentViewControllerForMediaFocusManager(mediaFocusManager:ASMediaFocusManager) -> UIViewController {
    return self.parentViewController!
}

func mediaFocusManager(mediaFocusManager:ASMediaFocusManager, mediaURLForView:UIView) -> NSURL {
    guard let urlString = content?.url,
        let url = NSURL(string:urlString) else {
            return NSURL()
    }
    return url
}

func mediaFocusManager(mediaFocusManager:ASMediaFocusManager, titleForView:UIView) -> String {
    guard let media = content?.description else {
        return ""
    }
    return description
}

}

        mediaFocusManager.delegate = self
        mediaFocusManager.installOnView(headerView.getBackgroundImageView())
        mediaFocusManager.setDefaultDoneButtonText("Fermer", withColor: UIColor.whiteColor())
Clone this wiki locally