SpitcastSwift 0.0.10

SpitcastSwift 0.0.10

Daniel Legler 维护。



SpitcastSwift

Version License Platform

使用

所有可用端点都通过 SpitcastAPI 类暴露,使用方式如下

SpitcastAPI.allSpots() { (result) in
  // Handle result
}

有一些方便的结构体(CountiesSpots),其中包含名称和 Spitcast 用于标识特定冲浪点的 SpotId

SpitcastAPI.spotForecast(id: Spots.LosAngeles.ManhattanBeach.id) { (result) in
    result.withValue({ (reports) in
      // Handle surf report information
    })
    result.withError({ (error) in
      // Handle error
    })
}

请查看包含每个可用 API 调用示例的包含测试

安装

SpitcastSwift 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中

pod 'SpitcastSwift'

如果在 iOS 应用中使用,您需要将以下片段添加到您的 Info.plist 文件中,以符合 App Transport Security

<key>NSAppTransportSecurity</key>
<dict>
    <key>NSExceptionDomains</key>
        <dict>
            <key>spitcast.com</key>
            <dict>
            <key>NSIncludesSubdomains</key>
            <true/>
            <key>NSExceptionAllowsInsecureHTTPLoads</key>
            <true/>
        </dict>
    </dict>
</dict>

请注意,`NSExceptionAllowsInsecureHTTPLoads` 必须为 true,因为 Spitcast 不支持 HTTPS。

作者

Daniel Legler

通过使用此库所获取的所有内容和冲浪报道均归 Spitcast 所有。

许可

SpitcastSwift 在MIT许可下可用。更多信息请参阅LICENSE文件。