Skip to content

MaxHasADHD/TraktKit

Repository files navigation

TraktKit Logo

TraktKit

Swift wrapper for Trakt.tv API.

SPM: Compatible [Platforms: iOS | watchOS | macCatalyst | macOS | tvOS | visionOS] Language: Swift 6.0 License: MIT

Installation

Swift Package Manager

You can use Xcode 11 or later to integrate TraktKit into your project using Swift Package Manager.

To integrate TraktKit into your Xcode project using Swift Package Manager. Select File > Swift Packages > Add Package Dependency....

When prompted, simply search for TraktKit or specify the project's GitHub repository:

https://github.com/MaxHasADHD/TraktKit

Migrating to Version 2.0.0

TraktKit 2.0.0 introduces a modern async/await API while maintaining backwards compatibility through deprecated completion handler methods. All completion handler-based methods are now deprecated and will be removed in version 3.0.0.

For detailed migration instructions and examples, see the Migration Guide.

Key Changes in 2.0.0

  • Swift 6.0 with strict concurrency - Full support for Swift 6 concurrency features
  • Async/await API - All endpoints now support modern async/await syntax
  • Deprecated completion handlers - Legacy completion handler methods are marked as deprecated with migration guidance
  • Resource-based organization - Cleaner, more intuitive API structure
  • Type-safe requests - Improved type safety with chainable route builders

Quick Migration Example

Before (Completion Handlers):

traktManager.getTrendingMovies { result in
    switch result {
    case .success(let movies):
        print("Found \(movies.count) trending movies")
    case .error(let error):
        print("Error: \(error)")
    }
}

After (Async/Await):

let movies = try await traktManager.movies
    .trending()
    .perform()
    .object

print("Found \(movies.count) trending movies")

For more examples and detailed migration steps, see MIGRATION_GUIDE.md.

Usage

See the example project for usage

Author

Maximilian Litteral

License

The MIT License (MIT)

Copyright (c) 2015-2025 Maximilian Litteral

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Swift wrapper for Trakt.tv API.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 10

Languages