Slide 21
Slide 21 text
BackϘλϯͰͷભҠ
class HCRootAnimatedTransitioning: NSObject, UIViewControllerAnimatedTransitioning {
@objc func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
//লུ
var initialFrame: CGRect?
if let rootVC = toVC as? HCRootViewController, let pagingVC = fromVC as? HCPagingViewController {
let indexPath = pagingVC.currentIndexPath
//֘ͷcell͕ը໘ʹଘࡏ͠ͳ͍߹ɺͦͷcell·ͰΞχϝʔγϣϯͳ͠ͰεΫϩʔϧʢলུʣ
if let cell = rootVC.tableView?.cellForRow(at: indexPath) {
//ը໘ʹରͯ͠ͷ֘ͷcellͷҐஔΛऔಘ
if let superview = rootVC.view,
let point = cell.superview?.convert(cell.frame.origin, to: superview) {
initialFrame = CGRect(origin: point, size: cell.bounds.size)
ɹɹɹɹɹ }
ɹɹɹɹɹɹɹ}
rootVC.tableView?.selectRow(at: indexPath, animated: false, scrollPosition: .none) //֘ͷcellΛબঢ়ଶʹ͢Δ
}
//লུ
//HCPagingViewControllerͷview͕initialFrameʹͳΔΞχϝʔγϣϯΛ࣮ߦʢলུʣ
}
}