Proper usage of the Alamofire's URLRequestConvertible

前端 未结 6 903
鱼传尺愫
鱼传尺愫 2020-12-07 07:58

I\'ve read couple tutorials, README from @mattt but can\'t figure out couple things.

  1. What is the proper usage of URLRequestConvertible in real

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-07 08:13

    instead of case UpdateUser(username: String, firstName: String, lastName: String, email: String)

    you'd make

    struct UserAttributes
    {
        let username: String
         ....
    }
    

    and feed THAT model object as a parameter instead of a cluster of unnamed unreadable strings

    case UpdateUser(parameters: UserAttributes)

提交回复
热议问题