gpt4 book ai didi

ios - TWTRTwitter sessionStore 现在返回 TWTRAuthSession : so how does one access the userName property now?

转载 作者:可可西里 更新时间:2023-11-01 01:59:05 29 4
gpt4 key购买 nike

使用 Swift 中的 TwitterKit 3.3.0 sharedInstance().sessionStore.session() 现在返回一个 TWTRAuthSession 而不是 TWTRSession,因为前。事情发生了变化,这很好,但是the documentation尚未更新以反射(reflect)这一点,因此我不再知道如何访问以前的 TWTRSession 对象提供的 userName 属性。

最佳答案

你可以用 perform(_:) 来做到这一点

希望下面的内容能帮助那些面临这个问题的人。

let username = session.perform(#selector(getter: TWTRSession.userName))?.takeRetainedValue() as? String

关于ios - TWTRTwitter sessionStore 现在返回 TWTRAuthSession : so how does one access the userName property now?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48037798/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com