AVRSack/AVRsack/ACEViewExt.swift

29 lines
816 B
Swift
Raw Normal View History

2014-12-31 03:16:43 +00:00
//
// ACEViewExt.swift
// AVRsack
//
// Created by Matthias Neeracher on 29/12/14.
// Copyright (c) 2014 Aere Perennius. All rights reserved.
//
import Foundation
extension ACEView {
2015-03-14 20:15:27 +00:00
class func themeIdByName(themeName: String) -> ACETheme? {
for (themeIdx, theme) in ACEThemeNames.themeNames() .enumerate() {
2014-12-31 03:16:43 +00:00
if themeName == theme {
2015-03-14 20:15:27 +00:00
return ACETheme(rawValue: UInt(themeIdx))
2014-12-31 03:16:43 +00:00
}
}
return nil
}
class func handlerIdByName(handlerName: String) -> ACEKeyboardHandler? {
for (handlerIdx, handler) in ACEKeyboardHandlerNames.humanKeyboardHandlerNames().enumerate() {
2014-12-31 03:16:43 +00:00
if handlerName == handler {
return ACEKeyboardHandler(rawValue: UInt(handlerIdx))!
}
}
return nil
}
}