Post

Replies

Boosts

Views

Activity

Tasks shown "alive" in Instruments display even after they should have finished.
In my TestApp I run the following code, to calculate every pixel of a bitmap concurrently: private func generate() async {     for x in 0 ..< bitmap.width{         for y in 0 ..< bitmap.height{             let result = await Task.detached(priority:.userInitiated){                return iterate(x,y)             }.value             displayResult(result)         }     } } This works and does not give any warnings or runtime issues. After watching the WWDC talk "Visualize and optimize Swift concurrency" I used instruments to visualize the Tasks: The number of active tasks continuously raises until 2740 and stays constant at this value even after all 64000 pixels have been calculated and displayed. What am I doing wrong?
2
0
1.8k
Dec ’23
How do I get the same gesture behaviour like when previewing reality files?
I know how to install gestures on an object in ARView like this: let worldAnchor = AnchorEntity(world: [0,0,0]) arView.scene.addAnchor(worldAnchor) worldAnchor.addChild(myObject) myObject.generateCollisionShapes(recursive: true) arView.installGestures(for: myObject) Unfortunately this does not behave very intuitive. I would like to have the same rotation and scale behaviour like when previewing a .reality file in Xcode oder Quicklook. How do I achieve this?
0
0
670
Mar ’23
ImagePaint does not work for me any more since (iOS 15) update one year ago.
With struct ContentView: View {     var body: some View {         Rectangle().fill(ImagePaint(image: Image(systemName:"circle.fill").renderingMode(.template), sourceRect: CGRect(origin: CGPoint.zero,  size:CGSize(width: 100, height: 100)), scale: 0.009)).foregroundColor(.red)     } } I could draw a rectangle filled with small circles before iOS 15 (last year's update). Since then this does not work any more and I only get "white on white" circles. Searching on Google for a solution only yields very few examples using ImagePaint at all and all of them are from before iOS 15. How can I get the desired result working again?
1
0
832
Jul ’22
Tasks shown "alive" in Instruments display even after they should have finished.
In my TestApp I run the following code, to calculate every pixel of a bitmap concurrently: private func generate() async {     for x in 0 ..< bitmap.width{         for y in 0 ..< bitmap.height{             let result = await Task.detached(priority:.userInitiated){                return iterate(x,y)             }.value             displayResult(result)         }     } } This works and does not give any warnings or runtime issues. After watching the WWDC talk "Visualize and optimize Swift concurrency" I used instruments to visualize the Tasks: The number of active tasks continuously raises until 2740 and stays constant at this value even after all 64000 pixels have been calculated and displayed. What am I doing wrong?
Replies
2
Boosts
0
Views
1.8k
Activity
Dec ’23
How do I get the same gesture behaviour like when previewing reality files?
I know how to install gestures on an object in ARView like this: let worldAnchor = AnchorEntity(world: [0,0,0]) arView.scene.addAnchor(worldAnchor) worldAnchor.addChild(myObject) myObject.generateCollisionShapes(recursive: true) arView.installGestures(for: myObject) Unfortunately this does not behave very intuitive. I would like to have the same rotation and scale behaviour like when previewing a .reality file in Xcode oder Quicklook. How do I achieve this?
Replies
0
Boosts
0
Views
670
Activity
Mar ’23
ImagePaint does not work for me any more since (iOS 15) update one year ago.
With struct ContentView: View {     var body: some View {         Rectangle().fill(ImagePaint(image: Image(systemName:"circle.fill").renderingMode(.template), sourceRect: CGRect(origin: CGPoint.zero,  size:CGSize(width: 100, height: 100)), scale: 0.009)).foregroundColor(.red)     } } I could draw a rectangle filled with small circles before iOS 15 (last year's update). Since then this does not work any more and I only get "white on white" circles. Searching on Google for a solution only yields very few examples using ImagePaint at all and all of them are from before iOS 15. How can I get the desired result working again?
Replies
1
Boosts
0
Views
832
Activity
Jul ’22