{"id":18587927,"url":"https://github.com/ighibli/sjlocationmanager","last_synced_at":"2025-05-16T07:08:23.594Z","repository":{"id":118131997,"uuid":"113833355","full_name":"iGhibli/SJLocationManager","owner":"iGhibli","description":"使用block方式实现一行代码获取用户地理位置信息（定位）。","archived":false,"fork":false,"pushed_at":"2017-12-11T09:42:58.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-17T17:58:16.504Z","etag":null,"topics":["block","cllocation","ios","objective-c"],"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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iGhibli.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}},"created_at":"2017-12-11T08:35:55.000Z","updated_at":"2019-01-04T10:31:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"58be5011-a6d1-440d-a77c-647106eeb346","html_url":"https://github.com/iGhibli/SJLocationManager","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/iGhibli%2FSJLocationManager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iGhibli%2FSJLocationManager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iGhibli%2FSJLocationManager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iGhibli%2FSJLocationManager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iGhibli","download_url":"https://codeload.github.com/iGhibli/SJLocationManager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485062,"owners_count":22078767,"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":["block","cllocation","ios","objective-c"],"created_at":"2024-11-07T00:44:07.685Z","updated_at":"2025-05-16T07:08:18.575Z","avatar_url":"https://github.com/iGhibli.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SJLocationManager\n使用block方式实现一行代码获取用户地理位置信息（定位）。\n\n\n### Usage 使用方法:\n\n1. `iOS8.0+`先在`info.plist`中, 添加`NSLocationWhenInUseUsageDescription`或`NSLocationAlwaysUsageDescription`定位权限。\n2. 获取用户位置调用如下方法：\n\n```objc\n\tself.manager = [[SJLocationManager alloc] init];\n\t[self.manager getSJLocation:^(SJLocation *location, CLLocationManager *manager) {\n\t\t// 自己按需要自定义SJLocation位置信息Model\n\t\t// 若只需要获取一次位置，在此添加 [manager stopUpdatingLocation]; 即可。\n\t\tNSLog(@\"---%@---%@---%@\", location.longitudeStr, location.latitudeStr, location.timeStampStr);\n\t\tNSLog(@\"---%@\", manager);\n\t} failure:^(NSError *error, CLLocationManager *manager) {\n\t\t// 此处可根据定位失败原因判断定位定位权限问题，并提示用户打开权限\n\t\tNSLog(@\"---error--- %@\", error);\n\t\tNSLog(@\"---%@\", manager);\n\t}];\n\t\n\t\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fighibli%2Fsjlocationmanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fighibli%2Fsjlocationmanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fighibli%2Fsjlocationmanager/lists"}