Swiftpack.co - Festivals-App/festivals-api-ios as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Festivals-App.
Festivals-App/festivals-api-ios 0.3.6
The FestivalsAPI client library for iOS and macOS.
⭐️ 0
🕓 3 weeks ago
iOS
.package(url: "https://github.com/Festivals-App/festivals-api-ios.git", from: "0.3.6")



FestivalsAPI client library

A client library that implements the complete FestivalsAPI feature set and makes coding against it super easy.

Figure 1: Architecture Overview Highlighted


DevelopmentUsageInstallationEngage


Development

The FestivalsAPI client library is tightly coupled with the festivals-server which provides the implementation of the FestivalsAPI and is also coupled with the festivals-identity-server which provides means to authenticate and authorize against the FestivalsAPI. To find out more about the architecture and technical information see the ARCHITECTURE document. The general documentation for the Festivals App is in the festivals-documentation repository. The documentation repository contains architecture information, general deployment documentation, templates and other helpful documents.

The client library is the optimal starting point to implement new FestivalsApp behaviour.

Requirements

  • Xcode Version 15.2+
  • jazzy 0.14.4+ for building the documentation
  • bartycrouch 4.15.0+ for string localization

ExampleApp

There is an ExampleApp for developing and testing.

Testing

The unit tests are implemented via the XCTest framework. To run the tests successfully you need to provide a valid address to a testable FestivalsAPI instance in the Info.plist under the FestivalsAPI_URL key. To setup the FestivalsAPI see the festivals-server repository. At the moment the tests are run manually, i want to run the tests automated but i need to decided on the automation/CI which should be used.

Usage

The library consists of the FestivalsClient class, the handler classes and their corresponding objects.

  • Objects: Festival, Event, Artist, Location, ImageRef, Link, Place, Tag
  • Handler: FestivalHandler, EventHandler, ArtistHandler, LocationHandler, ImageRefHandler, LinkHandler, PlaceHandler and TagHandler

To use this library, create an FestivalsClient object by calling the init(baseURL:clientAuth:) function. The client object provides you with a handler for each object type provided by the FestivalsAPI, through which you can fetch, create and delete those objects.

// Create the handler
let clientAuth = IdentityAndTrust(certData:<#certData#><##>, CAData:<#caData#>, certPassword: <#Password#>, apiKey:<#apiKey#>)
let client = FestivalsClient(baseURL: <#baseURL#>, clientAuth: <#IdentityAndTrust#>)

// fetch all festivals
client.festivalHandler.all { (festivals, err) in
    guard let festivals = festivals else {
        print(err)
        return
    }
    // use festivals
}

Installation

The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift compiler. Once you have your Swift package set up, adding FestivalsAPI as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(url: "https://github.com/Festivals-App/festivals-api-ios.git", .upToNextMajor(from: "0.3"))
]

Engage

I welcome every contribution, whether it is a pull request or a fixed typo. The best place to discuss questions and suggestions regarding the FestivalsAPI iOS client library is the projects issues section. More general information and a good starting point if you want to get involved is the festival-documentation repository.

The following channels are available for discussions, feedback, and support requests:

Type Channel
General Discussion
Other Requests

Licensing

Copyright (c) 2020-2024 Simon Gaus. Licensed under the GNU Lesser General Public License v3.0

GitHub

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

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