当我在代码中使用ObjectMapper时,出现“变异运算符的左侧具有不可变类型”的问题

时间:2019-03-27 09:00:02

标签: ios swift swift4.2

我该如何解决? 我只是将我的应用程序转换为使用Swift 3.0的Swift 4.2。 我使用的是ObjectMapper(3.4.2)。

class Discuess<author:PostAuthor,reply_to:Reply_To>: Mappable {

     var author: PostAuthor? = nil
     var reply_to: Reply_To? = nil
      required init?(map: Map) {

}
func mapping(map: Map) {
    author <- map["author"] //Left side of mutating operator has immutable type 'author.Type'
    reply_to <- map["reply_to"] //Left side of mutating operator has immutable type 'reply_to.Type'
     }    
}

0 个答案:

没有答案