         }
     }
     
+    var isStateFirstInit = false
+    
     var state: SkillHomeState = .Master {
         willSet {
-            
             
             switch newValue {
             case .Master:

    }
    
    override func viewDidLayoutSubviews() {
        super.viewDidLayoutSubviews()
        
        println("Resize height")
        
        let height = YepConfig.getScreenRect().height - headerView.frame.height
        
        skillHomeScrollView.contentSize = CGSize(width: skillHomeScrollView.frame.size.width*2, height: height)
        masterTableView.frame = CGRect(x: 0, y: 0, width: skillHomeScrollView.frame.size.width, height: height)
        learningtTableView.frame = CGRect(x: masterTableView.frame.size.width, y: 0, width: skillHomeScrollView.frame.size.width, height: height)
        
    }

    override func viewDidAppear(animated: Bool) {
        super.viewDidAppear(animated)
        state = .Master
    }
    
    func changeToMaster() {
        state = .Master
    }
    
    
    func changeToLearning() {
        state = .Learning
    }
    

                headerView.masterButton.setInActive()
                headerView.learningButton.setActive()
                skillHomeScrollView.setContentOffset(CGPoint(x: masterTableView.frame.size.width, y: 0), animated: true)
   
            }
            
        }
