Objectmapper: Type does not conform to protocol Mappable

Created on 10 Dec 2015  路  1Comment  路  Source: tristanhimmelman/ObjectMapper

Hey I'm having issues with ObjectMapper 1.0.1. I can't get my class to conform to the Mappable protocol. Am I missing something?

Running Xcode 7.1.1.

This is the protocol from Mapper.swift

public protocol Mappable {
init?(_ map: Map)
mutating func mapping(map: Map)
}

Here is my implementation.

import Foundation
import ObjectMapper

class MyUser: Mappable
{
private var _userName: String?

required init?(_ map: Map)
{

}

func mapping(map: Map)
{
    _userName <- map["user_name"]
}

}

I also get an error when accessing map.

screen shot 2015-12-10 at 11 12 59 am

Here are my pods.

cocoapods

Most helpful comment

Solved it. I had another class Map causing namespace issues.

>All comments

Solved it. I had another class Map causing namespace issues.

Was this page helpful?
0 / 5 - 0 ratings