             toolbar.delegate = self
             return toolbar
         }()
+
+        segmentedControl = NSSegmentedControl.init(labels: toolbarItemInfos.map({ (toolbarItemInfo) -> String in
+            return toolbarItemInfo.title
+        }), trackingMode: .selectOne, target: self, action: #selector(SettingWindow.segmentSelected(_:)))
+        segmentedControl.trackingMode = .selectOne
+
         // 设置默认值
         toolbarItemSelected(identifier: .edit)
+    }
+
+    @available(OSX 10.12.2, *)
+    override func makeTouchBar() -> NSTouchBar? {
+        let touchBar = NSTouchBar()
+        touchBar.delegate = self
+        touchBar.customizationIdentifier = NSTouchBarCustomizationIdentifier.create(type: SettingWindow.self)
+        touchBar.defaultItemIdentifiers = [.segment]
+        return touchBar
     }
 
     // MARK: - private

    func toolbarSelectableItemIdentifiers(_ toolbar: NSToolbar) -> [String] {
        return toolbarDefaultItemIdentifiers(toolbar)
    }

    func toolbarItemSelected(identifier: SettingWindowViewControllerIdentifier) {
        toolbar?.selectedItemIdentifier = identifier.rawValue
        itemSelected(selectedItemIdentifier: identifier.rawValue)
    }

    func toolbarItemSelected(_ sender: NSToolbarItem) {
        itemSelected(selectedItemIdentifier: sender.itemIdentifier)
    }
}

        var viewController: NSViewController
        var identifier: String
    }

    fileprivate var segmentedControl: NSSegmentedControl!

    fileprivate let toolbarItemInfos: [ToolbarItemInfo] = [
        ToolbarItemInfo(title: SettingWindowViewControllerIdentifier.edit.rawValue,
