GithubHelp home page GithubHelp logo

nelsonnan / eknotifview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from linox/eknotifview

0.0 2.0 0.0 184 KB

A simple, easily customizable, lightweight notification system for iOS Apps

License: Other

eknotifview's Introduction

EKNotifView v0.0.2

A Simple, easily customizable, lightweight notification system for iOS Apps

##Installation

Since EKNotifView is available a Pod you can add it to your project simply by adding the following line to the bottom of your Podfile

There was an issue with updating CocoaPods to version 0.0.2. That's why its not available as a pod yet. I'll fix that later.

pod 'EKNotifView', '~> 0.0.1'

##Usage

To create an EKNotifiView you need to create the notification, give it a view to appear in, a direction to slide in from (up or down), a text style (title or subtitle) a view type (loading,success,failure or info), a title, and tell it to show, here's what the code would look like

    1. EKNotifView *note = [[EKNotifView alloc] initWithNotifViewType:aType notifPosition:aPosition notifTextStyle:aTextStyle andParentView:aView];
    2. [note changeTitleOfLabel:aLabelType to:theTitleString];
    3. [note show];

Ok I know that's alot, I'm woking on v0.0.3 which will feature a much shorter init method and more semantic setter methods. I hope to release it soon but I don't want to give any time frames yet (It shouldn't be long though)

TL;DR of the above if you wait a bit for v0.0.3 then it'll be simpler to use EKNotifView

Note: the line #2 is necessary because by default both the notification title

##View Types (for use in the init method an customization methods)

Type Description
EKNotifViewTypeLoading Loading Style
By default a black with small,white activity indicator on the left and the title on the right

By default doesn't allow tap to dismiss

can only hide by calling [note hide];
EKNotifViewTypeSuccess Success Style
By default a green notification with a white check icon on the left and a title on the right

By default allows tap to dismiss
EKNotifViewTypeFailure Failure Style
By default a red notification with a white "x" icon on the left and a title on the right

By default allows tap to dismiss
EKNotifViewTypeInfo Info Style
By default a black notification with no icon on the left and a title covering the entire width of the notification

By default allows tap to dismiss

##View Positions (for use in the init method)

Type Description
EKNotifViewPositionTop View will slide down from bottom
EKNotifViewPositionBottom View will slide up from the bottom

##Text Styles (for use in the init method)

Type Description
EKNotifViewTextStyleTitle Show only one vertically centered and **bolded** title
EKNotifViewTextStyleSubtitle Show a title on top of the notification, **bolded** and on the bottom show a notification subtitle

##Label Types (for use in the init method an customization methods and changing the initial notification title)

Type Description
EKNotifViewLabelTypeTitle The passed text will be used as the text of the title of notification only
EKNotifViewLabelTypeSubtitle The passed text will be used as the text of the subtitle of notification only
EKNotifViewLabelTypeAll The passed text will be used as the text of both the title and subtitle of the notification

After creating the notification via init we need to specify the text for title of the notification and the subtitle of the notificaiton (if you're using EKNotifViewTextStyleTitle then you don't have to worry about the subtitle)

Here's we'd set the title of the notification

[note changeTitleOfLabelType:EKNotifViewLabelTypeTitle to:@"World successfully destroyed!"];

And here's how we'd set the subtitle of the notification

[note changeTitleOfLabelType:EKNotifViewLabelTypeSubtitle to:@"World successfully destroyed!"];

And to change the text of the title and subtitle to the same thing here's how it would look

[note changeTitleOfLabelType:EKNotifViewLabelTypeAll to:@"World successfully destroyed!"];

##Custmomization ###Change notification background color You customize the background of notification of a certain view type by calling

[note changeBackgroundColorToColor:someColor forViewType:aViewType];

Note: to use an image for the background color use the +imageWithPatternImage: method of UIColor

###Change font of title and subtitle of notificaiton

[note changeFontOfLabel:aLabelType to:aUIFontObject];

Lastly,

Ok I know that's alot, I'm woking on v0.0.3 which will feature a much shorter init method and more semantic setter methods. I hope to release it soon but I don't want to give any time frames yet (It shouldn't be long though)

TL;DR of the above if you wait a bit for v0.0.3 then it'll be simpler to use EKNotifView

#Dat's all folks!

eknotifview's People

Contributors

ekdevdes avatar

Watchers

James Cloos avatar nelson_nan 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.