This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Sample using CoreMotion and SwiftUI to help understand how to use CMMotionManager and CoreMotion to get values of gravity, user acceleration, heading (2), attitude (pitch, roll, yaw), magnetic field | |
// based on this beautiful example https://github.com/gsachin/DynamicFontRandD/blob/e4f7cc611d1d23573b4026bcc291bee60bf60e91/FontTextStrok/WaveView.swift | |
// that uses BAFluidView https://github.com/antiguab/BAFluidView | |
import SwiftUI | |
import CoreMotion | |
let timer = Timer.publish(every: 1, on: .main, in: .common).autoconnect() | |
struct WaveView: View { | |
var motionManager = CMMotionManager() |