iamrmohamed / amkeyboardframetracker Goto Github PK
View Code? Open in Web Editor NEWSimple iOS Keyboard frame tracker for custom interactive Keyboard dismissal
License: MIT License
Simple iOS Keyboard frame tracker for custom interactive Keyboard dismissal
License: MIT License
My code:
@IBOutlet weak var viewMsgInput: UIView!
@IBOutlet weak var msgComBottomSpace: NSLayoutConstraint!
@IBOutlet weak var txtMessage: GrowingTextView!
var keyboardFrameTrackerView = AMKeyboardFrameTrackerView.init()
override func viewDidLoad() {
super.viewDidLoad()
self.keyboardFrameTrackerView = AMKeyboardFrameTrackerView.init(height: self.viewMsgInput.frame.height)
self.txtMessage.inputAccessoryView = self.keyboardFrameTrackerView
self.keyboardFrameTrackerView.delegate = self
}
extension ChatMessageVC: AMKeyboardFrameTrackerDelegate {
func keyboardFrameDidChange(with frame: CGRect) {
let vFrame_Height = self.view.frame.height
let bottomSapcing = vFrame_Height - frame.origin.y - self.keyboardFrameTrackerView.frame.height
self.msgComBottomSpace.constant = (bottomSapcing > 0) ? bottomSapcing : 0
self.view.layoutIfNeeded()
}
}
What wrong in my code ??
Please respond.
Thanks
Not a big deal, but when using the library, it behaved wrongly(the input view was leaving too much space than it actually needed) because of the IQKeyboardManager library that I was using.
I had to add the view controller that I was using this library with to the ignore list of the IQKeyboardManager
like following so:
IQKeyboardManager.shared.disabledDistanceHandlingClasses.append(ViewControllerType.self)
In my opinion, it would be great to mention this in the README.md
file. It took a while for me to find out what was the issue :).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.