ios - NSDictionary vs [String:AnyObject] in Swift -


i updated external swift library, , 1 of methods has changed face from:

public convenience method(data:nsdictionary?) { ... } 

to:

public convenience method(data:[string: anyobject]?) { ... } 
  1. what mean?

  2. initially, old, @{@"optiona":@yes} passed data argument. new need pass 2 items. thinking write @{@"optiona":@yes,@"optionb":@no}, correct?

  1. it means parameter swift dictionary , no objective-c nsdictionary anymore.

  2. to pass data, use square brackets instead of curly brackets , remove "@" (in swift)

["optiona":true, "optionb": false]

if calling method objective-c, method parameter should exposed nsdictionary , right @{@"optiona":@yes,"optionb":@no} missed @-sign before optionb


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

apache - setting document root in antoher partition on ubuntu -