Post

Replies

Boosts

Views

Activity

Reply to How to get SKScene screen dimensions when using SpriteView
So, because I was completely stuck on this matter I requested code level support from Apple, and they came with this answer; The reason you are receiving NaN is that you are calling these methods before the underlying SKView has been actually presented by SwiftUI, which is an event that you have no visibility into, and no way to call code when it happens. However, when this event does occur, the SKScene’s view property will have it’s window set from nil to a UIWindow. Therefore, you could use KVO to observe when the window property is changed, and then make your calls to convertPoint once there is a non-nil window. Now , how the heck do I put an observer on SKScene to monitor change? I have 0 experience with Observe/KVO. I have tried : override func didMove(to view: SKView) {         view.observe(\.frame.maxX, options: .new ) { object, change in             print ("it has been changed")         } } this gives me an error "Fatal error: Could not extract a String from KeyPath Swift.KeyPath" and override func didMove(to view: SKView) {         view.observe(\.frame, options: .new ) { object, change in             print ("it has been changed")         } } but this doesn't seem to be called when it is changed. any help would be appreciated.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’21
Reply to [tvOS 18][SwiftUI] Severe ScrollView Lag after Update
Thanks, I will give it a try - I am also trying to look into UIScrollview, which is way more performant. But I have 0 experience with UIKIT :( edit : well, unfortunately for me it is not possible. Using a list means it will fetch in remote data of all the elements in that list.
Replies
Boosts
Views
Activity
Oct ’24
Reply to [tvOS 18][SwiftUI] Severe ScrollView Lag after Update
I am having the exact same issue with my app. small arrays are fine, but the bigger the array the slower it becomes. Did you discover any work around to this issue ?
Replies
Boosts
Views
Activity
Oct ’24
Reply to SKEmitterNode ignoring zPosition on iOS
use particleZposition instead of zposition, works like a charm
Topic: Graphics & Games SubTopic: SpriteKit Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to How to get SKScene screen dimensions when using SpriteView
So, because I was completely stuck on this matter I requested code level support from Apple, and they came with this answer; The reason you are receiving NaN is that you are calling these methods before the underlying SKView has been actually presented by SwiftUI, which is an event that you have no visibility into, and no way to call code when it happens. However, when this event does occur, the SKScene’s view property will have it’s window set from nil to a UIWindow. Therefore, you could use KVO to observe when the window property is changed, and then make your calls to convertPoint once there is a non-nil window. Now , how the heck do I put an observer on SKScene to monitor change? I have 0 experience with Observe/KVO. I have tried : override func didMove(to view: SKView) {         view.observe(\.frame.maxX, options: .new ) { object, change in             print ("it has been changed")         } } this gives me an error "Fatal error: Could not extract a String from KeyPath Swift.KeyPath" and override func didMove(to view: SKView) {         view.observe(\.frame, options: .new ) { object, change in             print ("it has been changed")         } } but this doesn't seem to be called when it is changed. any help would be appreciated.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to How to get SKScene screen dimensions when using SpriteView
n/a
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’21