{"id":21768115,"url":"https://github.com/below/weaklink","last_synced_at":"2025-07-30T12:05:46.432Z","repository":{"id":22783321,"uuid":"26129425","full_name":"below/WeakLink","owner":"below","description":"A sample for a weak linking question","archived":false,"fork":false,"pushed_at":"2014-11-03T21:35:33.000Z","size":148,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-02T15:50:16.320Z","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":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/below.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-11-03T17:10:35.000Z","updated_at":"2014-11-03T21:35:33.000Z","dependencies_parsed_at":"2022-08-21T11:00:54.950Z","dependency_job_id":null,"html_url":"https://github.com/below/WeakLink","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/below/WeakLink","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/below%2FWeakLink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/below%2FWeakLink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/below%2FWeakLink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/below%2FWeakLink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/below","download_url":"https://codeload.github.com/below/WeakLink/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/below%2FWeakLink/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267865852,"owners_count":24157343,"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-30T02:00:09.044Z","response_time":70,"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":"2024-11-26T13:33:36.841Z","updated_at":"2025-07-30T12:05:46.408Z","avatar_url":"https://github.com/below.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"WeakLink\n========\n\nThese projects demonstrate my question if `UIUserNotifications` can be weak linked directly, or if I have to use `NSClassFromString`, as I currently do as a workaround\n\nIn the [Documentation](https://developer.apple.com/library/ios/documentation/DeveloperTools/Conceptual/cross_development/Using/using.html \"NextPrevious\nUsing SDK-Based Development\") Apple says that:\n\n\u003e For iOS frameworks that support the `NS_CLASS_AVAILABLE` macro, conditionalize your code for weakly linked classes as demonstrated in the following example:\n\n\u003e `if ([UIPrintInteractionController class]) {\n\u003e     // Create an instance of the class and use it.\n\u003e } else {\n\u003e     // Alternate code path to follow when the\n\u003e     // class is not available.\n\u003e }`\n\nConditions for this are:\n\n\u003e * The base SDK for your Xcode project must be iOS 4.2 or newer.\n\u003e * The deployment target for your project must be iOS 3.1 or newer.\n\u003e * The compiler for your project must be the LLVM-GCC 4.2 compiler or newer, or the LLVM compiler (Clang) 1.5 or newer.\n\u003e * You must ensure that any frameworks not available in your project’s deployment target are weakly linked, rather than required.\n\nHowever, for `UIUserNotificationSettings` I will get: `Undefined symbols for architecture armv7: \"_OBJC_CLASS_$_UIUserNotificationSettings\"` if linked for iOS 7.\n\nIs this a bug?","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbelow%2Fweaklink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbelow%2Fweaklink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbelow%2Fweaklink/lists"}