xivapi-swift

0.2.0

simple swift client to easily work with xivapi
Eisenhuth/xivapi-swift

What's New

v0.2.0

2023-12-18T17:11:42Z

Full Changelog: v0.1.0...v0.2.0

xivapi-swift

a simple swift client to easily work with xivapi

Installation

Swift Package Manager

  1. Xcode -> File -> Add Package Dependency
  2. paste this repository url: https://github.com/Eisenhuth/xivapi-swift.git
  3. Add Package

Usage

import Foundation
import xivapi_swift

//create the client, either with or without a key
let xivapi = xivapiClient()
let xivapiWithKey = xivapiClient(private_key: "my-api-key")

let tincture = await xivapi.getItem(itemId: 39727)
let tinctureRecipe = tincture?.Recipes?.first
let recipe = await xivapi.getRecipe(id: tinctureRecipe!.ID!)

let ingredients = recipe?.ingredients
let ingredientIds = recipe?.ingredientIds

for id in ingredientIds! {
    let response = await xivapi.getItemName(itemId: id)
    let name = response?.Name
    print(name!)
}

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sat Dec 21 2024 07:20:01 GMT-1000 (Hawaii-Aleutian Standard Time)