Use lightweight generic declarations in ACEView
This commit is contained in:
parent
bf1bbf63b2
commit
b7628c8c65
|
@ -10,7 +10,7 @@ import Foundation
|
|||
|
||||
extension ACEView {
|
||||
class func themeIdByName(themeName: String) -> ACETheme? {
|
||||
for (themeIdx, theme) in (ACEThemeNames.themeNames() as! [String]).enumerate() {
|
||||
for (themeIdx, theme) in ACEThemeNames.themeNames() .enumerate() {
|
||||
if themeName == theme {
|
||||
return ACETheme(rawValue: UInt(themeIdx))
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ extension ACEView {
|
|||
}
|
||||
|
||||
class func handlerIdByName(handlerName: String) -> ACEKeyboardHandler? {
|
||||
for (handlerIdx, handler) in (ACEKeyboardHandlerNames.humanKeyboardHandlerNames() as! [String]).enumerate() {
|
||||
for (handlerIdx, handler) in ACEKeyboardHandlerNames.humanKeyboardHandlerNames().enumerate() {
|
||||
if handlerName == handler {
|
||||
return ACEKeyboardHandler(rawValue: UInt(handlerIdx))!
|
||||
}
|
||||
|
|
|
@ -52,12 +52,12 @@ class ASApplication: NSObject, NSApplicationDelegate, NSMenuDelegate {
|
|||
}
|
||||
func applicationDidFinishLaunching(aNotification: NSNotification) {
|
||||
themeMenu.removeAllItems()
|
||||
for (index, theme) in (ACEThemeNames.humanThemeNames() as! [String]).enumerate() {
|
||||
for (index, theme) in ACEThemeNames.humanThemeNames().enumerate() {
|
||||
let menuItem = themeMenu.addItemWithTitle(theme, action: "changeTheme:", keyEquivalent: "")!
|
||||
menuItem.tag = index
|
||||
}
|
||||
keyboardMenu.removeAllItems()
|
||||
for (index, theme) in (ACEKeyboardHandlerNames.humanKeyboardHandlerNames() as! [String]).enumerate() {
|
||||
for (index, theme) in ACEKeyboardHandlerNames.humanKeyboardHandlerNames().enumerate() {
|
||||
let menuItem = keyboardMenu.addItemWithTitle(theme, action: "changeKeyboardHandler:", keyEquivalent: "")!
|
||||
menuItem.tag = index
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user