Use lightweight generic declarations in ACEView

This commit is contained in:
Matthias Neeracher 2015-12-13 01:01:04 +01:00 committed by Matthias Neeracher
parent bf1bbf63b2
commit b7628c8c65
2 changed files with 4 additions and 4 deletions

View File

@ -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))!
}

View File

@ -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
}