Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions FittedSheetsPod/SheetTransition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ public class SheetTransition: NSObject, UIViewControllerAnimatedTransitioning {
let heightPercent = contentView.bounds.height / UIScreen.main.bounds.height

// Use a normal animation to animate the shadown and background view
UIView.animate(withDuration: self.options.transitionDuration * 0.6, delay: 0, options: [.curveEaseOut]) {
if self.options.shrinkPresentingViewController {
UIView.animate(withDuration: self.options.transitionDuration * 0.6, delay: 0, options: [.curveEaseOut], animations: {
if self.options.shrinkPresentingViewController {

let topSafeArea = UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.safeAreaInsets.top ?? 0

presenter.view.layer.transform = CATransform3DConcat(CATransform3DMakeTranslation(0, topSafeArea/2, 0), CATransform3DMakeScale(0.92, 0.92, 1))
presenter.view.layer.cornerRadius = self.options.presentingViewCornerRadius
presenter.view.layer.masksToBounds = true
}
sheet.overlayView.alpha = 1
} completion: { _ in }
let topSafeArea = UIApplication.shared.windows.filter {$0.isKeyWindow}.first?.safeAreaInsets.top ?? 0
presenter.view.layer.transform = CATransform3DConcat(CATransform3DMakeTranslation(0, topSafeArea/2, 0), CATransform3DMakeScale(0.92, 0.92, 1))
presenter.view.layer.cornerRadius = self.options.presentingViewCornerRadius
presenter.view.layer.masksToBounds = true
}
sheet.overlayView.alpha = 1
})

// Use a bounce effect to animate the view in
UIView.animate(
Expand Down