Comments (5)
I'm super busy, but I will do my best to take a look at this soon. It is a fairly obscure feature, so I wouldn't be surprised if it has some rough edges.
from swiftmessages.
I took a look and found a couple of issues:
First, KeyboardTrackingView
is based on notifications. If you create a new one after the keyboard has already appeared, it won't know the current state of the keyboard. This was designed before keyboard layout margins existed :(
I have a slightly modified version of KeyboardTrackingView
that works if you hold onto it in your view controller and reuse the same instance with each message view. However, there is still a small issue related to safe area. All of the nib files provided with SwiftMessages rely on the layoutMargins
property to position the content. When you show a message, the appropriate layout margins are calculated based on the safe area. This can cause problems when combined with the keyboard tracking behavior:
- If the message is displayed before the keyboard appears, the bottom margin is too big after the keyboard pushes it up.
- If the message is displayed before the keyboard appears, the bottom margin is too small if the keyboard is dismissed, leaving the message view in the safe area.
Again, this stuff was designed before safe area existed :(
I'm not going to have time to rework the layout system for this particular issue. However, if you're willing to use your own view that internally constrains the content to bottom safe area, rather than one of the bundled nib files, I think my updated KeyboardTrackingView
will probably work for you.
Let me know what you think.
from swiftmessages.
Awesome, thanks for looking into this. I saw you made some changes in 9.0.9, so I'll play around with that and creating our own view and let you know how it goes.
from swiftmessages.
The idea with the updated KeyboardTrackingView
is that your view controller needs to create and hold onto a single instance and use that instance for each message. That way it retains the memory of the state of the keyboard. For the view, you need to set it up such that it uses Auto Layout to avoid the safe area rather than having SwiftMessages calculate the margins. I can help out with that if you get stuck.
from swiftmessages.
Great! I've installed a KeyboardTrackingView
in my view controller and modified a copy of the CardView
nib to constrain the bottom of the corner rounding view to the bottom safe area (minus an 8pt margin) and that seems to be working well. Thanks so much!
from swiftmessages.
Related Issues (20)
- Crash while clicking two times to hide the presenting controller HOT 3
- SwiftUI View ignoresSafeArea HOT 4
- SwiftMessages custom CenteredView extends to the screen's full height HOT 3
- How can I show multiple alert? HOT 2
- Safe area insets are not respected when setting overrideUserInterfaceStyle on a MessageView in iOS 17 HOT 3
- Xcode warnings in two swift files HOT 2
- window being accessed from background thread when dequeueNext is called HOT 12
- EventListeners not called ? HOT 5
- Support for SwiftUI Mac OS HOT 1
- SwiftUI message shown under navigation bar is clipped at top HOT 1
- issue with building for device HOT 1
- Breaking change released in patch release HOT 10
- why didHide Source dismiss? HOT 3
- Cannot build on physical device but can on a simulator. HOT 1
- Support App Privacy Manifest HOT 1
- Message opened via SwiftMessagesSegue closes by itself after 2 seconds (regression, appeared in 9.0.7) HOT 3
- Add Privacy manifests file HOT 11
- Create a formal dismissal mechanism for SwiftUI message
- Why do you call this SwiftMessages? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiftmessages.