• Stars
    star
    177
  • Rank 215,985 (Top 5 %)
  • Language
    Swift
  • License
    MIT License
  • Created almost 4 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Three beautiful macOS sidebars. Two built in Cocoa, and the third in SwiftUI.

The SwiftUI sidebar implementation is courtesy of 1998code. Go show them some love!

Overview

Provided in this project are three different implementations of the macOS sidebar:

Variant Compatibility

Cocoa

  • Variant 1: Built for Programmers (NSOutlineView)
  • Variant 2: Built for Designers (Storyboards)

OS X 10.11 and higher

SwiftUI

  • Joint Variance: SideBarListStyle()

macOS 11.0 and higher

As much as I love SwiftUI, this project is more of a POC that Cocoa is still relevant. I wanted to show that the Cocoa implementation of something as simple as a sidebar didn't need to be extremely complex or time-consuming. Similarily, creating a highly-customizable sidebar shouldn't require heavily packaged frameworks.

Variant 1 Cocoa

The variant that was built with the average programmer in-mind.

Pros Cons
• Fastest Cocoa implementation
• Easy to setup and configure menu items
• Resizable sidebar (NSSplitView)
• Adopts the style of the user's current
  version of macOS (tbt to aqua!)
• Only assets are icons (optional)
• Lacks section & row headers
• Not very customizable
• Menu items are inherited
• All follow the same structure
  ie. title & icon

Summary

Great for implementing basic sidebars that don't need a ton of customization. Adopts the style of the user's version of macOS for complete immersion with backward-compatibility.

Variant 2 Cocoa

The variant that was built for designers who love Storyboards.

Pros Cons
• Highly customizable interface
• Allows for individual menu item customization 
• Same appearance across all versions of macOS
• Mutable/customizable container view
• Easy to modify, manipulate and animate
  ie. Toggle hide/show sidebar with fade effect
• Heavily relies on Storyboards
• Uses AutoLayout + Constraints
• Experience with design software – ie.
  Photoshop/XD – for the ultimate
  customization experience

Summary

Great for maximum customization. Maintains the same style and appearance, regardless of the user's macOS version (bring newer UI design standards to backwards compatible applications)!


I do intend on making a Swift package with zero external assets required – aside from the menu icons – and would love some help getting started!

Although SwiftUI has made it a breeze to implement, I've always found the process to be far more complex than it needs to be when working with Cocoa.

Since I'm constantly developing newer applications with SwiftUI – yet also maintaining older projects that require maximum OS compatibility – I thought it would be useful to have a resource that portrays both implementations.

MIT License

Copyright 2021 © Justin Bush

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

AppleMusicUltra

Music Client for macOS. Upgrade your music experience with themes, styles, custom scripting and more. Uses WebKit and JavaScript.
Swift
391
star
2

Python-IDE

Synthetic Python interpreter for iOS
Objective-C
48
star
3

WiBlaze

Open source web browser based on speed and durability
Swift
41
star
4

BaldursModManager

Baldur's Gate 3 Mod Manager for macOS
Swift
26
star
5

JBThemeSelector

A beautiful, dynamic theme selector for macOS
Swift
24
star
6

SyntaxKit

Syntax Highlighting Demo for iOS & macOS with 175 Languages
Swift
12
star
7

Glow

A light-weight web browser built for speed, performance and above all, beauty.
Swift
8
star
8

AppleMusicFriends

A JavaScript framework for Music that better integrates the social experience of listening with friends (like Spotify)
Swift
6
star
9

WKBlurEffect

Demo of WKWebView with NSVisualEffectView as a background for a beautiful blur effect
Swift
3
star
10

CommandF

A modern alternative to Finder
Swift
3
star
11

URLSearchBar

Joint URL-Search Bar framework for use with WebView
Objective-C
3
star
12

LaunchGuardKit

An open source development kit for the components featured in LaunchGuard for macOS
Swift
3
star
13

InspectorTool

A minimal file inspection tool for macOS using FileManager
Swift
3
star
14

Notique

A minimalistic, cloud-based notes app for iOS (v2 Deprecated)
Objective-C
2
star
15

JBFileManager

An open source demo of Swift's File Management system
Swift
2
star
16

Visualizer

An open-source music visualizer for iOS and macOS
2
star
17

TVUI

A demo SwiftUI app built to stream live TV (for educational purposes only)
Swift
2
star
18

Ridge

Open source iOS app for Iroquois Ridge High School
Objective-C
2
star
19

FFmpegDemo

FFmpeg interfacing on macOS
Swift
2
star
20

VideoConverter

Simple video conversion project using Swift, TypeScript and FFMPEG
JavaScript
2
star
21

GDark

Google Dark for Safari (Web Extension)
Swift
1
star
22

SquareCode

A simple example for developers who wish to learn how to create a proper code editor on the iOS platform
Swift
1
star
23

WebScriptKit

Starter iOS and macOS code for Swift–JavaScript communication through WebKit
Swift
1
star
24

SwiftyStarterKits

Quick and easy Xcode starter templates for iOS, iPadOS and macOS
Swift
1
star
25

CurrencyExchange

Calculate historical exchange rates without having to pay for API usage
Swift
1
star
26

JSON2Swift

Generates a Swift model implementation of the input JSON
Swift
1
star
27

StreamShare

A mini cross-platform application for sharing music
Swift
1
star
28

SafariDarkMode

Safari App Extension that simulates Dark Mode on unsupported websites
1
star