https://github.com/onekiloparsec/kpcjumpbarcontrol
A macOS jump bar similar to Xcode's allowing to navigate accross a tree of objects
https://github.com/onekiloparsec/kpcjumpbarcontrol
control jumpbar macos swift swift3
Last synced: 3 months ago
JSON representation
A macOS jump bar similar to Xcode's allowing to navigate accross a tree of objects
- Host: GitHub
- URL: https://github.com/onekiloparsec/kpcjumpbarcontrol
- Owner: onekiloparsec
- License: mit
- Created: 2016-05-01T15:25:06.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2019-12-22T13:41:47.000Z (over 6 years ago)
- Last Synced: 2025-03-24T01:13:11.515Z (about 1 year ago)
- Topics: control, jumpbar, macos, swift, swift3
- Language: Swift
- Homepage: http://www.onekiloparsec.dev/kpcjumpbarcontrol
- Size: 265 KB
- Stars: 56
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
KPCTabsControl •
KPCJumpBarControl •
KPCSplitPanes •
KPCAppTermination •
KPCSearchableOutlineView •
KPCImportSheetController
-------
KPCJumpBarControl
==============

[](https://travis-ci.org/onekiloparsec/KPCJumpBarControl)



[](https://github.com/Carthage/Carthage)
A jump bar similar to Xcode's allowing to easily display and navigate across a tree of objects.


Installation
------------
Using [Carthage](https://github.com/Carthage/Carthage): add `github "onekiloparsec/KPCJumpBarControl"` to your `Cartfile` and then run `carthage update`.
Using [CocoaPods](http://cocoapods.org/): `pod 'KPCJumpBarControl'`
Usage
-----
KPCJumpBarControl is designed for you to use only the `JumpBarControl` class, and fill it with a tree of object
conforming to `JumpBarItem`. A helper class `JumpBarSegment` is here for that, if you need one.
Simply place a `NSView` in a storyboard or xib, where you need a jump bar, change its class to `JumpBarControl` and
that's it. To react when the jumbpar selection change, implement the `JumpBarControlDelegate` methods.
For instance:
```swift
let rootSegment = JumpBarItem(withTitle:"level 0", icon:NSImage(named:"Oval"))
let segment1Item0 = JumpBarItem(withTitle:"level 1.0", icon:NSImage(named:"Polygon"))
let segment1Item1 = JumpBarItem(withTitle:"level 1.1", icon:NSImage(named:"Rectangle"))
rootSegment.children = [segment1Item0, segment1Item1]
self.jumpBar?.useItemsTree([rootSegment])
self.jumpBar?.delegate = self
```
Highlighting
------------
The jump bar control support the possibility to be highlighted. This is useful when you have multiple subviews, for instance using KPCSplitPanes, each with jump bars, and you need to indicate to the user which subview is actually 'active'.
Author
------
[Cédric Foellmi](https://github.com/onekiloparsec) ([@onekiloparsec](https://twitter.com/onekiloparsec))
LICENSE & NOTES
---------------
KPCJumpBarControl is licensed under the MIT license and hosted on GitHub at https://github.com/onekiloparsec/KPCJumpBarControl/
Fork the project and feel free to send pull requests with your changes!