mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-14 13:13:33 +01:00
make demo compilable on Xcode 11
This commit is contained in:
@@ -44,33 +44,35 @@ extension Modern.PokedexDemo {
|
||||
.id(pokemonDisplay)
|
||||
}
|
||||
ZStack {
|
||||
|
||||
if let pokemonForm = pokemonForm {
|
||||
{ () -> AnyView in
|
||||
if let pokemonForm = pokemonForm {
|
||||
|
||||
VStack(alignment: .leading) {
|
||||
|
||||
HStack {
|
||||
Text(pokemonDisplay?.$displayName ?? pokemonForm.$name)
|
||||
Spacer()
|
||||
}
|
||||
HStack {
|
||||
self.view(for: pokemonForm.$pokemonType1)
|
||||
if let pokemonType2 = pokemonForm.$pokemonType2 {
|
||||
|
||||
self.view(for: pokemonType2)
|
||||
return AnyView(
|
||||
VStack(alignment: .leading) {
|
||||
|
||||
HStack {
|
||||
Text(pokemonDisplay?.$displayName ?? pokemonForm.$name)
|
||||
Spacer()
|
||||
}
|
||||
HStack {
|
||||
self.view(for: pokemonForm.$pokemonType1)
|
||||
pokemonForm.$pokemonType2.map(self.view(for:))
|
||||
Spacer()
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
Spacer()
|
||||
}
|
||||
Spacer()
|
||||
)
|
||||
}
|
||||
}
|
||||
else {
|
||||
else {
|
||||
|
||||
Text(pokedexEntry?.$id ?? "")
|
||||
.foregroundColor(Color(UIColor.placeholderText))
|
||||
.fontWeight(.heavy)
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
return AnyView(
|
||||
Text(pokedexEntry?.$id ?? "")
|
||||
.foregroundColor(Color(UIColor.placeholderText))
|
||||
.fontWeight(.heavy)
|
||||
.frame(maxWidth: .infinity)
|
||||
)
|
||||
}
|
||||
}()
|
||||
}
|
||||
.frame(maxWidth: .infinity)
|
||||
}
|
||||
|
||||
@@ -20,20 +20,25 @@ struct NetworkImageView: View {
|
||||
// MARK: View
|
||||
|
||||
var body: some View {
|
||||
|
||||
if let image = self.imageDownloader.image {
|
||||
|
||||
Image(uiImage: image)
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
|
||||
return AnyView(
|
||||
Image(uiImage: image)
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fit)
|
||||
)
|
||||
}
|
||||
else {
|
||||
|
||||
Circle()
|
||||
.colorMultiply(Color(UIColor.placeholderText))
|
||||
.onAppear {
|
||||
|
||||
self.imageDownloader.fetchImage()
|
||||
}
|
||||
|
||||
return AnyView(
|
||||
Circle()
|
||||
.colorMultiply(Color(UIColor.placeholderText))
|
||||
.onAppear {
|
||||
|
||||
self.imageDownloader.fetchImage()
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user