Questions tagged [appkit]

The Application Kit is a collection of classes provided by OpenStep operating systems such as OPENSTEP, GNUstep, and Mac OS X.

The Application Kit is a collection of classes provided by OpenStep operating systems such as OPENSTEP, GNUstep, and Mac OS X.

Apple's reference documentation describes AppKit as follows:

AppKit contains all the objects you need to implement the user interface for a macOS app—windows, panels, buttons, menus, scrollers, and text fields—and it handles all the details for you as it efficiently draws on the screen, communicates with hardware devices and screen buffers, clears areas of the screen before drawing, and clips views.

Reference

1436 questions
13
votes
1 answer

How to make SwiftUI's Picker borderless/transparent on macOS?

I want to set a picker button borderless and transparent in SwiftUI on macOS. I tried using .background(), .border() and .opacity() modifiers on the Picker view. However, I can't change the background to a transparent color using .background(), I…
13
votes
1 answer

'NSApp' is unavailable in UIKit for Mac: How to embed Mac only framework in iOS app on macOS?

UIKit for Mac I’m exploring the new possibilities with Xcode 11 and macOS Catalina to create a Mac version of an iPad app using UIKit. Generally works as expected. What’s the best way to customize the NSWindow in an iOS app on macOS? Go Beyond the…
Zelko
  • 3,793
  • 3
  • 34
  • 40
13
votes
3 answers

Layer backed NSView with custom CALayer not calling updateLayer?

I have a custom layer-backed NSView and have overidden the makeBackingLayer method to return a custom CALayer subclass. I have also overriden wantsUpdateLayer to return true thereby fully opting into layer-like drawing. override func…
Sam
  • 2,745
  • 3
  • 20
  • 42
13
votes
4 answers

Resizing NSWindow to match view controller size in storyboard

I am working on Xcode 6.1.1 on OSX 10.10. I am trying out storyboards for Mac apps. I have a NSTabViewController using the new NSTabViewControllerTabStyleToolbar tabStyle and it is set as the default view controller for the window controller. How do…
Kaunteya
  • 3,107
  • 1
  • 35
  • 66
13
votes
4 answers

How to uniformly scale rich text in an NSTextView?

Context: I have a normal Document-based Cocoa Mac OS X application which uses an NSTextView for rich text input. The user may edit the font family, point size and colors of the text in the NSTextView. Base SDK: 10.7 Deployment Target:…
Todd Ditchendorf
  • 11,217
  • 14
  • 69
  • 123
12
votes
1 answer

NSTextView, appending text and smooth scrolling

I am trying to implement smooth scrolling in a chat history view I implemented, however if the content I append is big enough the smooth scroll will only scroll for a few lines. My first guess was that the view did not redraw itself yet.. not the…
Antwan van Houdt
  • 6,989
  • 1
  • 29
  • 52
12
votes
1 answer

The most elegant way of creating a fullscreen overlay on Mac OS X (Lion)?

I'm searching for the "best" way of creating a fullscreen overlay under Mac OS X. I want to create a transparent or semi-transparent overlay, which cares about mouse events and shows other input/output elements. This overlay should be above every…
tamasgal
  • 24,826
  • 18
  • 96
  • 135
12
votes
1 answer

Big Sur Toolbar Items in the Sidebar

In Big Sur, Xcode and Calendar have toolbar items that stay over the sidebar when open but remain visible on the left side when the sidebar's collapsed. Sidebar open: Sidebar collapsed: In "Adopt the New Look of macOS" at 13:55, John says "items…
smr
  • 890
  • 7
  • 25
12
votes
4 answers

Toggle Sidebar in SwiftUI NavigationView on macOS

I have a macOS Application with a NavigationView and want to have the default ToggleSidebar item in the toolbar of the window. Currently I set the target of the ToolbarItem to the AppDelegate in toolbarWillAddItem(_) of the NSToolbarDelegate. Inside…
ricobeck
  • 172
  • 1
  • 11
12
votes
5 answers

Show NSMenu only on NSStatusBarButton right click?

I have the following code: (can be copy-pasted to New macOS project) import Cocoa import SwiftUI @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { var statusBarItem: NSStatusItem! func applicationDidFinishLaunching(_…
bapafes482
  • 444
  • 4
  • 18
12
votes
2 answers

Open a new window in Mac Catalyst

I am porting an iPad app using Mac Catalyst. I am trying to open a View Controller in a new window. If I were using strictly AppKit I could do something as described in this post. However, since I am using UIKit, there is no showWindow() method…
Arturo Reyes
  • 179
  • 1
  • 6
12
votes
2 answers

Why does NSTableView crash when processing deleted rows as NSFetchedResultsControllerDelegate?

I am using a fairly standard setup of NSTableView + CoreData + NSFetchedResultsController, with the relevant view controller being NSFetchedResultsControllerDelegate to receive the changes. Here are the relevant bits of code from the view…
Jaanus
  • 17,688
  • 15
  • 65
  • 110
12
votes
4 answers

What is the difference between AppKit and UIKit?

UIKit and AppKit still share a lot of concepts. Apple says: AppKit contains all the objects you need to implement the user interface for a macOS app—windows, panels, buttons, menus, scrollers, and text fields They also say that UIKit is used to…
Priti Kanauziya
  • 265
  • 1
  • 3
  • 13
12
votes
2 answers

How do I draw the desktop on Mac OS X?

I want to draw the desktop on Mac OS X (Snow Leopard). Specifically, I want to achieve the same effect as running: /System/Library/Frameworks/ScreenSaver.framework/Resources/ ScreenSaverEngine.app/Contents/MacOS/ScreenSaverEngine -background (If…
Dominic Cooney
  • 6,317
  • 1
  • 26
  • 38
12
votes
5 answers

Vertically aligning text in an NSTextField using Swift

I have been reading through the various options on how to set the vertical alignment on an NSTextField. I want the text to be displayed in the center and to do it programatically in Swift. Here are the things I have looked so…
Richard Burton
  • 2,230
  • 6
  • 34
  • 49
1 2
3
95 96