Does GeometryReader not work any more in iOS Swift Playgrounds for iPad (ver 3.4) ? This code runs fine on MBP in Xcode ... fails on line 7 with Abort() Called on iPad from a start up Blank 5.3 playground.
import PlaygroundSupport
import SwiftUI
struct ContentView: View {
		var body: some View {
				GeometryReader { geometry in
						Color.blue
								.frame(height: geometry.size.height * 0.5)
				}
		}
}
PlaygroundPage.current.setLiveView( ContentView() )
I'll see if I can identify specific places where iOS Swift Playgrounds for iPad ver 3.4 has other issues.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
The following code fails to run from a fresh Blank Swift 5.3 playground in the Swift Playgrounds app for iPad.
I have cut and cut the original code down to this ... which I think is pretty simple. I have also tested this for any syntax errors on MBP Xcode (where it runs with no problem). However on the iPad, after the new Playgrounds app update, it fails on line 26 with:
Abort() called
import PlaygroundSupport
import SwiftUI
struct Fruit: Identifiable {
		let id = UUID()
		let name: String
		let emoji: String
		
		static var list = [
				Fruit(name: "Apple", emoji: "🍎"),
				Fruit(name: "Bannanna", emoji: "🍌"),
				Fruit(name: "Cherry", emoji: "🍒"),
				]
}
struct ContentView: View {
		
		let fruitList = Fruit.list
		let sortAscending = false
		
		var body: some View {
				
				List {
						ForEach( fruitList ) { fruit in
								HStack {
										Text("\(fruit.emoji)")
										Text("\(fruit.name)")
								}
								.font(.title)
						}
				}
		}
}
PlaygroundPage.current.setLiveView( ContentView() )
This and many other apps have all broken after the iOS Swift Playgrounds app updated to version 3.4.