Skip to content

Commit

Permalink
APP-7009 : 커스텀 탑뷰 클래스 네이밍 prefix Pan 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyunsik-Yoo committed Jun 13, 2023
1 parent 785d08c commit 8c20140
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions PanModal/Animator/PanModalPresentationAnimator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class PanModalPresentationAnimator: NSObject {

// Use panView as presentingView if it already exists within the containerView
let panView: UIView = transitionContext.containerView.panContainerView ?? toVC.view
let topView = transitionContext.containerView.customTopView
let topView = transitionContext.containerView.panCustomTopView
let topViewHeight: CGFloat = {
if let topViewHeight = topView?.frame.height {
return topViewHeight + PanModalPresentationController.Constants.customTopViewOffset
Expand Down Expand Up @@ -94,7 +94,7 @@ public class PanModalPresentationAnimator: NSObject {

let presentable = fromVC as? PanModalPresentable.LayoutType
let panView: UIView = transitionContext.containerView.panContainerView ?? fromVC.view
let topView = transitionContext.containerView.customTopView
let topView = transitionContext.containerView.panCustomTopView
let topViewHeight: CGFloat = {
if let topViewHeight = topView?.frame.height {
return topViewHeight + PanModalPresentationController.Constants.customTopViewOffset
Expand Down
2 changes: 1 addition & 1 deletion PanModal/Presentable/PanModalPresentable+Defaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public extension PanModalPresentable where Self: UIViewController {
return true
}

var panCustomTopView: CustomTopView? {
var panCustomTopView: PanCustomTopView? {
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion PanModal/Presentable/PanModalPresentable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public protocol PanModalPresentable {
*/
var showDragIndicator: Bool { get }

var panCustomTopView: CustomTopView? { get }
var panCustomTopView: PanCustomTopView? { get }

/**
Asks the delegate if the pan modal should respond to the pan modal gesture recognizer.
Expand Down
6 changes: 3 additions & 3 deletions PanModal/View/CustomTopView.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import UIKit

open class CustomTopView: UIView {
open class PanCustomTopView: UIView {

}

extension UIView {
var customTopView: CustomTopView? {
return subviews.compactMap({ $0 as? CustomTopView }).first
var panCustomTopView: PanCustomTopView? {
return subviews.compactMap({ $0 as? PanCustomTopView }).first
}
}
4 changes: 2 additions & 2 deletions Sample/View Controllers/BasicViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ extension BasicViewController: PanModalPresentable {
return false
}

var panCustomTopView: CustomTopView? {
var panCustomTopView: PanCustomTopView? {
return topView
}
}

extension BasicViewController {
final class TopView: CustomTopView {
final class TopView: PanCustomTopView {
enum Layout {
static let size = CGSize(width: UIScreen.main.bounds.width, height: 50)
}
Expand Down

0 comments on commit 8c20140

Please sign in to comment.