Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Baris Sencan
    Send me a mail at barissncn@gmail.com
    Hi, I just sent you an email. Let me know if it didn't come through from the attachment. Thanks again!
    I am using JSONHelper
    retrunStatus = {
    status = "User successfully authenticated ";
    user = {
    fullname = "Ashwin Moily";
    id = 1;
    mobile = 1234567890;
    password = "";
    role = 1;
    username = "ashwin@gmail.com";
    This is the result I am getting from JSON
    I have created three model class

    class User : Deserializable{
    var fullname: String?
    var id: Int?
    var mobile : Double?
    var role : Int?
    var username : String?

    required init(data: [String: AnyObject]) {
        fullname <<< data["fullname"]
        id <<< data["id"]
        mobile <<< data["mobile"]
        role <<< data["role"]
        username <<< data["username"]


    Second model class

    class ReturnStatus : Deserializable {
    var status :String?

    required init(data: [String: AnyObject]) {
        status <<< data["status"]


    Third model class class LoginResult : Deserializable {

    var user :user?
    var returnStatus :ReturnStatus?
    required init(data: [String: AnyObject]) {
        returnStatus <<<< data["returnStatus"]
        user <<<< data["user"]


    I am using Alamofire to call rest API
    I am able to do call this
    Alamofire.request(.POST, Constant.apiUrl, parameters: ["username": us , "password" : pw])
    .responseJSON { (, _, JSON, ) in
                var loginResult: LoginResult?
                 loginResult <<<< JSON
    LoginResult? does not have a member named returnStatus
    Baris Sencan
    If the last line you wrote is an error you see in the console, then I think you are trying to access it as loginResult.returnStatus instead of loginResult?.returnStatus or loginResult!.returnStatus

    Hi, thanks for the library, it works well. I managed to use inheritance in my model objects, but thought I'd propose a challenge to support protocol type properties. They're not instantiable in the way JSONHelper currently does things.


    This message was deleted
    Not in desperate need for that functionality, but mostly wondering if you know of any pattern that could nicely decouple the concrete type information from the class that is declaring the reference to a (protocol) type?
    Baris Sencan
    Sorry for replying a bit late, I will take a look into this soon.
    Peyman Mortazavi
    any idea when the new version will come out?
    I'm using Xcode 7.3 and there is a bug with parsing NSURL?s but it's already addressed in the last commit
    but it's not in the cocoapods yet
    so I'm wondering when it'll be out
    Baris Sencan
    2.0.0 will be out in a few days latest. isair/JSONHelper#56
    Baris Sencan
    The dev-2.0.0 should be ready for production now, people. I'll update the README and documentations within the next day and do a release. If you need it urgently just specify JSONHelper to use dev-2.0.0 branch in your Podfile.