{"id":28533499,"url":"https://github.com/epam/lib-obj-c-attr","last_synced_at":"2025-10-12T10:09:38.871Z","repository":{"id":14583387,"uuid":"17299850","full_name":"epam/lib-obj-c-attr","owner":"epam","description":"Attributes for your code","archived":false,"fork":false,"pushed_at":"2017-04-18T05:55:28.000Z","size":778,"stargazers_count":182,"open_issues_count":8,"forks_count":25,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-09-30T06:09:48.202Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/epam.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":"2014-02-28T21:11:35.000Z","updated_at":"2025-05-11T21:07:14.000Z","dependencies_parsed_at":"2022-09-12T08:40:58.672Z","dependency_job_id":null,"html_url":"https://github.com/epam/lib-obj-c-attr","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/epam/lib-obj-c-attr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epam%2Flib-obj-c-attr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epam%2Flib-obj-c-attr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epam%2Flib-obj-c-attr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epam%2Flib-obj-c-attr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/epam","download_url":"https://codeload.github.com/epam/lib-obj-c-attr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epam%2Flib-obj-c-attr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011047,"owners_count":26084863,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"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":[],"created_at":"2025-06-09T17:07:17.967Z","updated_at":"2025-10-12T10:09:38.866Z","avatar_url":"https://github.com/epam.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License](https://cocoapod-badges.herokuapp.com/l/libObjCAttr/badge.svg)](http://opensource.org/licenses/BSD-3-Clause) \n[![Platform](https://cocoapod-badges.herokuapp.com/p/libObjCAttr/badge.png)](https://github.com/epam/road-ios-framework/) \n[![Version](https://cocoapod-badges.herokuapp.com/v/libObjCAttr/badge.png)](https://github.com/epam/lib-obj-c-attr/) \n[![Coverage Status](http://img.shields.io/coveralls/epam/lib-obj-c-attr/master.svg?style=flat)](https://coveralls.io/r/epam/lib-obj-c-attr?branch=master) \n[![Build Status](http://img.shields.io/travis/epam/lib-obj-c-attr/master.svg?style=flat)](https://travis-ci.org/epam/lib-obj-c-attr) \n\n\n# libObjCAttr - attributes for your code\n\nlibObjCAttr is attribute-oriented programming for Objective-C language. It is compile-time based with the support of Xcode auto-completion and errors tracing features. We nailed every aspect of the implementation including performance, so attributes will never be a bottleneck.\n\nOur solution helps reduce the complexity of code, makes it compact and self-documented. There are a lot of languages with attributes support, we added Objective-C into that list.\n\n## Installation\n\n[CocoaPods](http://cocoapods.org) is the only recommended way of libObjCAttr integration. Besides standard configuration of pod dependencies, *pod_install* hook is required as shown below. A typical **Podfile** will look as follows:\n\n```ruby\npod 'libObjCAttr'\n\npost_install do |installer|\n    require File.expand_path('ROADConfigurator.rb', './Pods/libObjCAttr/libObjCAttr/Resources/')\n    ROADConfigurator::post_install(installer)\nend\n```\n\n**Note:**\nIf you want to get rid of warning from Xcodeproj gem, copy-paste and run in terminal next command before running `pod install`:\n\n```\nexport COCOAPODS_DISABLE_DETERMINISTIC_UUIDS=YES\n```\n\n\n## Samples\n\nIt is super easy to mark your code with an attribute. We currently support **4 types** of attributes:\n\n* *Class attributes*\n* *IVar attributes*\n* *Method attributes*\n* *Property attributes*\n\nCheck out this example to get to know how to declare them:\n\n```objective-c\nRF_ATTRIBUTE(MyAttribute, stringProperty = @\"Hello world\")\n@interface AnnotatedClass : NSObject {\n\n    RF_ATTRIBUTE(MyAttribute, numericProperty = @9000)\n    NSObject * _someField;\n}\n\nRF_ATTRIBUTE(MyAttribute, blockProperty = ^(int value) { return value; })\n- (void)foo;\n\nRF_ATTRIBUTE(MyAttribute, objectProperty = [NSObject new])\n@property NSString *name;\n\n@end\n```\n\nAn attribute can be any class inherited from NSObject or its subclasses. It may or may not have properties.\n\n```objective-c\n#import \u003cROAD/ROADAttribute.h\u003e\n\n@interface MyAttribute : NSObject\n\n@property NSString *stringProperty;\n@property NSNumber *numericProperty;\n@property (copy) id blockProperty;\n@property id objectProperty;\n\n@end\n```\n\nNow you can get them in runtime with code like this:\n\n```objective-c\n...\n\nNSArray *classAttributes = [AnnotatedClass RF_attributesForClass];\nNSArray *ivarAttributes = [AnnotatedClass RF_attributesForIvar:@\"_someField\"];\n\n// Let's filter it, in case there are many of them\nMyAttribute *methodAttributes = [AnnotatedClass RF_attributeForMethod:@\"foo\" withAttributeType:[MyAttribute class]];\nMyAttribute *classAttributes = [AnnotatedClass RF_attributeForProperty:@\"name\" withAttributeType:[MyAttribute class]];\n\n...\n```\n\nAlso check out an info about [an attribute generator](./Documents/AttributeGenerator.md), that makes all behind the scene magic.\n\n## Requirements\nlibObjCAttr requires **iOS 5.0 and above**. The compatibility with 4.3 and older is not tested.\n\nlibObjCAttr was initially designed to use **ARC**.\n\n## Solutions powerd by LibObjCAttr\n* ROAD Framework — [https://github.com/epam/road-ios-framework](https://github.com/epam/road-ios-framework)\n* Add your project here ;)\n\n## Contact\nFollow LibObjCAttr on Twitter ([@LibObjCAttr](http://twitter.com/libobjcattr))\n\n## License\nlibObjCAttr is made available under the terms of the [BSD-3](http://opensource.org/licenses/BSD-3-Clause). Open the LICENSE file that accompanies this distribution to see the full text of the license.\n\n## Contribution\n\nThere are three ways you can help us:\n\n* **Raise an issue.** You found something that does not work as expected? Let us know about it.\n* **Suggest a feature.** It's even better if you come up with a new feature and write us about it.\n* **Write some code.** We would love to see more pull requests to our framework, just make sure you have the latest sources.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepam%2Flib-obj-c-attr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fepam%2Flib-obj-c-attr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepam%2Flib-obj-c-attr/lists"}