Giter Club home page Giter Club logo

pvshow-message's Introduction

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.

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.0.0'

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 updated\nYou 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 froma 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.

pvshow-message's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.