小编Cod*_*e92的帖子

iOS swift Codable 无法与 Alamofire 一起使用 JSON 嵌套数据?

我对 iOS 中的 Alamofire 和 Codable 概念不熟悉,有人可以告诉我如何使用它来访问我的 json 数据。

这是我的 json 响应。

{"subscriptions": [
        {
            "batch_user_id": 23,
            "batch_name": "demo batch",
            "course_name": "IELTS",
            "start_date": "Nov 01 2019",
            "end_date": "Nov 30 2019",
            "no_of_days": 21,
            "total_no_of_days": 30,
            "extended_date": "Nov 30 2019",
            "extended": false,
            "course_extensions": [
                {
                    "id": 31,
                    "amount": "3500.0",
                    "course_id": 1,
                    "is_active": true,
                    "number_of_days": 5
                },
Run Code Online (Sandbox Code Playgroud)

这是可编码的代码:

 struct course_extensions: Codable {
        let id: String
        let amount: String
        let course_id: String

        private enum CodingKeys: String, CodingKey {
            case id = "id"
            case amount …
Run Code Online (Sandbox Code Playgroud)

ios swift alamofire codable

3
推荐指数
1
解决办法
1452
查看次数

像 Uber iOS 应用程序一样在 Google 地图上移动标记?

我正在尝试开发一个基于 Uber 和 Ola 类似概念的应用程序。为此,我需要将 Google 地图集成到 iOS 上的用户跟踪位置。所以请告诉我如何使用 Google 地图在 iOS 中实现移动标记(汽车)动画。

google-maps ios swift

1
推荐指数
1
解决办法
6383
查看次数

标签 统计

ios ×2

swift ×2

alamofire ×1

codable ×1

google-maps ×1