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.0.0
East UserNotifications
⭐️ 2
🕓 1 week ago
iOS
.package(url: "https://github.com/tsleedev/TSUserNotifications.git", from: "1.0.0")

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

TSUserNotifications is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'TSUserNotifications'

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,
                                         miniute: 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: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

0.1.0
1 year ago

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