     }
     
     
-    private func _buttonViewWithImage(image: UIImage, text: String, buttonTag: GSButtonTag) -> UIStackView {
+    private func _buttonViewWithImage(image: UIImage, text: String, buttonTag: ButtonTag) -> UIStackView {
         
         let button = UIButton(type: .Custom)
         button.tag = buttonTag.rawValue

        let view = UIVisualEffectView(effect: blur)
        return view
    }()
    private var _state: GSState? {
        didSet {
            if _state == nil {
                return

import SnapKit
import FontAwesome

class GlobalSearchViewController: UISearchController, UISearchBarDelegate, UIGestureRecognizerDelegate {
    
    struct NavigationInfo {
        
        static func height(state: State) -> CGFloat {
            var height = 0
            if state == .InactiveRegular || state == .ActiveRegular {
                height = 64
            } else {
                height = 32
            }
            return CGFloat(height)
        }
        
        static func topMargin(state: State) -> CGFloat {
            var topMargin = 0
            switch state {
            case .InactiveRegular:
                topMargin = 44
            case .InactiveCompact:
                topMargin = 32
            default:
                topMargin = 0
            }
            return CGFloat(topMargin)
        }
    }
    
    struct LayoutInfo {
        
        static let ContentHeight = CGFloat(80)
        static let ContentFontSize = CGFloat(12)
        static let ContentPadding = CGFloat(5)
        
        static func topMargin(state: State) -> CGFloat {
            var topMargin = 0
            switch state {
            case .InactiveRegular:
                topMargin = 144
            case .InactiveCompact:
                topMargin = 112
            case .ActiveRegular:
                topMargin = 100
            case .ActiveCompact:
                topMargin = 68
            }
            return CGFloat(topMargin)
        }
    }
    
    enum ButtonTag : Int {
        case Unknown = 0
        case Timeline = 1
        case Article = 2
        case Celebrity = 3
    }
    
    enum State : Int {
        case InactiveRegular
        case InactiveCompact
        case ActiveRegular
        case ActiveCompact
    }
    
    struct TitlePlaceholder {
        static let Timeline = NSLocalizedString("朋友圈", comment: "Timeline")
