How to create NSDictionary with values?


#1

I have seen examples on the Web in github and NS documentation too. But i didnt find any suitable example to initialize NSDictionary.
e.g the following don’t work with code hinting support:


declare var NSDictionary: any;
export function setHintColor(args: { view: TextField, color: Color }) {
  let dictionary = new NSDictionary(
    [args.color.ios],
    [NSForegroundColorAttributeName]
  );
}

I would like to initialize dictionary as shown below in Typescript:


NSDictionary *params = @{@"userName"     : @"rob",
                         @"userEmail"    : @"rob@email.com",
                         @"userPassword" : @"password"};

#2

Maybe this will help you:


#3

i have already checked on this…