This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ExampleUIKitGestureViewA: View { | |
var body: some View { | |
Color.blue | |
.overlay { ExampleUIKitGestureViewRepresentableA() } | |
/* | |
can also place it behind if hits are disabled on attaching view, | |
or you have other views you want to receive gestures that it would block |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SpriteKit | |
import SwiftUI | |
import Combine | |
/* | |
SpriteKit -> SwiftUI data message | |
*/ | |
enum StateUpdate { | |
case color(UIColor) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SpriteKit | |
import SwiftUI | |
import Combine | |
enum ControlUpdate { | |
case tap(UITapGestureRecognizer) // print SpriteKit coordinate | |
case doubleTap // reset camera | |
case pan(UIPanGestureRecognizer) // move camera |