【发布时间】:2019-12-13 06:13:26
【问题描述】:
所以我有以下
let profilepicURl = "https://graph.facebook.com/\(user_id_fb)/picture?type=large" //user_id_fb like 1251246454544 your facebook ID
但我想要做的是将该 url 图像放在下图的位置,我认为我可以使用 import Kingfisher,因为我已经将它与应用程序集成,但我不确定如何实现我想要的。
// Image needs to be added to project.
let buttonIcon = UIImage(systemName: "person.circle")
let rightBarButton = UIBarButtonItem(title: "Person", style: UIBarButtonItem.Style.done, target: self, action: #selector(FirstViewController.checkLogin(_:)))
rightBarButton.image = buttonIcon
self.tabBarController?.navigationItem.rightBarButtonItem = rightBarButton
我已经尝试了以下
let rightBarButton = UIBarButtonItem(title: "Person", style: UIBarButtonItem.Style.done, target: self, action: #selector(FirstViewController.checkLogin(_:)))
rightBarButton.kf.setImage(with: facebookProfileUrl, for: .normal, placeholder: nil, options: [.imageModifier(modifier)], progressBlock: nil, completionHandler: nil)
//rightBarButton.image = buttonIcon
self.tabBarController?.navigationItem.rightBarButtonItem = rightBarButton
但它会返回
使用未解析的标识符“修饰符”
【问题讨论】:
-
rightBarButton.kf.setImage(with: url)
-
@iOSArchitect.com 我已经设置了 let facebookProfileUrl = "graph.facebook.com/(fbID)/picture?type=large"
-
检查我的答案
-
@iOSArchitect.com 对您的回答发表的评论似乎是 .kf 的问题
标签: ios swift facebook-graph-api