Skip to content

Commit

Permalink
updated example and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Daltron committed Jun 8, 2017
1 parent e2f3754 commit 8705b52
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Example/NotificationBanner/ExampleViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extension ExampleViewController: ExampleViewDelegate {
switch index {
case 0:
// Basic Success Notification
let banner = NotificationBanner(title: "Basic Success",
let banner = NotificationBanner(title: "Basic Success Notification",
subtitle: "Extremely Customizable!",
style: .success)
banner.onTap = {
Expand Down
29 changes: 18 additions & 11 deletions Example/Pods/MarqueeLabel/Sources/Swift/MarqueeLabel.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion NotificationBanner/Classes/NotificationBanner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class NotificationBanner: BaseNotificationBanner {
contentView.addSubview(labelsView)

titleLabel = MarqueeLabel()
titleLabel!.type = .leftRight
titleLabel!.type = .left
titleLabel!.font = UIFont.systemFont(ofSize: 17.5, weight: UIFontWeightBold)
titleLabel!.textColor = .white
titleLabel!.text = title
Expand Down
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ NotificationBanner is an extremely customizable and lightweight library that mak
- Custom `UIView` support ✅
- Custom colors support ✅
- Scrolling label support for banners with long titles/subtitles ✅
- Haptic feeback support ✅
- Built in banner queue ✅

## Requirements
Expand All @@ -45,7 +46,7 @@ pod 'NotificationBannerSwift'
To use NotificationBanner via Carthage simply add this line to your `Cartfile`:

```swift
github "Daltron/NotificationBanner" ~> 1.1
github "Daltron/NotificationBanner" ~> 1.3
```

Then add `NotificationBanner.framework` and the dependencies `SnapKit.framework` and `MarqueeLabelSwift.framework` in your project.
Expand All @@ -66,12 +67,24 @@ let banner = StatusBarNotificationBanner(title: title, style: .success)
banner.show()
```

By default, each banner will be displayed on the main application window. If you are wanting to show a banner below a navigation bar, simply show on the view controller that is within the navigation system:

```swift
banner.show(on: viewController)
```

By default, each banner will automatically dismiss after 5 seconds. To dismiss programatically, simply:

```swift
banner.dismiss()
```

To show a banner infinitely until it is manually dismissed, simply:

```swift
banner.autoDimiss = false
```

NotificationBanner has five prebuilt styles that you can choose from:

```swift
Expand Down

0 comments on commit 8705b52

Please sign in to comment.