             if let owner = self {
                 owner.environment.pushSettingsManager.setPushDisabled(!owner.notificationSwitch.on, forCourseID: owner.course.course_id)
             }}, forEvents: UIControlEvents.ValueChanged)
+        
+        self.webView.delegate = self
     }
     
     override func viewWillAppear(animated: Bool) {

    }
}

class CourseAnnouncementsViewController: UIViewController {
    let environment: CourseAnnouncementsViewControllerEnvironment
    let course: OEXCourse
    var announcements: [OEXAnnouncement]

        let baseURL = self.environment.config?.apiHostURL().flatMap { NSURL(string: $0 ) }
        self.webView?.loadHTMLString(displayHTML, baseURL: baseURL)
    }
    
    //MARK: - UIWebViewDeleagte
    
    func webView(webView: UIWebView, shouldStartLoadWithRequest request: NSURLRequest, navigationType: UIWebViewNavigationType) -> Bool {
        if (navigationType != UIWebViewNavigationType.Other) {
            if let URL = request.URL {
                UIApplication.sharedApplication().openURL(URL)
                return false
            }
        }
        return true
    }
}
