Skip to content

fixed crash on iOS12 and added dismiss handler #21

Closed
luka-w wants to merge 7 commits intojoomcode:mainfrom
luka-w:main
Closed

fixed crash on iOS12 and added dismiss handler #21
luka-w wants to merge 7 commits intojoomcode:mainfrom
luka-w:main

Conversation

@luka-w
Copy link

@luka-w luka-w commented Jul 10, 2023

Fix crash on iOS 12 by providing missing initializer in navigation controller - #18
Additionally, provide dismiss handler

present(viewController, animated: true, completion: nil)
}

func presentBottomSheet(viewController: UIViewController, configuration: BottomSheetConfiguration, dissmisCompletion: @escaping (() -> Void)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this option optional and nil by default and delete function above presentBottomSheet(viewController:configuration:)? Then, we would have much less copy-paste

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, can you please fix a typo?

Suggested change
func presentBottomSheet(viewController: UIViewController, configuration: BottomSheetConfiguration, dissmisCompletion: @escaping (() -> Void)) {
func presentBottomSheet(viewController: UIViewController, configuration: BottomSheetConfiguration, dismissCompletion: @escaping (() -> Void)) {

Comment on lines +58 to +60
dismissCompletion: {
print("TWA: dismissCompletion")
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this option is not needed let's just ignore it and remove dismissCompletion?

present(viewController, animated: true, completion: nil)
}

func presentBottomSheet(viewController: UIViewController, configuration: BottomSheetConfiguration, dissmisCompletion: @escaping (() -> Void)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, can you please fix a typo?

Suggested change
func presentBottomSheet(viewController: UIViewController, configuration: BottomSheetConfiguration, dissmisCompletion: @escaping (() -> Void)) {
func presentBottomSheet(viewController: UIViewController, configuration: BottomSheetConfiguration, dismissCompletion: @escaping (() -> Void)) {

@mikhailmaslo
Copy link
Collaborator

I've implemented your proposal in release 2.0.3, so I'm closing this PR

Thank you for contribution 🚀

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