Swiftpack.co - voidstarone/SpareRoomEventRepository as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by voidstarone.
voidstarone/SpareRoomEventRepository v0.4.0
Library for getting events
⭐️ 0
🕓 3 years ago
iOS macOS
.package(url: "https://github.com/voidstarone/SpareRoomEventRepository.git", from: "v0.4.0")

SpeedRoommatingEventRepository

A library for getting SpeedRoommatingEvents without worrying about it.

Get all events: unordered, unfiltered

let ep = SpeedRoommatingEventRepo.default
ep.listAllEvents {
    result in

    switch result {
    case .failure:
        break
    case let .success(events):
        // Do things with events
    }
}

Get all events: ordered

let ep = SpeedRoommatingEventRepo.default
ep.listAllEventsOrderedByStartTimeAscending {
    result in
    
    switch result {
    case .failure:
        break
    case let .success(events):
        // Do things with sorted events
    }
}

Get ordered events on or after specified date

let ep = SpeedRoommatingEventRepo.default
ep.listAllEventsOnOrAfter(date: Date()) {
    result in
    switch result {
    case .failure:
        break;
    case let .success(filteredEvents):
       // Do things with events you might actually be able to go to
    }
}

It is possible to use a different event source - see tests

GitHub

link
Stars: 0
Last commit: 3 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Make errors public
3 years ago

Improve client's ability to handle errors by allowing them to access those provided by the repo

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