Why does using Nsurl request keeps telling me to rename to “init(url)”

前端 未结 3 1775
走了就别回头了
走了就别回头了 2021-01-16 22:33

Also trying to add the ability to detect a video and download it to the application in short a web-based app used for download any kind of video and has the ability to store

3条回答
  •  攒了一身酷
    2021-01-16 22:54

    URL :

    URL is a swift struct, so is passed by value.

    NSURL :

    NSURL is an Objective-C class. Is inherits from NSObject

    • In general, prefer the new struct versions of things unless you need to subclass for some reason.
    • An object representing the location of a resource that bridges to URL; use NSURL when you need reference semantics or other Foundation-specific behavior.

    Both URL and NSURL is accepted in swift. but you have used swift then most refer URL MORE.

提交回复
热议问题