Skip to content

Commit

Permalink
Merge pull request #74 from ufukcanakkaya/master
Browse files Browse the repository at this point in the history
Add animated parameter to addSheet function
  • Loading branch information
OfTheWolf authored Jun 16, 2022
2 parents 3bcd2bd + 0f20623 commit 844ca76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/UBottomSheet/Classes/Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import UIKit
extension UIViewController {
func ub_add(_ child: UIViewController,
in container: UIView,
animated: Bool = true,
animated: Bool,
topInset: CGFloat,
completion: (() -> Void)? = nil) {
addChild(child)
Expand Down
4 changes: 3 additions & 1 deletion Sources/UBottomSheet/Classes/UBottomSheetCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,19 +134,21 @@ public class UBottomSheetCoordinator: NSObject {
```
- parameter item: view controller which conforms to the Draggable or navigation controller which contains draggable view controllers.
- parameter parent: parent view controller
- parameter animated: if true, the sheet is being added to the view controller using an animation (default is true).
- parameter didContainerCreate: triggered when container view created so you can modify the container if needed.
- parameter completion: called upon the completion of adding item
*/
public func addSheet(_ item: UIViewController,
to parent: UIViewController,
animated: Bool = true,
didContainerCreate: ((UIView) -> Void)? = nil,
completion: (() -> Void)? = nil) {
self.usesNavigationController = item is UINavigationController
let container = PassThroughView()
self.container = container
parent.view.addSubview(container)
let position = dataSource.initialPosition(availableHeight)
parent.ub_add(item, in: container, topInset: position) { [weak self] in
parent.ub_add(item, in: container, animated: animated, topInset: position) { [weak self] in
guard let sSelf = self else {
return
}
Expand Down

0 comments on commit 844ca76

Please sign in to comment.