Latest 1.0.1
Homepage https://github.com/iosphere/ISHHoverBar
License MIT
Platforms ios 8.0
Frameworks UIKit
Authors

ISHHoverBar ISHHoverBar

Travis Build Status 
Version 
Carthage compatible

A floating UIToolBar replacement as seen in the iOS 10 Maps app, supporting both vertical and horizontal orientation.

It is designed to hover above your content and it plays nicely with auto layout. Combine
it with ISHPullUp to create a UI resembling the
iOS 10 Maps app.

ISHHoverBarOrientationVertical ISHHoverBarOrientationHorizontal
Screenshot showing a ISHHoverBar in vertical orientation Screenshot showing a ISHHoverBar in horizontal orientation

The content of the bar is set using UIBarButtonItems, just as you would configure a UIToolBar.
The bar is backed by a UIVisualEffectsView allowing you to choose from several styles.
You can customize most aspects of the view via Interface Builder.

Basic usage

Setting the bar’s contents

ISHHoverBar is populated similarly to a UIToolbar using instances of
UIBarButtonItem. The content can be changed at any time by setting the items property.
The layout and intrinsicContentSize will automatically be updated.

A few limitation apply: ISHHoverBar only supports instances of UIBarButtonItem that
have a title, image, or customView (subclass of UIControl). Most importantly,
UIBarButtonItem instances created using a UIBarButtonSystemItem are not supported as
access to the underlying content is restricted to private APIs.

Appearance and orientation

ISHHoverBar supports vertical and horizontal layouts. The orientation can be changed
at any time by setting the orientation property (default is vertical). Use auto layout
to position the bar in your view hierarchy.

The following aspects of ISHHoverBar can be changed via code or Interface Builder:

  • Shadow:
    • shadowColor
    • shadowOpacity
    • shadowRadius
  • Corner radius: cornerRadius
  • Border (also applied to separators between items):
    • borderWidth
    • borderColor
  • Background visual effect: effect

General info

ISHHoverBar is written in Objective-C to allow easy integration into any iOS project
and has fully documented headers. It is annotated for easy integration into
Swift code bases.

The ISHHoverBar class and sample app have a Deployment Target of iOS 8.

Integration into your project

Dynamically-linked framework

Add the project file ISHHoverBar.xcodeproj as a subproject of your app.
Then add the framework ISHHoverBar.framework to the app’s embedded binaries
(on the General tab of your app target’s settings). On the Build Phases tab,
verify that the framework has also been added to the Link Binary with
Libraries
phase, and that an Embed Frameworks phase has been created (unless
it existed before).

The framework can be used as a module, so you can use @import ISHHoverBar;
(Objective-C) and import ISHHoverBar (Swift) to import all public headers.

Further reading on Modules:
Clang Documentation

Include files directly

Currently the project relies on a single implementation file and its header.
You can include them directly into your project:

  • ISHHoverBar/ISHHoverBar.{h/m}

CocoaPods

You can use CocoaPods to install ISHHoverBar as a static library. Add this
to your Podfile:

target 'MyApp' do
  pod 'ISHHoverBar'
end

ISHHoverBar can also be installed as a framework:

target 'MyApp' do
  use_frameworks!
  pod 'ISHHoverBar'
end

See the official website to get started with
CocoaPods.

Carthage

Since ISHHoverBar can be built as a framework, it supports Carthage, too. Add
this to your Cartfile:

github iosphere/ISHHoverBar

See the Carthage repository to get started
with Carthage.

More OpenSource projects by iosphere

ISHHoverBar ISHPermissionKit – A polite and unified way of asking for permission on iOS

ISHHoverBar ISHPullUp – Vertical split view controller with pull up gesture as seen in the iOS 10 Maps app

TODO

  • [ ] Allow changing the orientation with an animation
  • [ ] Allow changing the items with an animation

Latest podspec

{
    "name": "ISHHoverBar",
    "version": "1.0.1",
    "summary": "A vertical or horizontal toolbar that is designed to hover (float) over your content as seen in the iOS 10 Maps app",
    "description": "A floating UIToolBar replacement supporting vertical and horizontal orientation. It is designed to hover over your content and plays nicely with auto layout.nnThe content of the bar is set using UIBarButtonItems just as you would configure a UIToolBar. The bar is backed by a UIVisualEffectsView allowing you to select from several styles. You can customize most aspects of the view via Interface Builder.",
    "homepage": "https://github.com/iosphere/ISHHoverBar",
    "screenshots": "https://github.com/iosphere/ISHHoverBar/raw/master/screenshot_vertical.png",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Felix Lamouroux": "[email protected]"
    },
    "source": {
        "git": "https://github.com/iosphere/ISHHoverBar.git",
        "tag": "1.0.1"
    },
    "social_media_url": "https://twitter.com/iosphere",
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "ISHHoverBar/*.{h,m}",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This