Posts

Post not yet marked as solved
2 Replies
Hello, Thank you for your help. On my main program, I ask to send information this way: TableauAEnvoyer["TypeDeSeancePourLaSeance\(Load_nbSeancePagingView)"] = "\(SeanceSelectionnee)" WatchDataModel.shared.TableauSynchroIphoneWatch = TableauAEnvoyer WatchDataModel.shared.session.transferUserInfo(["TableauSynchroIphoneWatch":WatchDataModel.shared.TableauSynchroIphoneWatch]) I'm modify my code in my Watch app, but Xcode gives me an error: Cannot override 'sessionDidBecomeInactive' which has been marked unavailable Cannot override 'sessionDidDeactivate' which has been marked unavailable In my Watch app, I'm add your code : import WatchConnectivity let userDefaultsDataVenantIphone = UserDefaults.standard var TableauVenantIphone:[String:String] = ["":""] class WatchDataModel : NSObject, WCSessionDelegate, ObservableObject { static let shared = WatchDataModel() let session = WCSession.default @Published var TableauSynchroIphoneWatch : [String:String] = ["0":"0"] override init() { super.init() if WCSession.isSupported() { session.delegate = self session.activate() } else { print("ERROR: Watch session not supported") } } func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) { if let error = error { print("session activation failed with error: \(error.localizedDescription)") return } } func sessionDidBecomeInactive(_ session: WCSession) { session.activate() } func sessionDidDeactivate(_ session: WCSession) { session.activate() } func session(_ session: WCSession, didReceiveUserInfo userInfo: [String : Any]) { guard let newCount = userInfo["TableauSynchroIphoneVersWatch"] as? [String:String] else { print("ERROR: unknown data received from Watch TableauSynchroIphoneWatch") return } DispatchQueue.main.async { print(newCount) } } }
Post marked as solved
2 Replies
Hello ! thank you for your help ! this helped me a lot ! I didn't know about the "UIGraphicsImageRenderer" function. thank you !
Post not yet marked as solved
2 Replies
Thank you for your answer. in this case, how can I go to a new view, and navigate between these two views?
Post not yet marked as solved
2 Replies
I think that the problem comes from there, but I am not sure, and I do not know how to avoid that the transparency of the images is integrated in the contacts: EnnemisOrdinateur11.physicsBody = SKPhysicsBody(rectangleOf: EnnemisOrdinateur11.size) EnnemisOrdinateur11.physicsBody?.isDynamic = true EnnemisOrdinateur11.physicsBody?.categoryBitMask = EnnemisOrdinateur1Category EnnemisOrdinateur11.physicsBody?.contactTestBitMask = MurOUobjetCategory | PouvoirPlayer1Category EnnemisOrdinateur11.physicsBody?.collisionBitMask = MurOUobjetCategory | PouvoirPlayer1Category EnnemisOrdinateur11.physicsBody?.usesPreciseCollisionDetection = truethank for your help !