summaryrefslogtreecommitdiffstats
path: root/src/plugins/sensors/ios/iosmotionmanager.mm
blob: 3bf2c537a61f127e497289194a6af1bffd423994 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (C) 2016 Lorn Potter
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#include "iosmotionmanager.h"

#import <CoreMotion/CoreMotion.h>

static CMMotionManager *sharedManager = nil;

@implementation QIOSMotionManager

+ (CMMotionManager *)sharedManager
{
    static dispatch_once_t staticToken;
    dispatch_once(&staticToken, ^{
        sharedManager = [[CMMotionManager alloc] init];
        sharedManager.showsDeviceMovementDisplay = YES;
    });
    return sharedManager;
}

@end