SwiftBomb

open class SwiftBomb

A singleton from which SwiftBomb does it’s setup. Ensure to configure the framework on app startup by calling configure(_:) before attempting to make any requests.

  • Client apps must call this method and pass in an instance of SwiftBombConfig. Typically happens in the application delegate.

    Declaration

    Swift

    open static func configure(_ configuration: SwiftBombConfig)
  • Fetches a paginated list of AccessoryResource instances. This list can be filtered to a search term, paginated and sorted.

    Declaration

    Swift

    public static func fetchAccessories(_ query: String? = nil, pagination: PaginationDefinition? = nil, sort: SortDefinition? = nil, fields: [String]? = nil, completion: @escaping (PaginatedResults<AccessoryResource>?, _ error: SwiftBombRequestError?) -> Void)

    Parameters

    query

    An optional search term used to filter for a particular accessory.

    pagination

    An optional PaginationDefinition to define the limit and offset when paginating results.

    sort

    An optional SortDefinition to define how the results should be sorted.

    fields

    An optional array of fields to return in the response. See the available options at http://www.giantbomb.com/api/documentation#toc-0-2. Pass nil to return everything.

    completion

    A closure returning an optional generic PaginatedResults object containing the returned AccessoryResource objects and pagination information and also, an optional SwiftBombRequestError object if the request failed.

  • Fetches a paginated list of CharacterResource instances. This list can be filtered to a search term, paginated and sorted.

    Declaration

    Swift

    public static func fetchCharacters(_ name: String? = nil, pagination: PaginationDefinition?, sort: SortDefinition?, fields: [String]? = nil, completion: @escaping (PaginatedResults<CharacterResource>?, _ error: SwiftBombRequestError?) -> Void)

    Parameters

    query

    An optional search term used to filter for a particular character.

    pagination

    An optional PaginationDefinition to define the limit and offset when paginating results.

    sort

    An optional SortDefinition to define how the results should be sorted.

    fields

    An optional array of fields to return in the response. See the available options at http://www.giantbomb.com/api/documentation#toc-0-4. Pass nil to return everything.

    completion

    A closure returning an optional generic PaginatedResults object containing the returned CharacterResource objects and pagination information and also, an optional SwiftBombRequestError object if the request failed.

  • Fetches an instance of ComingUpSchedule containing a number of ComingUpScheduleItem instances. These are essentially the items which appear in the Coming up on Giant Bomb panel on the Giant Bomb homepage.

    Declaration

    Swift

    public static func fetchComingUpSchedule(completion: @escaping (_ schedule: ComingUpSchedule?, _ error: SwiftBombRequestError?) -> Void)

    Parameters

    completion

    A closure returning an instance of ComingUpSchedule where currently-live and scheduled posts, streams and videos on Giant Bomb can be found. Also, an optional SwiftBombRequestError may be returned describing any errors which occurred during the request.

  • Fetches a paginated list of CompanyResource instances. This list can be filtered to a search term, paginated and sorted.

    Declaration

    Swift

    public static func fetchCompanies(_ query: String? = nil, pagination: PaginationDefinition? = nil, sort: SortDefinition? = nil, fields: [String]? = nil, completion: @escaping (PaginatedResults<CompanyResource>?, _ error: SwiftBombRequestError?) -> Void)

    Parameters

    query

    An optional search term used to filter for a particular company.

    pagination

    An optional PaginationDefinition to define the limit and offset when paginating results.

    sort

    An optional SortDefinition to define how the results should be sorted.

    fields

    An optional array of fields to return in the response. See the available options at http://www.giantbomb.com/api/documentation#toc-0-8. Pass nil to return everything.

    completion

    A closure returning an optional generic PaginatedResults object containing the returned CompanyResource objects and pagination information and also, an optional SwiftBombRequestError object if the request failed.

  • Fetches a paginated list of ConceptResource instances. This list can be filtered to a search term, paginated and sorted.

    Declaration

    Swift

    public static func fetchConcepts(_ query: String? = nil, pagination: PaginationDefinition? = nil, sort: SortDefinition? = nil, fields: [String]? = nil, completion: @escaping (PaginatedResults<ConceptResource>?, _ error: SwiftBombRequestError?) -> Void)

    Parameters

    query

    An optional search term used to filter for a particular concept.

    pagination

    An optional PaginationDefinition to define the limit and offset when paginating results.

    sort

    An optional SortDefinition to define how the results should be sorted.

    fields

    An optional array of fields to return in the response. See the available options at http://www.giantbomb.com/api/documentation#toc-0-10. Pass nil to return everything.

    completion

    A closure returning an optional generic PaginatedResults object containing the returned ConceptResource objects and pagination information and also, an optional SwiftBombRequestError object if the request failed.

  • Fetches a paginated list of FranchiseResource instances. This list can be filtered to a search term, paginated and sorted.

    Declaration

    Swift

    public static func fetchFranchises(_ query: String? = nil, pagination: PaginationDefinition? = nil, sort: SortDefinition? = nil, fields: [String]? = nil, completion: @escaping (PaginatedResults<FranchiseResource>?, _ error: SwiftBombRequestError?) -> Void)

    Parameters

    query

    An optional search term used to filter for a particular franchise.

    pagination

    An optional PaginationDefinition to define the limit and offset when paginating results.

    sort

    An optional SortDefinition to define how the results should be sorted.

    fields

    An optional array of fields to return in the response. See the available options at http://www.giantbomb.com/api/documentation#toc-0-12. Pass nil to return everything.

    completion

    A closure returning an optional generic PaginatedResults object containing the returned FranchiseResource objects and pagination information and also, an optional SwiftBombRequestError object if the request failed.

  • Fetches a paginated list of GameReleaseResource instances. This list can be filtered to a search term, paginated and sorted.

    Declaration

    Swift

    public static func fetchReleases(_ query: String? = nil, pagination: PaginationDefinition? = nil, sort: SortDefinition? = nil, fields: [String]? = nil, completion: @escaping (PaginatedResults<GameReleaseResource>?, _ error: SwiftBombRequestError?) -> Void)

    Parameters

    query

    An optional search term used to filter for a particular game release.

    pagination

    An optional PaginationDefinition to define the limit and offset when paginating results.

    sort

    An optional SortDefinition to define how the results should be sorted.

    fields

    An optional array of fields to return in the response. See the available options at http://www.giantbomb.com/api/documentation#toc-0-34. Pass nil to return everything.

    completion

    A closure returning an optional generic PaginatedResults object containing the returned GameReleaseResource objects and pagination information and also, an optional SwiftBombRequestError object if the request failed.

  • Fetches a paginated list of GameResource instances. This list can be filtered to a search term, paginated and sorted.

    Declaration

    Swift

    public static func fetchGames(_ query: String? = nil, pagination: PaginationDefinition? = nil, sort: SortDefinition? = nil, fields: [String]? = nil, completion: @escaping (PaginatedResults<GameResource>?, _ error: SwiftBombRequestError?) -> Void)

    Parameters

    query

    An optional search term used to filter for a particular game.

    pagination

    An optional PaginationDefinition to define the limit and offset when paginating results.

    sort

    An optional SortDefinition to define how the results should be sorted.

    fields

    An optional array of fields to return in the response. See the available options at http://www.giantbomb.com/api/documentation#toc-0-14. Pass nil to return everything.

    completion

    A closure returning an optional generic PaginatedResults object containing the returned GameResource objects and pagination information and also, an optional SwiftBombRequestError object if the request failed.

  • Fetches a paginated list of GenreResource instances. This list can be filtered to a search term, paginated and sorted.

    Declaration

    Swift

    public static func fetchGenres(_ query: String? = nil, pagination: PaginationDefinition? = nil, sort: SortDefinition? = nil, fields: [String]? = nil, completion: @escaping (PaginatedResults<GenreResource>?, _ error: SwiftBombRequestError?) -> Void)

    Parameters

    query

    An optional search term used to filter for a particular genre.

    pagination

    An optional PaginationDefinition to define the limit and offset when paginating results.

    sort

    An optional SortDefinition to define how the results should be sorted.

    fields

    An optional array of fields to return in the response. See the available options at http://www.giantbomb.com/api/documentation#toc-0-18. Pass nil to return everything.

    completion

    A closure returning an optional generic PaginatedResults object containing the returned GenreResource objects and pagination information and also, an optional SwiftBombRequestError object if the request failed.

  • Fetches a paginated list of LocationResource instances. This list can be filtered to a search term, paginated and sorted.

    Declaration

    Swift

    public static func fetchLocations(_ query: String? = nil, pagination: PaginationDefinition? = nil, sort: SortDefinition? = nil, fields: [String]? = nil, completion: @escaping (PaginatedResults<LocationResource>?, _ error: SwiftBombRequestError?) -> Void)

    Parameters

    query

    An optional search term used to filter for a particular location.

    pagination

    An optional PaginationDefinition to define the limit and offset when paginating results.

    sort

    An optional SortDefinition to define how the results should be sorted.

    fields

    An optional array of fields to return in the response. See the available options at http://www.giantbomb.com/api/documentation#toc-0-20. Pass nil to return everything.

    completion

    A closure returning an optional generic PaginatedResults object containing the returned LocationResource objects and pagination information and also, an optional SwiftBombRequestError object if the request failed.

  • Fetches a paginated list of ObjectResource instances. This list can be filtered to a search term, paginated and sorted.

    Declaration

    Swift

    public static func fetchObjects(_ query: String? = nil, pagination: PaginationDefinition? = nil, sort: SortDefinition? = nil, fields: [String]? = nil, completion: @escaping (PaginatedResults<ObjectResource>?, _ error: SwiftBombRequestError?) -> Void)

    Parameters

    query

    An optional search term used to filter for a particular object.

    pagination

    An optional PaginationDefinition to define the limit and offset when paginating results.

    sort

    An optional SortDefinition to define how the results should be sorted.

    fields

    An optional array of fields to return in the response. See the available options at http://www.giantbomb.com/api/documentation#toc-0-22. Pass nil to return everything.

    completion

    A closure returning an optional generic PaginatedResults object containing the returned ObjectResource objects and pagination information and also, an optional SwiftBombRequestError object if the request failed.

  • Fetches a paginated list of PersonResource instances. This list can be filtered to a search term, paginated and sorted.

    Declaration

    Swift

    public static func fetchPeople(_ query: String? = nil, pagination: PaginationDefinition? = nil, sort: SortDefinition? = nil, fields: [String]? = nil, completion: @escaping (PaginatedResults<PersonResource>?, _ error: SwiftBombRequestError?) -> Void)

    Parameters

    query

    An optional search term used to filter for a particular person.

    pagination

    An optional PaginationDefinition to define the limit and offset when paginating results.

    sort

    An optional SortDefinition to define how the results should be sorted.

    fields

    An optional array of fields to return in the response. See the available options at http://www.giantbomb.com/api/documentation#toc-0-24. Pass nil to return everything.

    completion

    A closure returning an optional generic PaginatedResults object containing the returned PersonResource objects and pagination information and also, an optional SwiftBombRequestError object if the request failed.

  • Fetches a paginated list of PlatformResource instances. This list can be filtered to a search term, paginated and sorted.

    Declaration

    Swift

    public static func fetchPlatforms(_ query: String? = nil, pagination: PaginationDefinition? = nil, sort: SortDefinition? = nil, fields: [String]? = nil, completion: @escaping (PaginatedResults<PlatformResource>?, _ error: SwiftBombRequestError?) -> Void)

    Parameters

    query

    An optional search term used to filter for a particular platform.

    pagination

    An optional PaginationDefinition to define the limit and offset when paginating results.

    sort

    An optional SortDefinition to define how the results should be sorted.

    fields

    An optional array of fields to return in the response. See the available options at http://www.giantbomb.com/api/documentation#toc-0-26. Pass nil to return everything.

    completion

    A closure returning an optional generic PaginatedResults object containing the returned PlatformResource objects and pagination information and also, an optional SwiftBombRequestError object if the request failed.

  • Performs a generic search on the Giant Bomb API.

    Note that this call can take quite a long time so specifying as few resource types as possible is in the best interest of your app’s performance. Additionally, the pagination definition used limits how many resources will be returned for each resource type and not the amount of resources in total across all types.

    Declaration

    Swift

    public static func performSearch(_ query: String? = nil, resourceTypes: [ResourceType]? = nil, pagination: PaginationDefinition? = nil, sort: SortDefinition? = nil, completion: @escaping (_ searchResults: SearchResults?, _ error: SwiftBombRequestError?) -> Void)

    Parameters

    query

    A string for which to search upon.

    resourceTypes

    An optional array of ResourceTypes for which you would like to search. The fewer, the faster.

    pagination

    An optional definition of how to offset and limit the search results.

    sort

    An optional definition of how to sort the resources

    completion

    A closure which contains an instance of SearchResults where the results can be found and, optionally, a SwiftBombRequestError if the operation failed.

  • Fetches a paginated list of VideoResource instances. This list can be filtered to a search term, paginated and sorted.

    Declaration

    Swift

    public static func fetchVideos(_ query: String?, pagination: PaginationDefinition?, sort: SortDefinition?, fields: [String]? = nil, completion: @escaping (PaginatedResults<VideoResource>?, _ error: SwiftBombRequestError?) -> Void)

    Parameters

    query

    An optional search term used to filter for a particular video.

    pagination

    An optional PaginationDefinition to define the limit and offset when paginating results.

    sort

    An optional SortDefinition to define how the results should be sorted.

    fields

    An optional array of fields to return in the response. See the available options at http://www.giantbomb.com/api/documentation#toc-0-44. Pass nil to return everything.

    completion

    A closure returning an optional generic PaginatedResults object containing the returned VideoResource objects and pagination information and also, an optional SwiftBombRequestError object if the request failed.