Latest 0.4.0
Homepage https://github.com/dhirajjadhao/Newly
License MIT
Platforms ios 9.0, requires ARC
Frameworks UIKit
Authors

newly 2

CocoaPods Compatible
Platform
Swift 3 compatible
License: MIT

Newly is a drop in solution to add Twitter/Facebook/Linkedin style, new updates/tweets/posts available button. It can be used to notify user about new content availability and can other actions can be triggers using its delegate method.

Android version of Newly – Contributed by Sourabh Karkal

Requirements

  • iOS 9.0+
  • Xcode 8.0+
  • Swift 3.0+

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1.0+ is required to build Newly.

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

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

target '<Your Target Name>' do
    pod 'Newly'
end

Then, run the following command:

$ pod install

Usage

Showing Newly

import Newly

let newly = Newly()

newly.showUpdate(message: "↑ New Tweets")

ezgif com-resize
ezgif com-resize-2

Hiding Newly

Use this if you want to manually hide Newly. By default Newly will hide on touch.

newly.hideUpdate()

On Click Updates

You can use Newly delegate to get its on click update.

You can set delegate in your ViewDidLoad method.

newly.delegate = self

And then add extension for NewlyDelegate

extension ViewController:NewlyDelegate{

    func newlyDidTapped() {

        // Your custom code to trigger other actions once Newly is touched.
    }
}

Appearance Customization

You can customize appearance of Newly using following properties.

newly.backgroundColor = UIColor(colorLiteralRed: 0, green: 153.0/255.0, blue: 229.0/255.0, alpha: 1.0)

This will set the background colour for Newly.

newly.textColor = UIColor.white

This will set the text colour for Newly.

newly.heightOffset = 78.0

This will set the height from top of the screen at which Newly will be displayed.

newly.animationInterval = 1.0

This is will the animation time interval to show and hide Newly.

newly.hideOnTouch = true

Whether Newly should auto hide on touch.

newly.isUpdateVisible = false

Whether Newly is currenly visible.

Latest podspec

{
    "name": "Newly",
    "platforms": {
        "ios": "9.0"
    },
    "pod_target_xcconfig": {
        "SWIFT_VERSION": "4.0"
    },
    "summary": "Newly is a drop in solution to add new updates/posts/tweets available button like Twitter/Facebook/Linkedin to your app.",
    "requires_arc": true,
    "version": "0.4.0",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Dhiraj Jadhao": "[[email protected]"
    },
    "homepage": "https://github.com/dhirajjadhao/Newly",
    "source": {
        "git": "https://github.com/dhirajjadhao/Newly.git",
        "tag": "0.4.0"
    },
    "frameworks": "UIKit",
    "source_files": "Newly/**/*.{swift}"
}

Pin It on Pinterest

Share This