This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // VirtualKeyboard.swift | |
| // MacBook Air M1 Zhuyin Keyboard | |
| // Written with SwiftUI ~=300 LOC, < 4hrs | |
| // Created by Ethan Huang on 2021/1/13. | |
| // Twitter: @ethanhuang13 | |
| import SwiftUI | |
| struct VirtualKeyboard: View { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func animation(from notification: Notification) -> Animation? { | |
| guard | |
| let info = notification.userInfo, | |
| let duration = info[UIResponder.keyboardAnimationDurationUserInfoKey] as? Double, | |
| let curveValue = info[UIResponder.keyboardAnimationCurveUserInfoKey] as? Int, | |
| let uiKitCurve = UIView.AnimationCurve(rawValue: curveValue) | |
| else { | |
| return nil | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @interface SREAGLContext : NSObject | |
| + (EAGLContext*)sharedContext; | |
| + (EAGLContext*)newContext: (EAGLRenderingAPI) api; | |
| @end | |
| @implementation SREAGLContext |