Skip to content
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

Fixes unsupported iOSApplicationExtension target in XCode 13 Beta 3 #20

Merged
merged 1 commit into from
Jul 20, 2021

Conversation

Feuerwerk
Copy link
Contributor

According to this thread every method that calls another method that is not available on iOSApplicationExtension target must also be annoted with @available(iOSApplicationExtension, unavailable). One possible solution would be to exclude BottomSheet from iOSApplicationExtension

@lucaszischka
Copy link
Owner

Thank you very much. I still don’t looked into this topic and don’t quite understand what you did, so please excuse my questions.
Does it compile now correctly and can it be used correctly on iOS 15?
Did you lap test if it still works on iOS 14?
Is the @available(iOSApplicationExtension, unavailable) required on all 3 places?

Thank you,
Lucas

@Feuerwerk
Copy link
Contributor Author

Feuerwerk commented Jul 20, 2021

Thank you very much. I still don’t looked into this topic and don’t quite understand what you did, so please excuse my questions.

You're welcome

Does it compile now correctly and can it be used correctly on iOS 15?

Yes, i compiles and runs flawlessly on my app using Xcode 13 Beta 3 with iOS Deployment Target 15

Did you lap test if it still works on iOS 14?

Yes, created a small SwiftUI-App on Xcode 12.5.1 opening the BottomSheet, can't see any problems.

Is the @available(iOSApplicationExtension, unavailable) required on all 3 places?

Yes. @available simply marks a method or type (including structs and classes) as unavailable on a certain target. Since we get the UIApplication.shared error, we have to mark the endEditing() method, but this is called from various places within BottomSheetView and since i have no idea how to selectively disable the endEditing call the only idea i came up with was disabling the whole BottomSheetView struct. But when i did this i also had to disable the extensions since they refer to BottomSheetView.
This simply means that BottomSheet is not available when building an iOS Application Extension but since it can't be used because of the UIApplication.shared call anyway there is no difference if i'm correct.

@lucaszischka
Copy link
Owner

Yes. @available simply marks a method or type (including structs and classes) as unavailable on a certain target. Since we get the UIApplication.shared error, we have to mark the endEditing() method, but this is called from various places within BottomSheetView and since i have no idea how to selectively disable the endEditing call the only idea i came up with was disabling the whole BottomSheetView struct. But when i did this i also had to disable the extensions since they refer to BottomSheetView.
This simply means that BottomSheet is not available when building an iOS Application Extension but since it can't be used because of the UIApplication.shared call anyway there is no difference if i'm correct.

Ah now i get it. Thank you very much. I will merge this now!

@lucaszischka lucaszischka merged commit 85fe1d0 into lucaszischka:main Jul 20, 2021
@lucaszischka lucaszischka mentioned this pull request Dec 27, 2021
lucaszischka added a commit that referenced this pull request Dec 28, 2021
- 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants