Post

Replies

Boosts

Views

Activity

Reply to Use Apple Watch as a view finder with ARKit
You can of course send messages from iPhone to Watch. This could be an image. But I don't know it is possible to send live (animated) view. Did you see this WWDC session ? https://developer.apple.com/videos/play/wwdc2021/10003/ If I understand correctly this table, only way to have (audio) streaming is sockets to server. Could it meet your need ?
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to Why do I get touchesCanceled all the time?
It is surprising to have Cancel for a TapGesture. Doc shows that for such discrete gesture, there is not such a state (just failed, but that may come from a cancel):       https://developer.apple.com/documentation/uikit/touches_presses_and_gestures/implementing_a_custom_gesture_recognizer/about_the_gesture_recognizer_state_machine
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to Why is the struct type UUID not sendable?
UUID does not conform to Sendable (even though it is a struct, but some of its components may be mutable ?) Conforms to: CustomReflectable CustomStringConvertible Decodable Encodable Equatable Hashable ReferenceConvertible Hence, S does not conform either. See example in Proposal: SE-0302 https://github.com/apple/swift-evolution/blob/main/proposals/0302-concurrent-value-and-concurrent-closures.md // error: MyNSPerson cannot conform to Sendable due to NSMutableString member. // note: add '@unchecked' if you know what you're doing. struct MyNSPerson : Sendable { var name: NSMutableString var age: Int }
Topic: App & System Services SubTopic: General Tags:
Aug ’21
Reply to Fetch Width and Height From UIView
In the code you posted, you do not define a frame for viewView. Hence 0,0 I did some formatting: let View1: UIView = { let viewView = UIView() viewView.translatesAutoresizingMaskIntoConstraints = false viewView.contentMode = .scaleAspectFit print(UserDefaults.standard.bool(forKey: "backgroundColourSelected")) if UserDefaults.standard.bool(forKey: "backgroundColourSelected") { viewView.backgroundColor = self.viewColor } else { viewView.backgroundColor = .white } viewView.clipsToBounds = true return viewView }() Try and replace let viewView = UIView() by something like: let viewView = UIView(frame: CGRect(x: 64, y: 0, width: 256, height: 128))
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to Need Help Transfer Data From Button
gotta figure out why the name is not being transferred over.  There may be several reasons: segue.identifier is not the expected one segue.destination is not of the expected class the name you pass is empty. You should add several prints at each step of prepare to check for this. If you want more precise help, you should post the complete code of the class.
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to Animate sizeToFit
Could you detail what you get and what you expect ? AFAIU, animation works by layering an image "capture" over the view to animate and then apply the animation on this layer. Thus, I don't think it will change the font size, but scale the image. I don't think sizeToFit is appropriate here. May have a look at using transform: https://stackoverflow.com/questions/14494566/animating-uilabel-font-size-change
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21
Reply to Animate sizeToFit
So I understand you want to animate (through NSAnimation), the change of the label's text in a MacOS app ? And the change occurs only abruptly (probably after the 4 seconds) ? It would help to see or reproduce exactly what you get. Could you post the complete code the the class ?
Topic: Programming Languages SubTopic: Swift Tags:
Aug ’21