SmartNewsã®ãããªUIãå®ç¾ããã©ã¤ãã©ãª3ã¤ãæ¯è¼ãã¦ã¿ã
ã¹ãã¼ããã¥ã¼ã¹ã®ãããªããªãã¯ã§ãã¼ã¸ã移åããããã¿ããã¹ã¯ãã¼ã«ãã¦ãã¼ã¸ãé¸ã¶ãããªæãã®UIã æè¿ã¯ããªãå¢ãã¦ããã®ã§ä»æ´ãªæã¯ããã¾ãããã¢ããã ã®æ¬¡æãã¼ã¸ã§ã³ã§ãå°å ¥ãæ¤è¨ä¸ã§ãã
ä¸ããå®è£ ããã¨ãããã¤ãã©ã¤ãã©ãªããããããªã®ã§ã試ãã¦ã¿ã¾ããã
æ¯è¼ããã©ã¤ãã©ãª
ã¯ããã«ãã£ããã¨ããæ¯è¼è¡¨ãã
2015å¹´9æååã«æ¯è¼ãã¦ããã®ã§ãä»ã¯ã¾ãç¶æ³ãå¤ãã£ã¦ããããç¥ãã¾ããã ããã¾ã§åèç¨åº¦ã«è¦ã¦é ããã°ã¨æãã¾ãã
â»è¿½è¨
ä¸è¨ã®ã©ã¤ãã©ãªããªã¹ã¹ã¡ã§ãã
è¨èª
ã©ã¤ãã©ãª | è¨èª |
---|---|
RMPScrollingMenuBarController | Objective-C |
PageMenu | Objective-C,Swift |
PagingMenuController | Swift |
対å¿OSãã¼ã¸ã§ã³
ã©ã¤ãã©ãª | ãã¼ã¸ã§ã³ |
---|---|
RMPScrollingMenuBarController | iOS7ã |
PageMenu | iOS8ã |
PagingMenuController | iOS8ã |
çµã¿è¾¼ã¿ããã
ã©ã¤ãã©ãª | è©ä¾¡ |
---|---|
RMPScrollingMenuBarController | â |
PageMenu | â³ |
PagingMenuController | ⯠|
ãã¶ã¤ã³æ§
ã©ã¤ãã©ãª | è©ä¾¡ |
---|---|
RMPScrollingMenuBarController | â³ |
PageMenu | â |
PagingMenuController | ⯠|
â»ããã©ã«ããã¶ã¤ã³ã®æ¯è¼ã§ãã
â»ä¸»è¦³ãå
¥ã£ã¦ãã¾ãã
ã«ã¹ã¿ãã¤ãºæ§
ã©ã¤ãã©ãª | è©ä¾¡ |
---|---|
RMPScrollingMenuBarController | â |
PageMenu | ⯠|
PagingMenuController | ⯠|
RMPScrollingMenuBarController
詳ããã½ã¼ã¹ã®èª¬æã¯ä¸è¨ã«ãããã¾ãã
【iOS】スクロール可能なメニューバーを持つViewControllerをオープンソースとして公開しました – NET BIZ DIV. TECH BLOG
Objective-Cã§ãããã½ã¼ã¹ã¯ä¸çªãã£ãããã¦ããã¨æãã¾ãã
ä»ã®ã©ã¤ãã©ãªã¨éã£ã¦ãã¹ã¯ãã¼ã«æã®å¦çã«UIViewControllerInteractiveTransitioningã使ããã¦ããã®ã§ã æ¢åã®UIViewControllerã追å ããã ãã§ã»ã¼åãã¨æãã¾ãã
ã¯ã©ã¹åãããã£ã¡ãããã¦ãã¦ç¶æ¿ãå¯è½ãªã®ã§ãã«ã¹ã¿ãã¤ãºæ§ãé«ãã§ãã
å¯ä¸æ®å¿µãªã®ããã¡ãã¥ã¼ãã¿ãããããã¨ã®ç»é¢ç§»åã«ã¯ã³ãã³ãé ãããããã¨ã
ã¿ããããããã£ã¨åãã¦æ¬²ããã®ã§ãããããã ããæ®å¿µã§ãã ã¯ã©ã¹ãç¶æ¿ããããããããããªããã¨æãã¾ãããããªããªãæéãæãããããªãããä¸å ãå¾åãã«ãã¾ããã
ä»å¾ã®ãã¼ã¸ã§ã³ã¢ããã§æ¹åãããã¨ãããªãã
2015å¹´10æ5æ¥è¿½è¨
追å ããViewControllerã®viewDidLoadã§è²ã ãã£ã¦ããã¨ãæåã®ã¹ã¯ãã¼ã«æã«å¼ã£æãããçã¾ãã¾ãã
ãã®å ´åã¯didMoveToParentViewController()ã§äºåå¦çããã¦ããã¦ãããã¨ããããããã·ã«ãªãã¾ãã
ãã ãæåã®ã¹ã¯ãã¼ã«ã§ç§»åãã¦ããç»é¢è¡¨ç¤ºãã¯ã³ãã³ãã¿ã¤ã ã©ã°ãããã®ãæ©ã¾ããã
äºåã«ViewControllerãæç»ãã¦ããã®ãçæ³ãªãã ãã©ã調ã¹ãéãã§ã¯å®ç¾ã§ãããã«ãªãã£ãã®ã§ã ç¾ç¶ã¯ãã®ã¾ã¾ã§çµã¿è¾¼ãã§ã¾ãã
PageMenu
è¦ãç®ã¯ã¨ã¦ãããã®ã§ããã追å ããUIViewControllerããself.navigationControllerãåç §ã§ããªãã®ãè´å½çã
深追ãã¯ããªãã£ããã©ãchildViewControllerãããã®æ±ãã«åé¡ãããããã
PagingMenuController
GitHub - kitasuke/PagingMenuController: Paging view controller with customizable menu in Swift
ãã¡ãã¯ã¡ã«ã«ãªã®ä¸ã®äººãä½æãããããã§ãã
ãªãã·ã§ã³ãè±å¯ã§ãã
PageMenuã¨éããself.navigationControllerãåç
§ã§ãã¾ãã
RMPScrollingMenuBarControllerã¨éãã®ã¯ãã¹ã¯ãã¼ã«ç§»åæã«viewDidAppearãªã©ã®ã©ã¤ããµã¤ã¯ã«ãå¼ã°ããªããã¨ã
ã¹ã¯ãã¼ã«æã®delegateã¯ç¨æããã¦ããã®ã§ãããã使ã£ã¦ã´ãã§ã´ãã§ãã¦ã¿ããã¨ãã¾ãããã æ¹ä¿®ã³ã¹ãã大ããã£ãããæ念ã
ç·è©
æ¢åããã¸ã§ã¯ãã«çµã¿è¾¼ããªããRMPScrollingMenuBarControllerãç´ ç´ã«å®è£
ã§ããã®ã§ãå§ãã§ãã
ç¾å¨ã¢ãããã§ã¯ãRMPScrollingMenuBarControllerã使ã£ã¦ã¡ã¸ã£ã¼ãã¼ã¸ã§ã³ã¢ããã«åãã¦éçºãé²ãã¦ããã¨ããã§ãã
æ°ããä½ãå§ãããªãPagingMenuControllerãããã¨æãã¾ãã
PageMenuã¯å人çã«ã¯ä½¿ããªãã§ããã navigationControlelrã使ããªãã¦ãåé¡ãªãã®ã§ããã°é¸æè¢ã«ããã¦ããããã¨æãã¾ãã
ä»å調ã¹ã¦æããã®ã¯ãããããè¤æ°ã®ViewControllerã使ãå ´åã¯UIViewControllerInteractiveTransitioningã使ã£ãå®è£ ãããã®ã ã¨åå¼·ã«ãªãã¾ããã