15
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【Alamofire】Module 'Alamofire' has no member named 'request' というエラーが出る

Posted at
Alamofire.request(route).responseJSONDecodable { response in }

これを書いて普通にAlamofireを使おうと思ったら

Module 'Alamofire' has no member named 'request'

そんなん無いよと怒られました。

Alamofireは5系からの変更に注意

Alamofireは5系からメソッドの命名とかが結構変わっています。
こういう変更は勘弁してもらいたい。

基本的に「Alamofire」と記述していた部分は「AF」に変わったみたいです。
上記の例だと

AF.request(route).responseJSONDecodable { response in }

こうすれば動くようになります。

15
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?