Closed phuhk closed 5 years ago
NSURL
doesn't conform to Resource
type. Use URL
instead:
viewModel
.user
.map { user in URL(string: user.avatar) }
.bind(to: avatarImageView.kf.rx.image())
.disposed(by: rx.disposeBag)
NSURL is deprecated, please use URL instead.
Instance method 'bind(to:)' requires the types 'URL?' and 'Resource?' be equivalent
I think you have to unwrap your URL.
Instance method 'bind(to:)' requires the types 'URL' and 'Resource?' be equivalent
I unwrap the URL but the problem has always existed
@Terriermon did you ever resolve the issue Instance method 'bind(to:)' requires the types 'URL' and 'Resource?' be equivalent
Hi there, I'm just following the doc and receive "Cannot invoke 'bind' with an argument list of type '(to: Binder<Resource?>)'" error. Please help me check if my code have any issue
viewModel.user.map { user -> NSURL in return NSURL.init(string: user.avatar) ?? NSURL.init() } .bind(to: avatarImageView.kf.rx.image()) .disposed(by: rx.disposeBag)