PiTT Beta 0.1.4 (22) 大圖瀏覽 - iOS

By Delia
at 2018-07-10T12:16
at 2018-07-10T12:16
Table of Contents
唉...
我就來科普一下吧
正常這種文章應該是出現在 MacDev 板的
首先 滑動退出在 iOS 又叫做 InteractiveTransition
是早在 2013 年的 WWDC 就介紹的功能
https://developer.apple.com/videos/play/wwdc2013/218/
視 viewController persent 的方式會需要實作 3~4 個項目
分別是
UIViewControllerAnimatedTransitioning
UIViewControllerTransitioningDelegate
UIPercentDrivenInteractiveTransition
UIPresentationController(for persenting Modally)
不使用預設 naviatiaonController 的滑動手勢
是因為預設只能從螢幕邊緣觸發
但是 PiTT 不需要滑動刪除功能
所以就沒有必要避免螢幕中間的滑動手勢偵測
單手使用者也可以從螢幕的任何地方開始滑動
不會因為螢幕過大摸不到螢幕邊緣 反而更方便
主要的手勢偵測有兩種項目
一個是滑動距離 一個是滑動速度
滑動距離 一般業界都是偵測 view.bounds 一半的值(視縱向與橫向)
滑動速度 一般業界都是偵測 velocity 是否超過自訂的 threshold
某 app 實作的 只有 gestureRecognizer.state == .began(我猜的)
所以才會稍微滑動 連手指都沒放開就觸發
也沒辦法來回滑動或是滑一滑放棄回到原頁
我不知道是故意的還是怎麼樣 也沒有說一定就是不好的
但這個就是沒有實作完整的滑動手勢偵測
總不能要求一個做完 100% 功能的 刪掉做好的部分退回 10% 吧?
我是不知道這樣回信有哪裡得罪你啦...
https://i.imgur.com/FPz6o3p.jpg
https://i.imgur.com/rAKR23V.jpg
https://i.imgur.com/w9CFqGS.jpg
但你一直說用 UIPageViewController、UIScrollView 還有 bounce
我真的不知道怎麼跟你討論 才會給你連結好有個基本概念
滑動退出的確有一萬種實作方式
但 Apple 就提供超好用的 API 了為什麼不直接用呢?
UIPageViewController 還有點可能
但就算是 Android 滑動退出的實作方式也用不到 scrollView
壓根不會出現 bounce 的關鍵字
一般業界 包括你說你有使用過的 Facebook、Twitter 都是使用相同的手勢偵測規則
也都是滑動到一半或是快速滑動觸發
每個 app 的差異大多只有 threshold 的值
還有動畫的執行時間長短而已
為什麼硬要我把對的實作方式改成錯的呢?
我要繼續潛水了 每次出來都有人找我吵架 囧
--
我就來科普一下吧
正常這種文章應該是出現在 MacDev 板的
首先 滑動退出在 iOS 又叫做 InteractiveTransition
是早在 2013 年的 WWDC 就介紹的功能
https://developer.apple.com/videos/play/wwdc2013/218/
視 viewController persent 的方式會需要實作 3~4 個項目
分別是
UIViewControllerAnimatedTransitioning
UIViewControllerTransitioningDelegate
UIPercentDrivenInteractiveTransition
UIPresentationController(for persenting Modally)
不使用預設 naviatiaonController 的滑動手勢
是因為預設只能從螢幕邊緣觸發
但是 PiTT 不需要滑動刪除功能
所以就沒有必要避免螢幕中間的滑動手勢偵測
單手使用者也可以從螢幕的任何地方開始滑動
不會因為螢幕過大摸不到螢幕邊緣 反而更方便
主要的手勢偵測有兩種項目
一個是滑動距離 一個是滑動速度
滑動距離 一般業界都是偵測 view.bounds 一半的值(視縱向與橫向)
滑動速度 一般業界都是偵測 velocity 是否超過自訂的 threshold
某 app 實作的 只有 gestureRecognizer.state == .began(我猜的)
所以才會稍微滑動 連手指都沒放開就觸發
也沒辦法來回滑動或是滑一滑放棄回到原頁
我不知道是故意的還是怎麼樣 也沒有說一定就是不好的
但這個就是沒有實作完整的滑動手勢偵測
總不能要求一個做完 100% 功能的 刪掉做好的部分退回 10% 吧?
我是不知道這樣回信有哪裡得罪你啦...
https://i.imgur.com/FPz6o3p.jpg
https://i.imgur.com/rAKR23V.jpg
https://i.imgur.com/w9CFqGS.jpg
但你一直說用 UIPageViewController、UIScrollView 還有 bounce
我真的不知道怎麼跟你討論 才會給你連結好有個基本概念
滑動退出的確有一萬種實作方式
但 Apple 就提供超好用的 API 了為什麼不直接用呢?
UIPageViewController 還有點可能
但就算是 Android 滑動退出的實作方式也用不到 scrollView
壓根不會出現 bounce 的關鍵字
一般業界 包括你說你有使用過的 Facebook、Twitter 都是使用相同的手勢偵測規則
也都是滑動到一半或是快速滑動觸發
每個 app 的差異大多只有 threshold 的值
還有動畫的執行時間長短而已
為什麼硬要我把對的實作方式改成錯的呢?
我要繼續潛水了 每次出來都有人找我吵架 囧
--
Tags:
iOS
All Comments

By Edwina
at 2018-07-12T09:32
at 2018-07-12T09:32

By Noah
at 2018-07-13T10:33
at 2018-07-13T10:33

By Cara
at 2018-07-18T01:40
at 2018-07-18T01:40

By Franklin
at 2018-07-22T22:59
at 2018-07-22T22:59

By Mia
at 2018-07-26T03:56
at 2018-07-26T03:56

By Candice
at 2018-07-29T14:29
at 2018-07-29T14:29

By Isla
at 2018-07-31T07:00
at 2018-07-31T07:00

By Quanna
at 2018-08-03T14:54
at 2018-08-03T14:54

By Brianna
at 2018-08-04T02:22
at 2018-08-04T02:22

By Connor
at 2018-08-08T19:32
at 2018-08-08T19:32

By Carolina Franco
at 2018-08-09T07:01
at 2018-08-09T07:01

By Damian
at 2018-08-11T04:51
at 2018-08-11T04:51

By Megan
at 2018-08-11T17:17
at 2018-08-11T17:17

By Brianna
at 2018-08-12T14:28
at 2018-08-12T14:28

By Jacky
at 2018-08-15T19:20
at 2018-08-15T19:20

By Robert
at 2018-08-17T02:59
at 2018-08-17T02:59

By Emma
at 2018-08-18T23:13
at 2018-08-18T23:13

By Rachel
at 2018-08-21T01:30
at 2018-08-21T01:30

By Agnes
at 2018-08-23T10:47
at 2018-08-23T10:47

By Hazel
at 2018-08-25T10:24
at 2018-08-25T10:24

By Ethan
at 2018-08-30T09:22
at 2018-08-30T09:22

By Elma
at 2018-08-31T10:32
at 2018-08-31T10:32

By Linda
at 2018-09-02T02:01
at 2018-09-02T02:01

By Victoria
at 2018-09-05T17:49
at 2018-09-05T17:49

By Irma
at 2018-09-07T11:52
at 2018-09-07T11:52

By Susan
at 2018-09-11T11:17
at 2018-09-11T11:17

By Brianna
at 2018-09-12T18:58
at 2018-09-12T18:58

By Ula
at 2018-09-12T23:37
at 2018-09-12T23:37

By Erin
at 2018-09-14T13:55
at 2018-09-14T13:55

By Leila
at 2018-09-15T22:32
at 2018-09-15T22:32

By Sierra Rose
at 2018-09-16T00:11
at 2018-09-16T00:11

By Sandy
at 2018-09-20T16:38
at 2018-09-20T16:38

By Gilbert
at 2018-09-25T10:08
at 2018-09-25T10:08

By Barb Cronin
at 2018-09-25T20:33
at 2018-09-25T20:33

By Elma
at 2018-09-29T18:30
at 2018-09-29T18:30

By John
at 2018-10-03T18:01
at 2018-10-03T18:01

By Leila
at 2018-10-07T19:38
at 2018-10-07T19:38

By Agnes
at 2018-10-09T20:37
at 2018-10-09T20:37

By Zenobia
at 2018-10-09T22:52
at 2018-10-09T22:52

By Zenobia
at 2018-10-14T14:39
at 2018-10-14T14:39

By Connor
at 2018-10-19T10:18
at 2018-10-19T10:18

By Brianna
at 2018-10-22T16:04
at 2018-10-22T16:04

By Yuri
at 2018-10-23T16:28
at 2018-10-23T16:28

By Bethany
at 2018-10-27T11:23
at 2018-10-27T11:23

By Linda
at 2018-10-31T10:53
at 2018-10-31T10:53

By Bethany
at 2018-11-02T18:18
at 2018-11-02T18:18

By Jacob
at 2018-11-03T08:38
at 2018-11-03T08:38

By Iris
at 2018-11-05T22:29
at 2018-11-05T22:29

By Kelly
at 2018-11-09T11:00
at 2018-11-09T11:00

By Daph Bay
at 2018-11-12T21:38
at 2018-11-12T21:38

By Cara
at 2018-11-12T23:53
at 2018-11-12T23:53

By Edward Lewis
at 2018-11-14T12:38
at 2018-11-14T12:38

By Eartha
at 2018-11-15T17:32
at 2018-11-15T17:32

By Elizabeth
at 2018-11-17T06:29
at 2018-11-17T06:29

By Carol
at 2018-11-22T04:05
at 2018-11-22T04:05

By Edwina
at 2018-11-27T01:50
at 2018-11-27T01:50

By Selena
at 2018-11-29T19:32
at 2018-11-29T19:32

By Anonymous
at 2018-12-02T22:28
at 2018-12-02T22:28

By Quintina
at 2018-12-05T15:48
at 2018-12-05T15:48

By Barb Cronin
at 2018-12-06T03:53
at 2018-12-06T03:53
Related Posts
iOS 11.3.1可用轉場特效

By Harry
at 2018-07-10T11:08
at 2018-07-10T11:08
About Instagram

By Oliver
at 2018-07-10T11:07
at 2018-07-10T11:07
7/10 LINE免費貼圖

By Edwina
at 2018-07-10T11:03
at 2018-07-10T11:03
PiTT Beta 0.1.4 (22) 大圖瀏覽

By William
at 2018-07-10T10:01
at 2018-07-10T10:01
今日iTunes 特價電影 黑暗騎士

By Freda
at 2018-07-10T09:32
at 2018-07-10T09:32