Now when clicked the button will open the Preferences window. Release the mouse and select the Show action segue. The Preferences window will become highlighted. Hold ctrl while click and dragging from the button to the new Preferences window. Now we have the button but we need to make it do something. Select the button and go to the Attributes inspector. Press the library button, search for Push Button and drag it into the Main view controller. Let’s create a button on the Main view controller and set it up so that when it’s pressed it shows the preferences window. Linking the main app window to the preferences window We can do this by going to Main.storyboard, clicking the Library button, searching for Window View Controller and then drag a new Window Controller next to our Main window. With the app created we need to create the Preferences window. In the second panel, make sure “Use Storyboards” is selected. ![]() We need to make sure “MacOS” and “Cocoa App” are selected. This tutorial uses Xcode 10.2 and Swift 5.įirst things first, let’s create a new Mac project in Xcode, I called mine GlobalConfigKeybind.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |