V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
magic3584
V2EX  ›  iDev

有用 VIPER 的吗?想请教下后续的逻辑代码应该怎么写?写在哪?

  •  
  •   magic3584 · 2021-08-11 10:35:01 +08:00 · 4369 次点击
    这是一个创建于 986 天前的主题,其中的信息可能已经有所发展或是发生改变。

    最近在看架构方面,网上的 VIPER demo 一般都止步于初步的展示,比如:

    从网络里拿数据然后展示在 UITableView 里。

    但是后续的都没写,想请教下后续的一些逻辑应该写在哪里?怎么写?

    1. 点击 cell 要根据 viewModel 去网络上获取数据 (要写在 Interactor 里吗)
    2. 跳转到其它 controller ( Router 里吗)
    3. 给要跳转的 controller 传递数据(新 controller 的 router 里吗)
    10 条回复    2022-03-25 15:45:09 +08:00
    magic3584
        1
    magic3584  
    OP
       2021-08-11 10:36:24 +08:00
    @onevcat
    不知道能否把大佬邀请过来作答一下
    waltcow
        2
    waltcow  
       2021-08-11 11:06:39 +08:00   ❤️ 1
    magic3584
        3
    magic3584  
    OP
       2021-08-11 11:17:02 +08:00
    @waltcow #2
    感谢大佬,我看看去
    onevcat
        4
    onevcat  
       2021-08-11 13:13:57 +08:00   ❤️ 1
    装死...我也不会用这个..
    sikong31
        5
    sikong31  
       2021-08-11 13:25:51 +08:00   ❤️ 1
    架构这方面自己用起来会有很多难以适应的地方,你就算找到个大佬,也难说清楚,实际应用没有个定论。

    架构是个巨坑,不建议一个人开始太深入
    magic3584
        6
    magic3584  
    OP
       2021-08-11 13:34:34 +08:00
    @onevcat #4
    [允悲]没能得到大佬指点
    magic3584
        7
    magic3584  
    OP
       2021-08-11 13:36:03 +08:00
    @sikong31 #5
    这不想看看实际是咋写的,别自己瞎写的四不象。
    学架构也是想给自己加点硬实力吧,毕竟都快找不到工作了,,,
    sikong31
        8
    sikong31  
       2021-08-11 13:42:40 +08:00
    @magic3584 可以看看 clean architecture,资料多一些
    magic3584
        9
    magic3584  
    OP
       2021-08-11 16:36:30 +08:00
    @sikong31 #8
    大佬说的是网址还是书?
    iOS 现在能叫出来的架构就这几种。。。
    flyff1991
        10
    flyff1991  
       2022-03-25 15:45:09 +08:00
    @onevcat VIPER 现在有用到吗
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3750 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 00:52 · PVG 08:52 · LAX 17:52 · JFK 20:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.