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
niselover
V2EX  ›  iDev

Swift 如何监听模型所有属性的变化?..

  •  
  •   niselover · Sep 28, 2018 · 5319 views
    This topic created in 2958 days ago, the information mentioned may be changed or developed.
    想要用 extention 给 model 所有属性的 set 方面加一个监听
    但是好像没法实现 有大佬帮帮忙吗
    5 replies  •  2019-02-28 12:31:33 +08:00
    AriSwift
    AriSwift
    Sep 28, 2018
    1
    不是很友好,可以考虑继承 NSObject 用 KVO 了
    kljsandjb
    kljsandjb
    Sep 28, 2018 via iPhone
    2
    KVO 吧,专门干这事儿的
    jessehao7
    jessehao7
    Oct 10, 2018
    3
    如果这个模型是结构体,一个 didSet 搞定
    vincentxbb
    vincentxbb
    Oct 10, 2018
    4
    KVO 又或者用 Rx 系列吧,都能一直监听
    zenghaojim33
    zenghaojim33
    Feb 28, 2019
    5
    RxSwift
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1408 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 20:52 · PVG 04:52 · LAX 12:52 · JFK 15:52
    ♥ Do have faith in what you're doing.