我是敏捷和MVC架构模式的初学者。我一直在收到此错误,“在范围内找不到'getKeyboardHeight'”,每当我尝试实现某些东西时,都会出现“无法在范围内找到... getKeyboardHeight”错误,而我只是无法弄清楚如何解决它。我将从视图控制器以及模型中粘贴代码,因为我怀疑这是从该代码中获取的。谢谢您的帮助!
@objc func keyboardWillShow(_ notification:Notification) {
view.frame.origin.y = -getKeyboardHeight(notification)
}
func subscribeToKeyboardNotification() {
Notification.default.addObserver(self, selector: #selector(keyboardWillShow(_:)),
name: UIKeyboardWillShow, object: nil)
}
这是我的模特
import UIKit
Class MemeModel: NSObject {
var image: UIImage?
var topText: String?
var bottomText: String?
init(topText: String?, bottomText: String?, image: UIImage?) {
super.init()
self.topText = topText
self.bottomText = bottomText
self.image = image
}
}