         }
     }
 
-    override func viewDidLoad() {
+    override func viewDidLoad()
+    {
         super.viewDidLoad()
-        // Do any additional setup after loading the view from its nib.
-
-        let vibrancyView = UIVisualEffectView(effect: UIVibrancyEffect.notificationCenterVibrancyEffect())
-
-        //vibrancyView.backgroundColor =  UIColor(white: 255.0, alpha: 0.15)
-        view.addSubview(vibrancyView)
 
         resetContentSize()
         tableView.reloadData()
     }
 
+    // MARK: - NotificationCenter
 
     func widgetMarginInsetsForProposedMarginInsets( defaultMarginInsets: UIEdgeInsets) -> UIEdgeInsets
     {
         return UIEdgeInsetsZero;
-        return UIEdgeInsetsMake( defaultMarginInsets.top, 30.0, defaultMarginInsets.bottom, 10)
-    }
-
-
-    func widgetPerformUpdateWithCompletionHandler(completionHandler: ((NCUpdateResult) -> Void)!) {
+    }
+
+
+    func widgetPerformUpdateWithCompletionHandler(completionHandler: ((NCUpdateResult) -> Void)!)
+    {
         // Perform any setup necessary in order to update the view.
 
         // If an error is encoutered, use NCUpdateResult.Failed

        let stationInfo = self.fetchedResultsController.objectAtIndexPath(indexPath) as CDStation

        let url = NSURL.URLWithString("vindsiden://station/\(stationInfo.stationId)?todayView=1")
        extensionContext.openURL(url, completionHandler: nil)
    }

    // NSFetchedResultsController

    var fetchedResultsController: NSFetchedResultsController {
        if let actual = _fetchedResultsController {

        }
    }

    // MARK: -

    lazy var speedFormatter : NSNumberFormatter = {

        let _speedFormatter = NSNumberFormatter()
        _speedFormatter.numberStyle = NSNumberFormatterStyle.DecimalStyle
        _speedFormatter.maximumFractionDigits = 1
        _speedFormatter.minimumFractionDigits = 1
        //_speedFormatter!.minimumSignificantDigits = 1
        _speedFormatter.notANumberSymbol = "—.—"
        _speedFormatter.nilSymbol = "—.—"

        return _speedFormatter
    }()

    func resetContentSize() {
        var preferredSize = preferredContentSize
        preferredSize.height = preferredViewHeight
        preferredSize.width = 320.0;
        preferredContentSize = preferredSize
    }

    var preferredViewHeight: CGFloat {
        let itemCount = (fetchedResultsController.fetchedObjects as Array!).count
        let rowCount = showingAll ? itemCount : min(itemCount, TableViewConstants.baseRowCount + 1)
        let font = UIFont.preferredFontForTextStyle(UIFontTextStyleSubheadline)
        var size = (font.pointSize*2)+TableViewConstants.todayRowPadding

        size = max(TableViewConstants.todayRowHeight, size)

        if !showingAll {
            return CGFloat(Double(rowCount-1) * Double(size)) + TableViewConstants.todayRowHeight
        } else {
            return CGFloat(Double(rowCount) * Double(size))
        }
    }
}
