Post

Replies

Boosts

Views

Created

variables in SwiftUi to another Framework
Hallo I have a question. Is it possible that you can access a variable that you created in swiftui in other frameworks? In my case, for example, on the counter. Thanks in advance :) import SwiftUI import SpriteKit class Gamescene: SKScene {                    var player = SKSpriteNode(color: .red, size: CGSize(width: 20, height: 20))          override func sceneDidLoad() {                  player.position = CGPoint(x: size.width / 2, y: size.height / 2)                  addChild(player)              } } struct ContentView: View {          public var counter = 0.0          var body: some View {         SpriteView(scene: Gamescene(size: CGSize(width: 100, height: 150)))             .ignoresSafeArea()     } } struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView()     } }
3
0
645
Feb ’21