 
     func willLoadNewResource() {
         // update the view
-        self.subViewLoadingPopup.hidden = false;
-        self.progressLoading.progress = 0;
-        self.viewActivityIndicator.startAnimating()
+        subViewLoadingPopup?.hidden = false;
+        progressLoading?.progress = 0;
+        viewActivityIndicator?.startAnimating()
         /** Move the gesture recognizer off the old view */
         if( contentView != nil
             && tapGestureRecognizer != nil ) {
-                contentView.removeGestureRecognizer(tapGestureRecognizer)
+                contentView?.removeGestureRecognizer(tapGestureRecognizer!)
         }
         
         labelParseTime?.removeFromSuperview() // we'll re-add to the new one
-        contentView.removeFromSuperview()
+        contentView?.removeFromSuperview()
     }
     
     /**

        ... because they "forgot" to store it anywhere (they read your view.transform as if it were a private
        variable inside UIScrollView! This causes MANY bugs in applications :( )
        */
        self.scrollViewForSVG.minimumZoomScale /= finalScale;
        self.scrollViewForSVG.maximumZoomScale /= finalScale;
    }
    
	var detailItem: AnyObject? {

                    tmpLayer.contentsScale = UIScreen.mainScreen().scale
                    tmpLayer.shouldRasterize = false
                    textLayerForLastTappedLayer = tmpLayer
                    contentView?.layer.addSublayer(textLayerForLastTappedLayer!)
                    /*
                    * mtrubnikov's code for adding a text overlay showing exactly what you tapped*/
                }
