Ambiguous use of 'subscript' with NSArray & JSON
<p>I have looked through the similar topics in stackoverflow but none of those solutions seem to work for me.</p>

<p>I have an app that fetch video through youtube API . The following code is giving the error.   </p>

<pre><code>var arrayOfVideos = [Video]()

// I am getting the error for the following line and it says "Ambiguous use of 'subscript'.

for video in JSON["items"] as! NSArray {

    let videoObj = Video()
    videoObj.videoId = video.valueForKeyPath("snippet.resourceId.videoId") as! String
    videoObj.videoTitle = video.valueForKeyPath("snippet.title") as! String
    videoObj.videoDescription = video.valueForKeyPath("snippet.description") as! String
    videoObj.videoThumbnailUrl = video.valueForKeyPath("snippet.thumbnails.high.url") as! String


    arrayOfVideos.append(videoObj)

}
</code></pre>

<p>I have also a class called Video where I define the Id, Title and etc... The above code refers here.</p>

<pre><code>class Video: NSObject {

    var videoId:String = ""
    var videoTitle:String = ""
    var videoDescription:String = ""
    var videoThumbnailUrl:String = ""

}
</code></pre>

<p>I have tried to solve it by checking the link/suggestions below but it didn't work for me. I cannot seem to find the missing part.</p>

<p><a href="https://stackoverflow.com/questions/33642059/ambiguous-use-of-subscript-in-swift">Ambiguous Use of Subscript in Swift</a></p>