Swiftpack.co - tsleedev/TSUserNotifications as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by tsleedev.
tsleedev/TSUserNotifications 1.1.1
East UserNotifications
⭐️ 2
🕓 22 weeks ago
iOS
.package(url: "https://github.com/tsleedev/TSUserNotifications.git", from: "1.1.1")

TSUserNotifications

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

Swift Package Manager

To use TSAdView with the Swift Package Manager, add the following to your Package.swift file.

.package(url: "https://github.com/tsleedev/TSUserNotifications.git", .upToNextMajor(from: "1.0.1"))

Usage

Specific date

TSUserNotificationCenter.set(identifier: "test",
                             date: Date(),
                             repeatType: .none,
                             title: "test",
                             subtitle: nil,
                             body: "It's test.",
                             badge: nil,
                             sound: nil,
                             userInfo: nil,
                             threadIdentifier: nil)

Weekly repeat

TSUserNotificationCenter.setDayOfTheWeek(identifier: "WEEK",
                                         hour: 14,
                                         minute: 30,
                                         dayOfTheWeeks: [.sunday, .monday, .tuesday, .wednesday, .thursday, .friday, .saturday],
                                         title: "weekly repeat test",
                                         subtitle: nil,
                                         body: "It's weekly repeat test.",
                                         badge: nil,
                                         sound: nil,
                                         userInfo: nil,
                                         threadIdentifier: nil)

Automatic calculation

let userNotifications = [
    TSUserNotification(identifier: "task1",
                       date: "2020-01-01".date!,
                       repeatType: .none,
                       title: "2020-01-01 none"),
    TSUserNotification(identifier: "task2",
                       date: "2025-12-24".date!,
                       repeatType: .none,
                       title: "2025-12-24 none"),
    TSUserNotification(identifier: "task3",
                       date: "2021-01-01".date!,
                       repeatType: .day,
                       title: "2021-01-01 day"),
    TSUserNotification(identifier: "task4",
                       date: "2021-01-01".date!,
                       repeatType: .week,
                       title: "2020-01-01(Fri) week")
    ]
    
TSUserNotificationCenter.removeContain(identifier: Identifier.task)
TSUserNotificationCenter.set(notifications: userNotifications, max: 10)

If today is June 29,

Author

taesu, [email protected]

License

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

GitHub

link
Stars: 2
Last commit: 22 weeks ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

0.1.0
2 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics