Comments (4)
Your first problem is easily explained by the fact that UIActionSheet
uses a separate window itself, and like you found out, that window is the key window, which is then captured and returned to after dismissing the alert. If you want to make that work together, you'd probably have to use actionSheet:didDismissWithButtonIndex:
to wait for the original window to become the key window again. Then that window is captured and will be returned to.
A workaround like yours is pretty fragile, as the window at index 0 may not be the window the user intends to return to either.
I'm not sure what's going wrong in your second example, though. Could you give a code example?
from sdcalertview.
Looks like my second case is the same thing, as it is also triggered off the same action sheet. I'm surprised that viewDidAppear: is called on the presented modal vc before the _UIAlertOverlayWindow is gone. I agree the above solution is fragile, mostly why I opened the issue. Having said that, seems less fragile than without it? If it isn't a UIWindow, it is going to fail, unless you go the actionSheet:didDismissWithButtonIndex: route ... but if you do that, am I understanding you right, the window stored in _userWindow doesn't matter anyway?
from sdcalertview.
Going to go with the actionSheet:didDismissWithButtonIndex: solution. Thanks for the help.
from sdcalertview.
It takes the current keyWindow and returns to that after dismissing the alert. If that keyWindow is a window specifically created for UIActionSheet
or UIAlertView
, or any other system UI for that matter, that will be the window the user is returned to.
Figuring out what the user really intended to return to is a lot harder than simply saying "sorry, but you're doing something that's not supported". I would say that that's something you're running into, and the easiest way to make it work is probably actionSheet:didDismissWithButtonIndex:
.
Thanks for your input, much appreciated!
from sdcalertview.
Related Issues (20)
- Swift 4.2 and Xcode 10.1 Compilation Issue HOT 2
- Convert to Swift 5 HOT 1
- SPM support HOT 7
- [Question] Exclude view from being dimmed HOT 1
- Error with Catalyst HOT 2
- AttributedTitle of AlertAction does not apply (Color, font, etc...) with ActionSheet
- Example app crash on iPad presenting UIAlertController
- Readme.md images cannot be loaded
- Evaluate support to popover ActionSheet on iPad HOT 3
- ActionSheet custom view vertical alignment
- Open components to inheritance outside SDCAlertView module HOT 4
- Rounded corners are circles instead of squircles
- Different look for dark theme in ios 13 and ios 12 HOT 6
- AlertController with preferredStyle of .actionSheet Does Not Correctly Display attributedTitle or attributedMessage
- Crash on iOS 15 HOT 2
- How to perform height animation on contentView correctly? HOT 1
- Warning when showing AlertView with textfield
- override var supportedInterfaceOrientations: UIInterfaceOrientationMask HOT 1
- Crash on tintColorDidChange HOT 1
- Privacy manifest required by Apple HOT 1
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 sdcalertview.