Post

Replies

Boosts

Views

Created

Animate sizeToFit
I change the text of a label dynamically (so I do not know the text of the label) how can I animate the size to fit. I am looking for a smooth, elegant transition for design purposes. What I have tried:         NSAnimationContext.runAnimationGroup({ (context) in             context.duration = 4.0 label1.stringValue = "long, long text"             label1.animator().sizeToFit()         })
5
0
1.6k
Aug ’21
Make a link in macOS
How to make a link when I click to a button in macOS? This works well in iOS. How to do the same with macOS:     @IBAction func button1(_ sender: UIButton) {         if let url = URL(string: "some link") {             UIApplication.shared.open(url)         }     }
2
0
813
Sep ’20
Window in all spaces
macOS, Swift, storyboards How can I make the window active in all spaces? I could find how to do that with storyboard: Select the window > Attributes > Spaces > Can join all spaces. How can I do the same with code (activate and de-activate)
1
0
922
Jul ’20
Remove the scroll in WebKit View
macOS, SwiftIs it possible to remove the scroll in WebKit View? (or make it not visible)I have a WebKit View from library and I have made the connection to the ViewController.swift:@IBOutlet weak var webView1: WKWebView!
Topic: UI Frameworks SubTopic: AppKit Tags:
6
0
6.9k
Jun ’20