Getting Optional(“”) when trying to get value from KeyChain

后端 未结 5 1444
自闭症患者
自闭症患者 2020-12-15 23:00

When I try to get my keyChain value, it return a string containing:

Optional(\"[thing in the KeyChain]\")

so, I tried to remove \"Optiona

5条回答
  •  悲&欢浪女
    2020-12-15 23:21

    You will get the Optional("") because the optional value is not unwrapped and if you want to unwrap the optional value to get the string value, do

    yourValue.unsafelyUnwrapped

提交回复
热议问题