Skip to content

Commit

Permalink
Fix: Swift Package Name typo fix
Browse files Browse the repository at this point in the history
- Update README
- Remove local podspec (meant to push to trunk)
  • Loading branch information
Chris Jennewein committed Jul 4, 2020
1 parent b59fca2 commit 6dc6a6d
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 67 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Refactored network and web service architecture

Reorganized project files

Supports Swift Package Manager

## 5.0.0
Updated for Swift 5

Expand Down
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
import PackageDescription

let package = Package(
name: "PokemomAPI",
name: "PokemonAPI",
platforms: [
.macOS(.v10_11),
.iOS(.v11),
.watchOS(.v2),
.tvOS(.v9),
],
products: [
.library(name: "PokemomAPI",
.library(name: "PokemonAPI",
targets: ["PokemonAPI"]),
],
targets: [
Expand Down
44 changes: 0 additions & 44 deletions PokemonAPI/6.0.0/PokemonAPI.podspec

This file was deleted.

63 changes: 42 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# PokemonAPI

[![Build Status](https://travis-ci.org/kinkofer/PokemonAPI.svg?branch=master)](https://travis-ci.org/kinkofer/PokemonAPI)
[![Version](https://img.shields.io/cocoapods/v/PokemonAPI.svg?style=flat)](http://cocoapods.org/pods/PokemonAPI)
[![License](https://img.shields.io/cocoapods/l/PokemonAPI.svg?style=flat)](http://cocoapods.org/pods/PokemonAPI)
[![Platform](https://img.shields.io/cocoapods/p/PokemonAPI.svg?style=flat)](http://cocoapods.org/pods/PokemonAPI)
[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)
[![Version](https://img.shields.io/cocoapods/v/PokemonAPI.svg?style=flat)](http://cocoapods.org/pods/PokemonAPI)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

## What is this?
Expand Down Expand Up @@ -37,6 +38,30 @@ Fetching lists will return a `PagedObject<T>` containing a page of results, plus
Web service functions for lists take a `PaginationState` enum parameter. There are two cases for this enum, `.initial(pageLimit: Int)` for the first call, and `.continuing(PKMPagedObject<T>, PaginationRelationship)` for subsequent calls. Each function sets a default value of `.initial(pageLimit: 20)`, but you can pass your own page limit. After the first call, you use `.continuing()` with the PagedObject from the last response, and a `PaginationRelationship` for navigation (`.next`, `.previous`, `.first`, `.last`, or a specific `.page(Int)`).


### Network Calls

Allow your app to make calls to PokéAPI (pokeapi.co) by making an App Transport Security domain exception.

In your Info.plist, add
```plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>pokeapi.co</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.2</string>
</dict>
</dict>
</dict>
```


## Examples

```swift
Expand All @@ -52,7 +77,7 @@ PokemonAPI().berryService.fetchBerry(1) { result in
}
}

// Same example using Combine
// Same example using Combine. Don't forget to store your cancellable.
let cancellable = PokemonAPI().berryService.fetchBerry(1)
.sink(receiveCompletion: { completion in
if case .failure(let error) = completion {
Expand Down Expand Up @@ -128,38 +153,34 @@ PokemonAPI().utilityService.fetchLanguageList(paginationState: .initial(pageLimi

## Installation

### Swift Package Manager

Search for this repository URL in Xcode:

File->Swift Packages->Add Package Dependency...

```
https://github.com/kinkofer/PokemonAPI
```

### Cocoapods

PokemonAPI is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'PokemonAPI'
```


### Carthage

If you're using Carthage you can add PokemonAPI by adding it to your Cartfile:

```ruby
github "kinkofer/PokemonAPI" ~> 6.0.0
```

In your Info.plist, add
```plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>pokeapi.co</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.2</string>
</dict>
</dict>
</dict>
```

## Author

Christopher Jennewein, kinkofer@gmail.com
Expand Down

0 comments on commit 6dc6a6d

Please sign in to comment.