{"id":18087057,"url":"https://github.com/artemnovichkov/xcode-snippets","last_synced_at":"2025-07-22T15:09:19.534Z","repository":{"id":74829428,"uuid":"111672610","full_name":"artemnovichkov/xcode-snippets","owner":"artemnovichkov","description":"My Xcode snippets","archived":false,"fork":false,"pushed_at":"2018-02-01T04:55:23.000Z","size":84,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-18T14:00:30.402Z","etag":null,"topics":["codesnippets","swift","xcode","xcode-snippets"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/artemnovichkov.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"artemnovichkov"}},"created_at":"2017-11-22T10:55:05.000Z","updated_at":"2023-03-09T05:12:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"b0d6f82d-01c5-45c8-bbab-4aabbcd9faec","html_url":"https://github.com/artemnovichkov/xcode-snippets","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/artemnovichkov/xcode-snippets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemnovichkov%2Fxcode-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemnovichkov%2Fxcode-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemnovichkov%2Fxcode-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemnovichkov%2Fxcode-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artemnovichkov","download_url":"https://codeload.github.com/artemnovichkov/xcode-snippets/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artemnovichkov%2Fxcode-snippets/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266516389,"owners_count":23941414,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["codesnippets","swift","xcode","xcode-snippets"],"created_at":"2024-10-31T16:59:46.346Z","updated_at":"2025-07-22T15:09:19.526Z","avatar_url":"https://github.com/artemnovichkov.png","language":"Shell","funding_links":["https://github.com/sponsors/artemnovichkov"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\t\u003cimg src=\".github/logo.png\" alt=\"Xcode snippets\" /\u003e\n\u003c/p\u003e\n\n## Usage\n- Associated Object Declaration (`associated_object`)\n```swift\nprivate struct AssociatedKeys {\n    static var \u003c#name#\u003e = \"\u003c#name#\u003e\"\n}\n\nvar \u003c#name#\u003e: String? {\n    get {\n        return objc_getAssociatedObject(self, \u0026AssociatedKeys.\u003c#name#\u003e) as? String\n    }\n\n    set {\n        if let newValue = newValue {\n            objc_setAssociatedObject(self, \u0026AssociatedKeys.\u003c#name#\u003e, newValue as String?, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)\n        }\n    }\n}\n```\n- Delay for calling (`async_after`)\n```swift\nDispatchQueue.main.asyncAfter(deadline: .now() + \u003c#when: dispatch_time_t#\u003e) {\n}\n```\n- Guard Self Declaration (`guard_self`)\n```swift\nguard let `self` = self else {\n    return\n}\n```\n- Lazy Button Declaration (`lazy_button`)\n```swift\nprivate(set) lazy var button: UIButton = {\n    let button = UIButton()\n    button.setTitle(\"\", for: .normal)\n    button.setTitleColor(.black, for: .normal)\n    button.addTarget(self, action: #selector(), for: .touchUpInside)\n    return button\n}()\n```\n- Lazy Label Declaration (`lazy_ll`)\n```swift\nprivate(set) lazy var titleLabel: UILabel = {\n    let label = UILabel()\n    label.font = .systemFont(ofSize: 17, weight: .regular)\n    label.textColor = .black\n    return label\n}()\n```\n- Lazy Table View Declaration (`lazy_table`)\n```swift\nprivate(set) lazy var tableView: UITableView = {\n    let tableView = UITableView()\n    tableView.tableFooterView = UIView()\n    return tableView\n}()\n```\n- Lazy [TableViewManager](https://github.com/rosberry/TableViewTools) Declaration (`lazy_tvm`)\n```swift\nfileprivate lazy var tableViewManager: TableViewManager = {\n    return TableViewManager(tableView: self.tableView)\n}()\n```\n- Mark snippet (`mark`)\n```swift\n// MARK: - \u003c#Title#\u003e\n```\n- Protocol Function Declaration (`funcp`)\n```swift\nfunc \u003c#name#\u003e(\u003c#parameters#\u003e)\n```\n- Swift Singleton Declaration (`shared`)\n```swift\nstatic let shared = \u003c# class #\u003e\n\nprivate init() {}\n```\n- View Did Appear Declaration (`viewDidAppear`)\n```swift\noverride func viewDidAppear(_ animated: Bool) {\n    super.viewDidAppear(animated)\n}\n```\n\n## Installation\n\n### Manual\n\nDrag `.codesnippet` files into `~/Library/Developer/Xcode/UserData/CodeSnippets`.\n\n### Automatic\n\nRun the command in your terminal:\n```bash\ncurl -fsSL https://raw.githubusercontent.com/artemnovichkov/xcode-snippets/master/install.sh | sh\n```\n\n## Author\n\nArtem Novichkov, novichkoff93@gmail.com\n\n## License\n\nXcode Snippets is available under the MIT license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartemnovichkov%2Fxcode-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartemnovichkov%2Fxcode-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartemnovichkov%2Fxcode-snippets/lists"}