Skip to content

Commit

Permalink
Merge pull request #19 from fajdof/DispatchQueue
Browse files Browse the repository at this point in the history
Replaced main operation queue with user initiated queue
  • Loading branch information
scihant authored Mar 13, 2018
2 parents c094749 + 009fa59 commit 797bb18
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/CTPanoramaView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ import ImageIO
return node
}()

private lazy var opQueue: OperationQueue = {
let queue = OperationQueue()
queue.qualityOfService = .userInitiated
return queue
}()

private lazy var fovHeight: CGFloat = {
return tan(self.yFov/2 * .pi / 180.0) * 2 * self.radius
}()
Expand Down Expand Up @@ -203,7 +209,7 @@ import ImageIO
else {
guard motionManager.isDeviceMotionAvailable else {return}
motionManager.deviceMotionUpdateInterval = 0.015
motionManager.startDeviceMotionUpdates(using: .xArbitraryZVertical, to: OperationQueue.main, withHandler: {[weak self] (motionData, error) in
motionManager.startDeviceMotionUpdates(using: .xArbitraryZVertical, to: opQueue, withHandler: {[weak self] (motionData, error) in
guard let panoramaView = self else {return}
guard panoramaView.controlMethod == .motion else {return}

Expand Down

0 comments on commit 797bb18

Please sign in to comment.