{"id":20299607,"url":"https://github.com/derekli66/babymodel","last_synced_at":"2026-06-06T12:31:11.006Z","repository":{"id":69443490,"uuid":"61066711","full_name":"derekli66/BabyModel","owner":"derekli66","description":"An easy model to have abilities to monitor property changes.","archived":false,"fork":false,"pushed_at":"2018-08-16T06:58:28.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-04T06:23:22.814Z","etag":null,"topics":["block","dynamic","kvo","model","objc-runtime","objective-c"],"latest_commit_sha":null,"homepage":"","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/derekli66.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-06-13T20:16:00.000Z","updated_at":"2018-08-16T06:58:29.000Z","dependencies_parsed_at":"2023-02-27T19:45:34.512Z","dependency_job_id":null,"html_url":"https://github.com/derekli66/BabyModel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/derekli66/BabyModel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derekli66%2FBabyModel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derekli66%2FBabyModel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derekli66%2FBabyModel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derekli66%2FBabyModel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/derekli66","download_url":"https://codeload.github.com/derekli66/BabyModel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/derekli66%2FBabyModel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33983046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-06T02:00:07.033Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["block","dynamic","kvo","model","objc-runtime","objective-c"],"created_at":"2024-11-14T16:15:36.643Z","updated_at":"2026-06-06T12:31:10.989Z","avatar_url":"https://github.com/derekli66.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Description\nBabyModel is a model class to help create model class easily. Normally, MVC pattern ask us to create a signal structure for Model-View-Controller that don't let Model-View have strong coupling. But, hooking up the signal structure through KVO is a little bit.... not so convenient. Therefore, that comes with this BabyModel for easy to use.\n\n## What We Have\n### OBModel\nOBModel is a basic class that help you create your own model subclass with desired properties.  \n\n### OBCollection\nOBCollection subclassed from OBModel and provides collection changes monitoring.\n\n### KVO Behind the Scene\nYes. They are all backed up by KVO behind the scene. \n\n## How to Use\n### Make a Subclass\n```objc\n// Create your own model class\n@interface VGModel : OBModel\n@property (nonatomic, strong) NSString *title;\n@property (nonatomic, strong) UIImage *backgroundImage;\n@end\n```\n```objc\n// Start monitor property change in your viewcontroller or elsewhere\nVGModel *aModel = [[VGModel alloc] init];\naModel.title = @\"Bob\";\naModel.backgroundImage = [UIImage imageNamed:@\"green.png\"];\n    \n[aModel addObserver:self forProperty:@\"title\" withEvent:^(NSString * _Nonnull propertyName, NSDictionary * _Nonnull changes) {\n    NSLog(@\"Change property: %@, changes: %@\", propertyName, changes);\n}];\n    \n[aModel addObserver:self forProperty:@\"backgroundImage\" withEvent:^(NSString * _Nonnull propertyName, NSDictionary * _Nonnull changes) {\n    NSLog(@\"I got the images: %@\", changes);\n}];\n    \nself.testModel = aModel;\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderekli66%2Fbabymodel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fderekli66%2Fbabymodel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fderekli66%2Fbabymodel/lists"}