mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-03-25 10:51:45 +01:00
Xcode 11 beta 6
This commit is contained in:
@@ -11,11 +11,10 @@ struct HikeBadge: View {
|
||||
var name: String
|
||||
var body: some View {
|
||||
VStack(alignment: .center) {
|
||||
// crashes in Beta 5
|
||||
// Badge()
|
||||
// .frame(width: 300, height: 300)
|
||||
// .scaleEffect(1.0 / 3.0)
|
||||
// .frame(width: 100, height: 100)
|
||||
Badge()
|
||||
.frame(width: 300, height: 300)
|
||||
.scaleEffect(1.0 / 3.0)
|
||||
.frame(width: 100, height: 100)
|
||||
Text(name)
|
||||
.font(.caption)
|
||||
.accessibility(label: Text("Badge for \(name)."))
|
||||
|
||||
@@ -8,18 +8,18 @@ A model object that stores app data.
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
final class UserData: BindableObject {
|
||||
let willChange = PassthroughSubject<UserData, Never>()
|
||||
final class UserData: ObservableObject {
|
||||
let objectWillChange = PassthroughSubject<UserData, Never>()
|
||||
|
||||
var showFavoritesOnly = false {
|
||||
didSet {
|
||||
willChange.send(self)
|
||||
objectWillChange.send(self)
|
||||
}
|
||||
}
|
||||
|
||||
var landmarks = landmarkData {
|
||||
didSet {
|
||||
willChange.send(self)
|
||||
objectWillChange.send(self)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,10 @@ struct ProfileHost: View {
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 20) {
|
||||
HStack {
|
||||
if self.mode?.value == .active {
|
||||
if self.mode?.wrappedValue == .active {
|
||||
Button(action: {
|
||||
self.draftProfile = self.profile
|
||||
self.mode?.animation().value = .inactive
|
||||
self.mode?.animation().wrappedValue = .inactive
|
||||
}) {
|
||||
Text("Done")
|
||||
}
|
||||
@@ -28,7 +28,7 @@ struct ProfileHost: View {
|
||||
|
||||
EditButton()
|
||||
}
|
||||
if self.mode?.value == .inactive {
|
||||
if self.mode?.wrappedValue == .inactive {
|
||||
ProfileSummary(profile: profile)
|
||||
} else {
|
||||
ProfileEditor(profile: $draftProfile)
|
||||
|
||||
Reference in New Issue
Block a user