         var viewController: NSViewController
         var identifier: String
     }
+
+    fileprivate var segmentedControl: NSSegmentedControl!
 
     fileprivate let toolbarItemInfos: [ToolbarItemInfo] = [
         ToolbarItemInfo(title: SettingWindowViewControllerIdentifier.edit.rawValue,

                return
            }
        }
    }
}


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

extension SettingWindow: NSTouchBarDelegate {
    @available(OSX 10.12.2, *)
    func touchBar(_ touchBar: NSTouchBar, makeItemForIdentifier identifier: NSTouchBarItemIdentifier) -> NSTouchBarItem? {
        let touchBarItem = NSCustomTouchBarItem.init(identifier: identifier)
        switch identifier {
        case NSTouchBarItemIdentifier.segment:
            touchBarItem.view = segmentedControl
        default:
            ()
        }
        return touchBarItem
    }
}

private extension NSTouchBarItemIdentifier {
    static let segment = create(type: SettingWindow.self, suffix: "segment")
}
