1. <strong id="7actg"></strong>
    2. <table id="7actg"></table>

    3. <address id="7actg"></address>
      <address id="7actg"></address>
      1. <object id="7actg"><tt id="7actg"></tt></object>

        SuspensionEntrance仿微信新版懸浮窗入口

        聯(lián)合創(chuàng)作 · 2023-09-24 06:46

        SuspensionEntrance 是一個(gè)仿微信新版浮窗入口功能。

        使用方法

        pod SuspensionExtrance ~> 0.1.0 // 使用podfile方式引入
        @implementation BaseNavigationController
        - (void)viewDidLoad {
            [super viewDidLoad];
            // 在自定義的navigationController中 設(shè)置代理, 如果已經(jīng)使用了代理,
            self.delegate = [SuspensionEntrance shared];
            // 關(guān)閉系統(tǒng)返回手勢
            self.interactivePopGestureRecognizer.enabled = NO;
        }
        @end
        
        // 對于可以作為入口界面的Controller,實(shí)現(xiàn)SEItem協(xié)議
        @interface EntranceViewController : UIViewController <SEItem>
        @property (copy  , nonatomic) NSString *entranceTitle;
        @property (copy  , nonatomic, nullable) NSURL *entranceIconUrl;
        @property (copy  , nonatomic, nullable) NSDictionary *entranceUserInfo;
        @end
        
        // 并實(shí)現(xiàn)下列構(gòu)造方法, !!! 如果不實(shí)現(xiàn)則無法進(jìn)行序列化存儲(chǔ)
        + (instancetype)entranceWithItem:(id<SEItem>)item {
            EntranceViewController *controller = [[EntranceViewController alloc] initWithNibName:nil bundle:nil];
            controller.entranceTitle = item.entranceTitle;
            controller.entranceIconUrl = item.entranceIconUrl;
            controller.entranceUserInfo = item.entranceUserInfo;
            return controller;
        }
        

        一般情況下, 我們自己項(xiàng)目內(nèi)都會(huì)使用自定義返回手勢, 并且已經(jīng)設(shè)置了代理, 那可以采用下列的方式進(jìn)行對接

        // 在對應(yīng)的代理方法里面調(diào)用 
        - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
            [[SuspensionEntrance shared] navigationController:navigationController willShowViewController:viewController animated:animated];
        }
        
        - (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
            [[SuspensionEntrance shared] navigationController:navigationController didShowViewController:viewController animated:animated];
        }
        
        - (id<UIViewControllerInteractiveTransitioning>)navigationController:(UINavigationController *)navigationController interactionControllerForAnimationController:(id<UIViewControllerAnimatedTransitioning>)animationController {
            return [[SuspensionEntrance shared] navigationController:navigationController interactionControllerForAnimationController:animationController];
        }
        
        - (id<UIViewControllerAnimatedTransitioning>)navigationController:(UINavigationController *)navigationController animationControllerForOperation:(UINavigationControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC {
            return [[SuspensionEntrance shared] navigationController:navigationController animationControllerForOperation:operation fromViewController:fromVC toViewController:toVC];
        }
        
        // 然后同上面一步, 一樣實(shí)現(xiàn)SEItem協(xié)議, 需要注意的事, 需要手動(dòng)關(guān)閉自定義返回手勢, 以避免手勢沖突
        // 以集成了 forkingdog/FDFullscreenPopGesture(https://github.com/forkingdog/FDFullscreenPopGesture) 為例, 添加下列方法
        - (void)fd_interactivePopDisabled { return YES; }
        
        瀏覽 32
        點(diǎn)贊
        評論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
        評論
        圖片
        表情
        推薦
        點(diǎn)贊
        評論
        收藏
        分享

        手機(jī)掃一掃分享

        編輯 分享
        舉報(bào)
        1. <strong id="7actg"></strong>
        2. <table id="7actg"></table>

        3. <address id="7actg"></address>
          <address id="7actg"></address>
          1. <object id="7actg"><tt id="7actg"></tt></object>
            黄瓜视频成年污 | 伊人久久一区二区 | 欧美老人性色一级毛片 | 裸体女人网站 | 久久久又黄又爽免费观看下载 | 豆花成人免费进入18 | 波多野结衣免费AV | 欧美精品网址 | 男女日b片 | 97超碰超碰 |