XcodesApp
XcodesApp copied to clipboard
Update XcodesApp.swift
Create MenuBar item. Probably needs additional ui in settings to only show menu bar item, and hide the dock icon and all that. But this seems to work okay. Maybe needs better icon.
This would be way cooler if the menubar icon changed to show when its downloading and installing xcodes.
@jacobwhite may I suggest a small thing? Upload a screenshot of your change. This will make easier for the reviewer to see exactly what should be the result of your pull request.
@unnamedd Sure.

Hey Jacob!
Thanks for contributing to Xcodes!
I love the idea of a menu icon. I love the idea of the menu icon changing for different statuses (downloading, unxiping, refreshing, etc)
I'm not in love with just showing the main UI, just to have it in the menu. Is there a particular aspect of a menu app that is more enticing for you?
My first idea was to have it be in a popover. But clicking the status menu could just toggle the main window instead maybe.
On Apr 26, 2021, at 7:50 PM, Matt Kiazyk @.***> wrote:
Hey Jacob!
Thanks for contributing to Xcodes!
I love the idea of a menu icon. I love the idea of the menu icon changing for different statuses (downloading, unxiping, refreshing, etc)
I'm not in love with just showing the main UI, just to have it in the menu. Is there a particular aspect of a menu app that is more enticing for you?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
Hi @jacobwhite thank you for your contribution :)
Unfortunately, when referencing Apple's Human Interface Guidelines they recommend not to show a popover from a menu item.
Display a menu—not a popover—when the user clicks your menu bar extra. Unless the app functionality you want to expose is too complex for a menu, you should avoid presenting it in a popover. See Popovers.
That being said, there are apps that break this rule such as Dropbox and 1Password. The difference with these apps though is they present a significantly different UI in the popover from the main UI. It is usually some sort of quick access or simplified view.
I totally agree with you and @MattKiazyk that a menu item that changes status when downloading or installing would be a great addition. Now just to decide if a menu, or some sort of simplified popover makes sense when clicking the menu item 🤔
Yeah, I mean, you could just filter the list to the one Xcode that’s being installed or downloaded. But personally I think I just want the whole app in the menu.
On Apr 27, 2021, at 6:51 AM, Andrew Erickson @.***> wrote:
Hi @jacobwhite thank you for your contribution :)
Unfortunately, when referencing Apple's Human Interface Guidelines they recommend not to show a popover from a menu item.
Display a menu—not a popover—when the user clicks your menu bar extra. Unless the app functionality you want to expose is too complex for a menu, you should avoid presenting it in a popover. See Popovers.
That being said, there are apps that break this rule such as Dropbox and 1Password. The difference with these apps though is they present a significantly different UI in the popover from the main UI. It is usually some sort of quick access or simplified view.
I totally agree with you and @MattKiazyk that a menu item that changes status when downloading or installing would be a great addition. Now just to decide if a menu, or some sort of simplified popover makes sense when clicking the menu item 🤔
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
i love this UI, XcodesApp is a really simple app and it doesn't need its own separate window, given that it can live in the menu bar, automatically updating Xcode should be possible
Yeah! Especially if you just want to leave it running all the time.
Too bad they don't agree. ¯_(ツ)_/¯
I think a menu bar item is an excellent idea! I see there is some debate on the design. I would like to offer an alternative approach with the hope that maybe this could be a nice compromise. I am offering a simpler UI for the drop-down menu, while maintaining the most critical functionality that should be easily accessible.
Description
- Show the active Xcode version directly in the menu bar (similar to battery percentage).
- I personally think this is such an awesome feature that I would look at frequently as I need to switch Xcode versions for different projects.
- In the drop down menu, only show the installed versions.
- Each version in the list is displayed as text, such as
12.5 Beta 3 (12E5244e), no app icon or other details (simple is elegant) - Selecting an installed version from the drop down menu will make it active.
- The active version will have an icon (likely checkmark or possibly simply a bullet) indicating it is the active one.
- Each version in the list is displayed as text, such as
- The drop down menu can also contain menu items for opening the main Xcodes window, opening settings or quitting.
- Somewhere there should be settings for the menu bar item itself to control whether the Xcode build numbers are shown and whether the active version is shown in the menu bar.
Prototype Sample Code
final class AppDelegate: NSObject, NSApplicationDelegate {
private var statusBarItem: NSStatusItem!
private let systemSymbolName: String = "wrench.and.screwdriver"
private let mockXcodeVersions: [String] = [
"12.5 Beta 3 (12E5244e)",
"12.5 Beta 2 (12E5234g)",
"12.5 Beta (12E52200)",
"12.4 (12D4e)",
"12.3 (12C33)",
"12.3 Beta (12C5020f)",
]
private lazy var mockXcodeVersion: String = "12.4 (12D4e)"
func applicationDidFinishLaunching(_ notification: Notification) {
statusBarItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
configureStatusBarItemButton(statusBarItem.button)
configureStatusBarItemMenu(statusBarItem)
}
private func configureStatusBarItemButton(_ button: NSStatusBarButton?) {
guard let button: NSStatusBarButton
else { return }
button.title = mockXcodeVersion
button.image = NSImage(systemSymbolName: systemSymbolName, accessibilityDescription: "Xcodes")
}
private func configureStatusBarItemMenu(_ statusBarItem: NSStatusItem) {
let menu: NSMenu = .init()
for xcodeVersion: String in mockXcodeVersions {
let menuItem: NSMenuItem = .init()
let image: NSImage?
if xcodeVersion == mockXcodeVersion {
image = .init(systemSymbolName: "checkmark.circle.fill", accessibilityDescription: xcodeVersion)
} else {
image = NSImage(size: NSSize(width: 1, height: 1))
}
menuItem.image = image
menuItem.title = xcodeVersion
menuItem.action = #selector(didSelectXcodeVersion)
menu.addItem(menuItem)
}
menu.addItem(.separator())
menu.addItem(withTitle: "Open Xcodes", action: #selector(openXcodes), keyEquivalent: "")
menu.addItem(withTitle: "Settings", action: #selector(openSettings), keyEquivalent: "")
menu.addItem(withTitle: "Quit", action: #selector(openSettings), keyEquivalent: "")
statusBarItem.menu = menu
}
@objc
private func didSelectXcodeVersion(_ sender: NSMenuItem) {
print(sender.title)
}
@objc
private func openXcodes(_ sender: NSMenuItem) {}
@objc
private func openSettings(_ sender: NSMenuItem) {}
}
Hell yeah, maybe optional considering it would take a lot of space on a top notch laptop.