Minimum changes for Xcode 11 beta 5

This commit is contained in:
John Holdsworth
2019-07-31 14:11:25 +01:00
parent 7af0a711da
commit a36ff1b7ca
48 changed files with 209 additions and 114 deletions

View File

@@ -23,13 +23,13 @@ struct HikeDetail: View {
.frame(height: 200, alignment: .center)
HStack(spacing: 25) {
ForEach(buttons.identified(by: \.0)) { value in
ForEach(buttons, id: \.0) { value in
Button(action: {
self.dataToShow = value.1
}) {
Text(verbatim: value.0)
.font(.system(size: 15))
.color(value.1 == self.dataToShow
.foregroundColor(value.1 == self.dataToShow
? Color.gray
: Color.accentColor)
.animation(nil)

View File

@@ -51,7 +51,7 @@ final class ImageStore {
?? _sizeImage(images.values[index][ImageStore.originalSize]!, to: size * ImageStore.scale)
images.values[index][size] = sizedImage
return Image(sizedImage, scale: Length(ImageStore.scale), label: Text(verbatim: name))
return Image(sizedImage, scale: CGFloat(ImageStore.scale), label: Text(verbatim: name))
}
fileprivate func _guaranteeInitialImage(name: String) -> _ImageDictionary.Index {

View File

@@ -9,20 +9,20 @@ import SwiftUI
struct GraphCapsule: View {
var index: Int
var height: Length
var height: CGFloat
var range: Range<Double>
var overallRange: Range<Double>
var heightRatio: Length {
max(Length(magnitude(of: range) / magnitude(of: overallRange)), 0.15)
var heightRatio: CGFloat {
max(CGFloat(magnitude(of: range) / magnitude(of: overallRange)), 0.15)
}
var offsetRatio: Length {
Length((range.lowerBound - overallRange.lowerBound) / magnitude(of: overallRange))
var offsetRatio: CGFloat {
CGFloat((range.lowerBound - overallRange.lowerBound) / magnitude(of: overallRange))
}
var animation: Animation {
Animation.spring(initialVelocity: 5)
Animation.spring()
.speed(2)
.delay(0.03 * Double(index))
}

View File

@@ -40,7 +40,7 @@ struct HikeGraph: View {
let data = hike.observations
let overallRange = rangeOfRanges(data.lazy.map { $0[keyPath: self.path] })
let maxMagnitude = data.map { magnitude(of: $0[keyPath: path]) }.max()!
let heightRatio = 1 - Length(maxMagnitude / magnitude(of: overallRange))
let heightRatio = 1 - CGFloat(maxMagnitude / magnitude(of: overallRange))
return GeometryReader { proxy in
HStack(alignment: .bottom, spacing: proxy.size.width / 120) {