Swiftpack.co - Package - onekiloparsec/KPCTabsControl

KPCTabsControlKPCJumpBarControlKPCSplitPanesKPCAppTerminationKPCSearchableOutlineViewKPCImportSheetController


KPCTabsControl

Build Status Version License Platform Carthage compatible Codewake

A multi-tabs control first designed to look and behave like the tab control in Apple's Numbers spreadsheet, with enhanced capabilities, but now with new tab styles, such as Chrome & Safari, as well as custom ones.

On master, you'll find the latest Swift 5 releases.

  • If you need to stay with Swift 4, switch to the swift-4.2 branch.
  • If you need to stay with Swift 3, switch to the swift-3.1 branch.
  • If you need to stay with Swift 2, switch to the swift-2.2 branch.

Demo Tabs Screenshot

KPCTabsControl provides the following features:

  • Custom styles and themes! Default (Numbers.app-like), Chrome and Safari are provided. But you can easily write your own!
  • Styles & themes comprise title styles, title editor style, (un)selected/unselectable backgrounds, borders, colors, fonts etc.
  • Common dataSource/delegate Cocoa APIs
  • Tabs can span the whole view width, or be flexible inside min&max.
  • Tabs can be reordered, and renamed in place.
  • When provided, the title can be replaced by an alternative icon when the width is too narrow for the title to be drawn.

Demo Auxiliary Icons

Documentation

The documentation generated from the code itself is available at http://onekiloparsec.github.io/KPCTabsControl.

Installation

Using Carthage: add github "onekiloparsec/KPCTabsControl" to your Cartfile and then run carthage update.

Using CocoaPods: pod 'KPCTabsControl'.

Usage

KPCTabsControl is designed for you to use only the KPCTabsControl class, and its associated data source methods. Simply place a NSView in a xib, where you need tabs, change its class to KPCTabsControl and assign its dataSource property. Then implement the data source methods in your controller.

You can also assign a delegate if you want to play with the editing and the reordering of the tab titles.

Authors

Cédric Foellmi (@onekiloparsec)
Christian Tietze (@ctietze)

LICENSE & NOTES

KPCTabsControl is licensed under the MIT license and hosted on GitHub at https://github.com/onekiloparsec/KPCTabsControl/ Fork the project and feel free to send pull requests with your changes!

Github

link
Stars: 142

Dependencies

Used By

Total: 0

Releases

Swift 4 + 2 important fixes - 2018-03-24 09:30:08

The lib version matches that of the Swift langage. Hence the move from 3 to 4, despite having only small changes.

But #33 is fixed, and you can now add tabs on the flyw without problems. And more importantly, they appear correctly, since another bug hidden by that first one, is also fixed.

KPCTabsControl takes the Swift3 train! - 2016-09-24 06:52:34

KPCTabsControl has been migrated to Swift3. No changes of APIs compared to the 2.0 release, written with Swift 2.2. Possible future of Swift2 releases will be placed on the new swift-2.2 branch.

Various bugfixes - 2016-08-01 08:03:10

  • Introduction of a dedicated control cell to fix a problem when clicking outside the last button
  • Changed hard-coded Helvetica fonts to system ones
  • Fixed a method typo (1.6.2)
  • Fixed an issue with autolayout (1.6.1)

Fixed Editing - 2016-05-20 06:01:42

Editing of tab titles wasn't working, and the demo didn't allow to play with it. This is now fixed, and some other details have been improved as well.