I made location positioning app using beacon. I want to show my traced position, as well as the current position. But the data is constantly overlapping, so I can't recognize it on my app. How can I update my textview as a list not to be overlapped?
here's my code
func indoorLocationManager(_ manager: EILIndoorLocationManager, didUpdatePosition position: EILOrientedPoint, with positionAccuracy: EILPositionAccuracy, in location: EILLocation) {
let now = NSDate()
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
dateFormatter.locale = NSLocale(localeIdentifier: "ko_KR") as Locale
var ps = String(format: "x: %5.2f, y: %5.2f, orientation: %3.0f",
position.x, position.y, position.orientation)
print(ps)
print(now)
let positionRect = CGRect(x: 0, y: 0, width: 430, height: 21)
let positiontext = UITextView(frame: positionRect)
positiontext.center = CGPoint(x: 160, y: 450)
positiontext.backgroundColor = UIColor.white
positiontext.textAlignment = .center
positiontext.textColor = UIColor.black
positiontext.text = ps
// positiontext.text = dateFormatter.string(from: now as Date)
positiontext.isScrollEnabled = true
}
Comments
Post a Comment