         if let type = document["type"] as? String {
             documentType = type
         }
-        guard let type = g_typeMapping[documentType] else {
-            return processError("Unknown type:".localized + "\(g_typeMapping[documentType]).")
+        guard let type = SwipeBrowser.typeMapping[documentType] else {
+            return processError("Unknown type:".localized + "\(SwipeBrowser.typeMapping[documentType]).")
         }
         let vc = type()
         guard let documentViewer = vc as? SwipeDocumentViewer else {

    }
}

//
// This is the place you can add more document types. 
// Those UIViewControllers MUST support SwipeDocumentViewer protocol.
//
let g_typeMapping:[String:(Void) -> UIViewController] = [
    "net.swipe.list": { return SwipeTableViewController(nibName:"SwipeTableViewController", bundle:nil) },
    "net.swipe.swipe": { return SwipeViewController() },
    "net.swipe.video": { return SwipeVideoController() }
]

protocol SwipeBrowserDelegate: NSObjectProtocol {
    func documentDidLoad(browser:SwipeBrowser)
}

// SwipeBrowser "hosts" another UIViewController, which supports SwipeDocumentViewer protocol.
//
class SwipeBrowser: UIViewController, SwipeDocumentViewerDelegate {
    //
    // This is the place you can add more document types. 
    // Those UIViewControllers MUST support SwipeDocumentViewer protocol.
    //
    static private var typeMapping:[String:(Void) -> UIViewController] = [
        "net.swipe.list": { return SwipeTableViewController(nibName:"SwipeTableViewController", bundle:nil) },
        "net.swipe.swipe": { return SwipeViewController() },
    ]
    static var stack = [SwipeBrowser]()
    static func register(type:String, factory:@escaping (Void) -> UIViewController) {
        typeMapping[type] = factory
    }
    
    public weak var delegate:SwipeBrowserDelegate?
    var notificationManager = SNNotificationManager()
