![]() You’ll find some preparation already been done, with significant parts of code already been implemented. Getting StartedĪssuming that you have downloaded the starter pack, unzip and open the WorldTime project in Xcode so you can follow along here. Note though that this kind of status bar apps is not appropriate for dealing with user input if that’s your purpose, then you should read how to create status bar apps that display popovers later on in this tutorial. This sample application contains all the necessary information that one would need in order to create similar applications which display a menu and potentially a custom view. We’ll use the User Defaults as the means to save (and to read from subsequently) the user selected timezone. In addition, we’ll make it possible to change the preferred timezone through a Preferences window. When its status item will be clicked, it will present a menu with a few options (About window, Preferences and Quit), and a custom view with date and time information for a specific timezone. What we aim to achieve with it is to start from a normal macOS app, and to convert it to a status bar app. ![]() The first demo application we are going to work with in this tutorial is called WorldTime and you can find it in this starter pack. We will discuss about the necessary configuration that turns a casual app into a status bar app, we’ll see best practices and how-to, and generally almost everything you will need to know when you’ll start making your own status bar macOS apps. In this tutorial we’ll focus on the first two cases by going through two different demo applications and you’ll learn how to create status bar apps that work in one or the other way by showing up menu options with a custom view or by presenting a popover. For example, in a status bar app that shows weather information is perfectly fine to let users configure preferences in a separate window, but the temperature or other vital weather information cannot be “hidden” behind a menu option that will bring up another window which in turn will contain the weather details it has to be there right when the app icon (or title) gets clicked. But always keep in mind that users expect to find key features or important information right when clicking on a status bar app’s item. However, this doesn’t mean that windows and view controllers cannot or should not be displayed at all! On the contrary, any window necessary can be presented to provide additional options, actions, comfort and flexibility to users. Actually, this is what makes status bar apps meaningful and usually this is what users expect to find to use app features fast without dealing with windows. Most of the times status bar app features and functionalities are accessible without presenting a window by default. Even though that’s not such a common case, it consist of an option to let users have the app’s window appear right in front of them just by clicking on an icon in the top bar. This popover contains one or more view controllers and it’s suitable for dealing with user input while still being in the status bar app mode and without having presented an actual window.Ī more rare scenario is just to present the app’s main window when clicking on the status item, just like it would be presented on a normal launch.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |