Latest 1.2.1
Homepage https://github.com/Vaberer/PVShow-Message
License MIT
Platforms ios 8.0, requires ARC
Authors

PVShow Message

Font Awesome Swift

Follow me: @vaberer

I like ★. Do not forget to ★ this super convenient library.

Simple library to show custom messages with a touch event. Fully customizable via properties. If any message is currently showing and you want to show another message, it will wait until a previous message will dismiss.

Works perfectly in portrait, landscape mode and with constraints.

PVShow-Message

Requirements

  • iOS 8.0+
  • Xcode 6.3

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects.

CocoaPods 0.36 adds supports for Swift and embedded frameworks. You can install it with the following command:

$ gem install cocoapods

To integrate PVShow Message into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

pod 'PVShow-Message', '~> 1.2.1'

Then, run the following command:

$ pod install

Do not forget to import to your swift files where you want to use this library:

import PVShow_Message

Manually

  1. Copy PVShowMessage.swift file into your project

Usage

Show Message

    PVShowMessage.instance.showMessage(text: "All data has been updatednYou have fresh data")

Customize your message view via these properties

        PVShowMessage.cBackgroundColor = UIColor.blackColor()
        PVShowMessage.cBorderColor = UIColor.lightGrayColor()
        PVShowMessage.cBorderWidth = 3
        PVShowMessage.cCornerRadius = 0
        PVShowMessage.cFontName = "HelveticeNeue-Light"
        PVShowMessage.cFontSize = 40
        PVShowMessage.cTextColor = UIColor.lightTextColor()
        PVShowMessage.cPositionFromEdge = 200
        PVShowMessage.cExtraShowTimeForMessage = 3
        PVShowMessage.cInitialPosition = .Top
        PVShowMessage.cAnimationDuration = 1.5

Touch event via Delegation

You can attach any identifier to the message view and it will be returned to you via a delegate method

    PVShowMessage.instance.showMessage(text: "My Text", identifier: 10)

Tell a message view who is delegate in a viewWillAppear method

override func viewWillAppear(animated: Bool) {
        super.viewWillAppear(animated)

        PVShowMessage.instance.delegate = self
    }

Implement PVShowMessageDelegate

    func didTapToMessage(identifier: AnyObject?) {

        println("Tapped to a message with identifier: (identifier)")
    }

Removing messages from a queue

All messages which are going to be shown will be removed from a queue

    PVShowMessage.instance.removeAllMessages()

Author

Patrik Vaberer, [email protected]
LinkedIn
Blog

Licence

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

Latest podspec

{
    "name": "PVShow-Message",
    "version": "1.2.1",
    "license": "MIT",
    "summary": "Simple library to show custom message with a touch event",
    "homepage": "https://github.com/Vaberer/PVShow-Message",
    "screenshots": "https://raw.githubusercontent.com/Vaberer/PVShow-Message/master/resources/pvshow_message.gif",
    "social_media_url": "http://twitter.com/vaberer",
    "authors": {
        "Patrik Vaberer": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Vaberer/PVShow-Message.git",
        "tag": "1.2.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "Source/PVShowMessage.swift",
    "requires_arc": true,
    "pushed_with_swift_version": "4.0"
}

Pin It on Pinterest

Share This