Posts

Post not yet marked as solved
3 Replies
1.3k Views
I'm just getting into development on mac os and I made a simple app for the touch bar that allows you to change the color (with a nscolorpicker) of a label that is also on the touch bar.Now I would like to get the same effect on the actual window like so: I change the color using the picker on the touch bar and the color of the colorwell in the window changes as well.This is the code that I currently have for the touch bar actions:import Cocoa @available(OSX 10.12.2, *) class MainWindowController: NSWindowController { @IBOutlet weak var cptHello: NSColorPickerTouchBarItem! @IBOutlet var lblHello: NSTextField! override func windowDidLoad() { super.windowDidLoad() / cptHello.color = NSColor.white setCol() } func setCol(){ lblHello.textColor = cptHello.color } @IBAction func colorPicked(_ sender: Any) { setCol() } }This piece of code resides in MainWindowController.swift which is paired with the window controller.In the view controller, I have a single NSColorWell that I would like to change the color for inside the function "setCol()". I created an outlet in the view controller for it like so:@IBOutlet var cwHello: NSColorWell!So ideally what I want to achieve is something like this: func setCol(){ lblHello.textColor = cptHello.color ViewController.cwHello.color = cptHello.colr }Can this be done at all?
Posted
by noahvt.
Last updated
.
Post not yet marked as solved
1 Replies
440 Views
Hi!I'm having a really annoying issue that I can't seem to resolve. I have the 2017 MacBook Pro 15 (top of the line model) running High Sierra 10.13.2 and XCode 9.2.The issue I'm having is that the interface builder often freezes when I'm either dragging or selecting UI elements, not only does XCode freeze but the ENTIRE OS freezes, the little spinning ball shows up. My music will continue playing but the entire OS and even the touchbar are completely unresponsive. I have to hold the power button to reset the machine.I tried everything from reinstalling MacOS to using different versions of XCode but nothing seems to help.Does anyone else have this problem?
Posted
by noahvt.
Last updated
.