Swift based simple information view with pointed arrow.

Related tags

UI InfoView
Overview

InfoView

View to show small text information blocks with arrow pointed to another view.In most cases it will be a button that was pressed.

infoview5

Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

Swift3

Swift3 support implemented in this branch.

CocoaPods

InfoView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "InfoView"

Manually

  1. Download and drop /InfoView folder in your project.
  2. Congratulations!

Simple appearance

let infoView = InfoView(text: "Your message here")
infoView.show(onView: view, centerView: button)

where view is view of your visible view controller, centerView is a view where arrow will be pointed to

Delegation

You can set a delegate and get events when view will appear/hide:

infoView.delegate = self

// In your delegate class
func infoViewDidShow(view: InfoView) {
    print("Now visible")
}

Customization

Set arrow position. In this case you will be responsible for possible errors (for example if there are not enough space to show text etc.)

infoView.arrowPosition = .Left

Set animation:

infoView.animation = InfoViewAnimation.None                // Without animation
infoView.animation = InfoViewAnimation.FadeIn              // FadeIn animation
infoView.animation = InfoViewAnimation.FadeInAndScale      // FadeIn and Scale animation

Set custom font:

infoView.font = UIFont(name: "AvenirNextCondensed-Regular", size: 16)

Set custom text color:

infoView.textColor = UIColor.grayColor()

Set custom background color:

infoView.backgroundColor = UIColor.blackColor()

Set custom layer properties:

infoView.layer.shadowColor = UIColor.whiteColor().CGColor
infoView.layer.cornerRadius = 15
infoView.layer.shadowRadius = 5
infoView.layer.shadowOffset = CGPoint(x: 2, y: 2)
infoView.layer.shadowOpacity = 0.5

Hide with a delay

Hide InfoView after delay automatically

infoView.hideAfterDelay = 2

ToDo

  • More animations
  • Support long text messages
  • Support NSAttributedString's for formatted text

Author

Anatoliy Voropay, [email protected]

Contributors

Thank you all!

License

InfoView is available under the MIT license. See the LICENSE file for more info.

You might also like...
Placeholder views based on content, loading, error or empty states
Placeholder views based on content, loading, error or empty states

StatefulViewController A protocol to enable UIViewControllers or UIViews to present placeholder views based on content, loading, error or empty states

Cool Animated music indicator view written in Swift
Cool Animated music indicator view written in Swift

Cool Animated music indicator view written in Swift. ESTMusicIndicator is an implementation of NAKPlaybackIndicatorView in Swift for iOS 8. 本人著作的书籍《La

An easy to use FAQ view for iOS written in Swift
An easy to use FAQ view for iOS written in Swift

FAQView An easy to use FAQ view for iOS written in Swift. This view is a subclass of UIView. Setup with CocoaPods If you are using CocoaPods add this

🔍 Awesome fully customize search view like Pinterest written in Swift 5.0 + Realm support!
🔍 Awesome fully customize search view like Pinterest written in Swift 5.0 + Realm support!

YNSearch + Realm Support Updates See CHANGELOG for details Intoduction 🔍 Awesome search view, written in Swift 5.0, appears search view like Pinteres

A Swift material design UI module which paints over the parent view when the switch is on.
A Swift material design UI module which paints over the parent view when the switch is on.

:octocat: 🎚 RAMPaperSwitch is a Swift material design UI module which paints over the parent view when the switch is turned on. iOS library by @Ramotion

🎨 View instance initializing sugar for Swift & UIKit
🎨 View instance initializing sugar for Swift & UIKit

🎨 View instance initializing sugar for Swift & UIKit

An easy to use FAQ view for iOS written in Swift
An easy to use FAQ view for iOS written in Swift

FAQView An easy to use FAQ view for iOS written in Swift. This view is a subclass of UIView. Setup with CocoaPods If you are using CocoaPods add this

A nice iOS View Capture Swift Library which can capture all content.
A nice iOS View Capture Swift Library which can capture all content.

SwViewCapture A nice iOS View Capture Library which can capture all content. SwViewCapture could convert all content of UIWebView to a UIImage. 一个用起来还

A custom stretchable header view for UIScrollView or any its subclasses with UIActivityIndicatorView and iPhone X safe area support for content reloading. Built for iOS 10 and later.

Arale A custom stretchable header view for UIScrollView or any its subclasses with UIActivityIndicatorView support for reloading your content. Built f

Comments
  • Manual Installation

    Manual Installation

    CocoaPods and Carthage are awesome tools and make our life really easier, but there are some devs who still don't know how to use them.

    It would be cool to add the Manual installation guide in your README.md. You can take a look at my iOS Readme Template to see how you can do it.

    opened by lfarah 0
Owner
Anatoliy Voropay
Swifter :]
Anatoliy Voropay
Elissa displays a notification on top of a UITabBarItem or any UIView anchor view to reveal additional information.

Elissa Attach a local notification to any UIView to reveal additional user guidance. Usage Example Per default, Elissa will try to align to the center

null 169 Aug 14, 2022
Creating a simple selectable tag view in SwiftUI is quite a challenge. here is a simple & elegant example of it.

SwiftUI TagView Creating a simple selectable tag view in SwiftUI is quite a challenge. here is a simple & elegant example of it. Usage: Just copy the

Ahmadreza 16 Dec 28, 2022
A simple Elm-like Store for SwiftUI, based on ObservableObject

ObservableStore A simple Elm-like Store for SwiftUI, based on ObservableObject.

Gordon Brander 28 Nov 8, 2022
A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.

BadgeHub A way to quickly add a notification badge icon to any view. Demo/Example For demo: $ pod try BadgeHub To run the example project, clone the r

Jogendra 772 Dec 28, 2022
Confetti View lets you create a magnificent confetti view in your app

ConfettiView Confetti View lets you create a magnificent confetti view in your app. This was inspired by House Party app's login screen. Written in Sw

Or Ron 234 Nov 22, 2022
Simple and highly customizable iOS tag list view, in Swift.

TagListView Simple and highly customizable iOS tag list view, in Swift. Supports Storyboard, Auto Layout, and @IBDesignable. Usage The most convenient

Ela Workshop 2.5k Jan 5, 2023
🏞 A simple iOS photo and video browser with optional grid view, captions and selections written in Swift5.0

Introduction ?? MediaBrowser can display one or more images or videos by providing either UIImage objects, PHAsset objects, or URLs to library assets,

Kyle Yi 631 Dec 29, 2022
📖 A simple, highly informative page view controller

TL;DR UIPageViewController done properly. ⭐️ Features Simplified data source management & enhanced delegation. Dynamically insert & remove pages. Infi

UI At Six 1.8k Dec 24, 2022
Swift Package for distributing Mozilla's Rust-based application components

Swift Package for Mozilla's Rust Components This repository is a Swift Package for distributing releases of Mozilla's various Rust-based application c

Mozilla 19 Dec 30, 2022
Non-intrusive iOS UI library to implement overlay based interfaces

OverlayContainer is a UI library written in Swift. It makes easier to develop overlay based interfaces, such as the one presented in the Apple Maps, S

Applidium 1k Jan 4, 2023