     // VIEW DID APPEAR
     override func viewDidAppear(animated: Bool) {
         
+        self.navigationController!.navigationBar.addSubview(runkeeperSwitch)
         self.navigationController!.navigationBar.tintColor = UIColor.whiteColor()
         UITextField.appearance().keyboardAppearance = .Light
         UIStatusBarStyle.LightContent

    @IBOutlet weak var blurView: UIVisualEffectView!
    var arrayOfValues: Array<AnyObject> = [3,30,50,40,80]
    var user = User(username: "", email: "", first_name: "", last_name: "", cust_id: "", picture: "")
    
    @IBOutlet weak var segmentedControl: UISegmentedControl!
    @IBOutlet weak var switchBal: DGRunkeeperSwitch?
    @IBOutlet weak var navigationBar: UINavigationItem!

        let navItem = UINavigationItem(title: "")
        navBar.setItems([navItem], animated: true)
        
        runkeeperSwitch.backgroundColor = UIColor.clearColor()
        runkeeperSwitch.selectedBackgroundColor = UIColor.whiteColor()
        runkeeperSwitch.titleColor = UIColor.whiteColor()
        runkeeperSwitch.selectedTitleColor = UIColor.protonBlue()
        runkeeperSwitch.titleFont = UIFont(name: "Nunito-SemiBold", size: 13.0)
        runkeeperSwitch.frame = CGRect(x: view.bounds.width - 205.0, y: 15, width: 200, height: 30.0)
        //autoresizing so it stays at top right (flexible left and flexible bottom margin)
        runkeeperSwitch.autoresizingMask = [.FlexibleLeftMargin, .FlexibleRightMargin]
        runkeeperSwitch.bringSubviewToFront(runkeeperSwitch)
        runkeeperSwitch.addTarget(self, action: #selector(HomeViewController.indexChanged(_:)), forControlEvents: .ValueChanged)
        
        tableView.frame = CGRect(x: 0, y: 340, width: width, height: height-100)
        self.view.addSubview(tableView)
