{"id":22065130,"url":"https://github.com/wilddylan/dlobserver","last_synced_at":"2025-03-23T18:15:26.199Z","repository":{"id":35573706,"uuid":"39845939","full_name":"wilddylan/DLObserver","owner":"wilddylan","description":"DLObserver For Easier KVO","archived":false,"fork":false,"pushed_at":"2015-07-28T16:43:23.000Z","size":144,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-29T00:25:31.871Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wilddylan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-28T16:41:43.000Z","updated_at":"2015-11-20T17:02:47.000Z","dependencies_parsed_at":"2022-09-03T18:51:43.076Z","dependency_job_id":null,"html_url":"https://github.com/wilddylan/DLObserver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilddylan%2FDLObserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilddylan%2FDLObserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilddylan%2FDLObserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilddylan%2FDLObserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wilddylan","download_url":"https://codeload.github.com/wilddylan/DLObserver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245144974,"owners_count":20568056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-30T19:15:08.732Z","updated_at":"2025-03-23T18:15:26.134Z","avatar_url":"https://github.com/wilddylan.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DLObserver\nDLObserver For Easier KVO\n\n\u003e1.基本用于Model的监听, 如需扩展需要自己处理 \u003cbr\u003e2.请对属性或者全局变量进行监听, 以免局部对象被释放造成奔溃\n\n使用说明：\n\n使用DLBind扩展宏进行增加监听, 使用DLDraw扩展宏来撤销监听。\n\n如果你想监听一个Model的text属性, 那么就直接DLBind(对象, 属性) `subScribeBlock：`当有新的Value的时候就会调用这个Block.\n\n如果你想移除监听, 那么直接使用DLDraw即可。\n\n\u003e [DLBind(_DLLabel, text) subScribeBlock:^(id value) {\u003cbr\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;NSLog(@\"Label: %@\", value);\u003cbr\u003e}];\n\n```objc\n\n    [DLBind(_DLLabel, text) subScribeBlock:^(id value) {\n        \n        NSLog(@\"Label: %@\", value);\n    }];\n    \n    [DLBind(_DLTextField, text) subScribeBlock:^(id value) {\n       \n        NSLog(@\"TextField: %@\", value);\n        \n        _DLLabel.text = value;\n    }];\n    \n    // Label\n    \n    _DLLabel.text = @\"Hello, Dylan\";\n    \n    // TextField\n    \n//    _DLTextField.text = @\"Hello, Dylan (TextField)\";\n    \n    newModel = [[DLModel alloc] init];\n    \n    [DLBind(newModel, name) subScribeBlock:^(id value) {\n       \n        NSLog(@\"%@\", value);\n    }];\n    \n    newModel.name = @\"B_Student\";\n\n    DLDraw(newModel, name);\n    \n    newModel.name = @\"C_Student\";\n```\n\n如果想使用的话, Git地址在这里[DLObserver](https://github.com/WildDylan/DLObserver)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilddylan%2Fdlobserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilddylan%2Fdlobserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilddylan%2Fdlobserver/lists"}