mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-28 20:25:33 +08:00
Replaced RCTSparseArray with NSDictionary
Reviewed By: jspahrsummers Differential Revision: D2651920 fb-gh-sync-id: 953e2ea33abfc7a3a553da95b13e9ab2bccc5a1c
This commit is contained in:
committed by
facebook-github-bot-4
parent
5a34a097f2
commit
fa0b45c58b
@@ -37,7 +37,7 @@ typedef struct {
|
||||
|
||||
+ (RCTLocationOptions)RCTLocationOptions:(id)json
|
||||
{
|
||||
NSDictionary *options = [RCTConvert NSDictionary:json];
|
||||
NSDictionary<NSString *, id> *options = [RCTConvert NSDictionary:json];
|
||||
return (RCTLocationOptions){
|
||||
.timeout = [RCTConvert NSTimeInterval:options[@"timeout"]] ?: INFINITY,
|
||||
.maximumAge = [RCTConvert NSTimeInterval:options[@"maximumAge"]] ?: INFINITY,
|
||||
@@ -47,7 +47,7 @@ typedef struct {
|
||||
|
||||
@end
|
||||
|
||||
static NSDictionary *RCTPositionError(RCTPositionErrorCode code, NSString *msg /* nil for default */)
|
||||
static NSDictionary<NSString *, id> *RCTPositionError(RCTPositionErrorCode code, NSString *msg /* nil for default */)
|
||||
{
|
||||
if (!msg) {
|
||||
switch (code) {
|
||||
@@ -99,7 +99,7 @@ static NSDictionary *RCTPositionError(RCTPositionErrorCode code, NSString *msg /
|
||||
@implementation RCTLocationObserver
|
||||
{
|
||||
CLLocationManager *_locationManager;
|
||||
NSDictionary *_lastLocationEvent;
|
||||
NSDictionary<NSString *, id> *_lastLocationEvent;
|
||||
NSMutableArray<RCTLocationRequest *> *_pendingRequests;
|
||||
BOOL _observingLocation;
|
||||
RCTLocationOptions _observerOptions;
|
||||
@@ -295,7 +295,7 @@ RCT_EXPORT_METHOD(getCurrentPosition:(RCTLocationOptions)options
|
||||
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
|
||||
{
|
||||
// Check error type
|
||||
NSDictionary *jsError = nil;
|
||||
NSDictionary<NSString *, id> *jsError = nil;
|
||||
switch (error.code) {
|
||||
case kCLErrorDenied:
|
||||
jsError = RCTPositionError(RCTPositionErrorDenied, nil);
|
||||
|
||||
Reference in New Issue
Block a user