Swiftpack.co -  Package - voidstarone/SpareRoomEventRepository
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
voidstarone/SpareRoomEventRepository
Library for getting events
.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: 1 week ago

Release Notes

Make errors public
3 weeks 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