Skip to content

iOS support for Arrays #50

@bobbyngwu

Description

@bobbyngwu

Hi Eddy,

In iOS, is there a good reason why the support for arrays was removed post 1.0.2

Version 1.0.2

let dict_1 = null;
            if (opts.body) {
                var cont_1 = opts.body;

** removed code

               if (Array.isArray(cont_1)) {
                    dict_1 = NSMutableArray.new();
                    cont_1.forEach(function (item, idx) {
                        dict_1.addObject(item);
                    });
                }

** eof removed code


                else if (types_1.isObject(cont_1)) {
                    dict_1 = NSMutableDictionary.new();
                    Object.keys(cont_1).forEach(function (key) {
                        dict_1.setValueForKey(cont_1[key], key);
                    });
                }
            }

Version 1.2.1

let dict: NSMutableDictionary<string, any> = null;
      if (opts.body) {
        let cont = opts.body;
        if (isObject(cont)) {
          dict = NSMutableDictionary.new<string, any>();
          Object.keys(cont).forEach(key => dict.setValueForKey(cont[key] as any, key));
        }
      }

Please let me know as this is holding back things here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions