https://github.com/steve228uk/sradaptivespaceitem
A Swift NSToolbarItem subclass which creates a space that will center the next toolbar item
https://github.com/steve228uk/sradaptivespaceitem
Last synced: 16 days ago
JSON representation
A Swift NSToolbarItem subclass which creates a space that will center the next toolbar item
- Host: GitHub
- URL: https://github.com/steve228uk/sradaptivespaceitem
- Owner: steve228uk
- License: mit
- Created: 2016-06-21T19:16:19.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-06-21T20:10:55.000Z (almost 9 years ago)
- Last Synced: 2025-03-27T00:21:13.719Z (about 1 month ago)
- Language: Swift
- Size: 73.2 KB
- Stars: 7
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SRAdaptiveSpaceItem
A Swift NSToolbarItem subclass which creates a space that will centre the next toolbar item.> This project is a direct translation of [TAAdaptiveSpaceItem](https://github.com/timothyarmes/TAAdaptiveSpaceItem)
## Usage
1. Add an Image Toolbar Item to your toolbar
2. Set the class of the Image Toolbar Item to `SRAdaptiveSpaceItem`
3. Place the `SRAdaptiveSpaceItem` directly before the item you wish to centreYou only need 1 `SRAdaptiveSpaceItem` per toolbar. Items after the centred item can be positioned using a flexible space with no issues.
## Installation
Either manually copy the `SRAdaptiveSpaceItem.swift` file to your project or install via CocoaPods
````ruby
pod 'SRAdaptiveSpaceItem'
````## Screenshots

