mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-03-29 13:42:00 +02:00
Minimum changes for Xcode 11 beta 5
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user