GithubHelp home page GithubHelp logo

Comments (3)

DarielChen avatar DarielChen commented on June 16, 2024

四个步骤:

  1. 拿到微信的导航控制器
  2. 把tab上的selectedViewController设置微信导航控制器
  3. pop掉通讯录中的控制器
    4.用微信导航控制器进行push操作

DCURLRouter如果做的话只要暴露个属性设置下currentNavigationViewController为微信导航控制器,然后就能进行push操作了,但这样做没有必要啊,直接用微信导航控制器进行push操作就可以了呀!这也不太符合DCURLRouter设计的初衷啊,DCURLRouter的设计初衷是为了根据服务器给的自定义URL做跳转的.😂

from dcurlrouter.

MrPans avatar MrPans commented on June 16, 2024

DCURLRouter的设计初衷是为了根据服务器给的自定义URL做跳转

正是因为这样的设计初衷,所以才会有上面的问题。 上面的问题抽象一下,就是如何通过 URLRouter 实现从任意界面跳转到任意界面的问题。

用URLRouter来描述上面微信的例子,就是:
先假定 通讯录中某联系人详情界面的 URL 是dariel://contact/userA
聊天界面的 URL 是dariel://chatdetail/userA

假如用户现在处于通讯录某个联系人详情界面,然后切到 Safari,输入 dariel://chatdetail/userA
预期结果应该是跳转到应用的该用户聊天界面。

如果按照你说的四个步骤,

  1. 拿到微信的导航控制器

第一步 URLRouter 就需要持有 TabbarController 实例,这和 URLRouter 的解耦目的有冲突吧?

如何在不持有任何实例的情况下实现这一的跳转?

from dcurlrouter.

DarielChen avatar DarielChen commented on June 16, 2024

这的确是个好想法, DCURLRouter对于任意界面间跳转的逻辑处理,尤其是TabbarController上不同的导航控制器间的跳转的处理的确是有点问题. 但我不是很明白不持有任何实例是什么情况?push操作需要拿到对应的导航控制器,而TabBarController可以通过根控制器拿到.

Safari的跳转得通过OpenURL去实现.

from dcurlrouter.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.