-
-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xcode 13: Compiler-Error UIApplication.shared #19
Comments
Thank you for pointing this out. For now you can do your own testing and research and if you find a Solution working for iOS 13, 14 and 15 don’t hesitate to open a pull request. I will leave this issue open, as it is technically a bug, but before the final release of Xcode 13 i won’t fix it. Greetings Lucas |
This might help: https://twitter.com/twannl/status/1415643870512226307 |
@Wouter01 Yes thank you. I saw your fork, and if you could fix it (I’m unable to test it, because I’m not using Xcode 13) it would be nice if you would open a pull request. Greetings Lucas |
I did have a look but wasn't able to fix it. I got it working on another library with this method, so it will probably be solvable in this way, but I currently do not have time to take a further look at it. |
Ah ok, no worries 👍 |
I've tested it with the information in the twitter feed mentioned by @Wouter01 but this doesn't seem to work. As far as i understand this piece of code must be moved in a separate file which must be excluded from the iOSApplicationExtension-Target. I'm currently thinking of two files both containing only the function endEditing(). One containing the implementation as it is currently and one is empty (for the moment). Then the empty one must be used with the iOSApplicationExtension-Target and the other file must be used with all other targets. But i have little knowledge about the package-description to explicitly include / exclude a file from a specific target. |
Thank you all for your help regarding this problem. @Feuerwerk @Wouter01 could one of you please test this code and see if it works for now? private func endEditing() -> Void {
if #available(iOS 15, *) {
//No solution right now
} else {
UIApplication.shared.windows.filter{$0.isKeyWindow}.first?.endEditing(true)
}
} Thank you, |
@LucasMucGH I tested this already, doesn't work. because #available is a test at runtime but UIApplication.shared is not available at compile time. |
Ah ok, thank you. |
There is a discussion about this "feature" at swift.org |
- Update Copyright - Update swift-tools-version - Update deprecated code (real fix for #19, replaces #20) - Add `.absolutePositionValue` option (closes #37) - Add `BottomSheetPositionAbsolute` - Use explicit animations (fixes #31) - Hide examples in ReadMe - Implement and fix `.appleScrollBehavior` (closes #37)
The method
private func endEditing() -> Void {
UIApplication.shared.windows.filter{$0.isKeyWindow}.first?.endEditing(true)
}
throws a compiler error using BottomSheet in Xcode 13 Beta 3 for an iOS project (Deployment Target 15) saying that UIApplication extensions are not available for iOS and you should rely on ViewController functionality.
The text was updated successfully, but these errors were encountered: