PopoverⅠ(UIPresentationController)

平成30年4月6日(金曜日)

swift4版 検索キーワード(Interactive Transitions in Swift)
実行可!!
iOS 11 and Swift 4
Custom UIViewController Transitions: Getting Started
プロジェクト名 GuessThePet-starter
プロジェクト名 GuessThePet-final
何れもswift4 そのまま動作!!
interactiveTransitioning

平成30年4月4日(水曜日)

apple
apple
トランジションアニメーションをカスタマイズする
Gromview Toview Presentedview

英文説明チュートリアル(ソース有りerror多し プロジェクト無し)
The Step by Step Guide to Custom Presentation Controllers

実行可!!
UIPresentationController Tutorial: Getting Started
ダウンロードプロジェクト名 MedalCount Completed & MedalCount Starter

その他参考 (但しswift3への要コンバート DemosForBlog-master(CustomPresentation)残念ながら、コンバートにて多数のerror!!)
How to use custom presentation

平成30年4月1〜2日(日曜日 月曜日)

現段階★★★サンプル(swift 3.2)swift4にても、error無く動作
HalfModalPresentationController
ソース(上と同じもの+エトセトラソース 日付新しい)
HalfModalPresentationController.swift

最も新しいと思われるリンクとソース
Animating changes to presentingViewController during interactive dismissal
更にリンクをたどると。。。
interactive-parent-transform-bug
プロジェクト名 interactive-parent-transform-bug-master
UIPercentDrivenInteractiveTransitionを継承したinteractiveTransitioning
UIPanGestureRecognizerを使用したもので、技術的に押さえておきたい事項!!
interactiveTransitioning


        presentingViewController.transitionCoordinator?.animateAlongsideTransition({ context in
            self.setScale(expanded: true)
        }, completion: { context in
            self.setScale(expanded: !context.isCancelled())
        })
    }
    
    override func dismissalTransitionWillBegin() {
        presentingViewController.transitionCoordinator?.animateAlongsideTransition({ context in
            self.setScale(expanded: false)
        }, completion: { context in
            self.setScale(expanded: context.isCancelled())
        })
    }

Missing argument for parameter 'animation' in call
UIPercentDrivenInteractiveTransition interaction controller.に移行か、保留。
試行錯誤するも、完全動作に至らず。

↑の参考リンク
UIKitにある機能でWebで見かけるようなUI達を作る
context.isCancelled
Animating changes to presentingViewController during interactive dismissal

Interestingly, on iOS 11.x animate(alongsideTransition:completion:) works correctly for presentingViewController too (there is no need to use animateAlongsideTransition(in:animation:completion:)) - looks like Apple lifted something under the hood in the latest iOS.

更にキーワード三つ
[iOS]Twitterっぽい画像の閉じ方を実装してみる
↑source code developed with Swift 2.x. Xcode 9 does not support building or migrating Swift 2.x targets.
①UIViewControllerTransitioningDelegate(この中で、以下二点を利用)
②UIViewControllerAnimatedTransitioning(遷移のアニメーション)
③UIPercentDrivenInteractiveTransition(遷移の進行率・程度 percentComplete)


参考リンク swift2 old error
iOS8 presentation controllers
Xcode 8 Swift 3: Modal presentation transitioning delegate not called

下の参考リンク三点(日本語)ヴァージョンが古く動作せずも、仕組み等についてわかりやすい日本語による説明有り。
[iOS 8] UIPresentationController でカスタムのモーダル表示を実装する
プロジェクト名 SamplePresentation
SwiftでTumblrのリアクションみたいにモーダルウィンドウがにゅっと出るやつを作る
【iOS】Swipeで簡単に戻れるNavigationControllerを作ってみた


順序として、

①UIViewControllerTransitioningDelegate デリゲート

②UIPresentationController実装
func presentationControllerForPresentedViewController(presented: UIViewController, presentingViewController presenting: UIViewController!, sourceViewController source: UIViewController) -> UIPresentationController? {
return CustomPresentationController(presentedViewController:presented, presenting: presenting)
}

③class CustomPresentationController: UIPresentationController {

// 呼び出し元の View Controller の上に重ねるオーバーレイ View
var overlay: UIView!
・・・
}


UIPopoverController is deprecated in iOS 9.

下記リンク抜粋
//
UIPresentationController は抽象クラス
この抽象クラスを実装することで自由な表示・アニメーションのモーダルが実現される。
上記 UIPopoverController の代替として UIPopoverPresentationControllerが実装クラスとして提供される。
//

平成30年3月31日(土曜日)

現段階★★★SWIFT4 動作確認 STORYBOARD + 若干のCODE(簡便)popoverPresentationController利用!!
Popoverを表示

平成30年3月18日(日曜日)

Popoverの2つの実装方法を比較する
folder DownLoad_DEMO内に →  HowToDisplayPopover-master として保存

平成30年3月17日(土曜日)

取り敢えず、ここから学習か
Popoverの2つの実装方法を比較する
新:popoverPresentationController(forecasterplus導入済み)
旧:UIPopoverController’ was deprecated in iOS 9.0

検索エトセトラ(モーダルウィンドウ、addsubview等など、それぞれ有用か)
検索結果

要検討
[swift] PopoverPresentationControllerの実装とタップした時にメインViewにタップ情報を反映させる方法

swift4 collectionview tapped