how to check key exists in nsdictionary swift and get result in array

I get value from key in objective C but in swift i don't know how to do it?

 NSDictionary *dictResult = [NSJSONSerialization
                                JSONObjectWithData:jsonData options:0 error:&error];

if ([dictResult objectForKey:@"wsResponse"]!=nil)
     for (NSDictionary *dict in [[dictResult valueForKey:@"wsResponse"]valueForKey:@"Bhaktamar"])
            objBean=[[Beandata alloc]init];
            objBean.strcontent=[dict objectForKey:@"content"];
            objBean.strtitle=[dict objectForKey:@"title"];

            [dataBase insertJsonData:@"BhaktamarData" Title:objBean.strtitle Content:objBean.strcontent];


Thanks in Advance


{"wsResponse":{"Bhaktamar":[{"content":"atipati nath","title":"atipatinath"},{"content":"atipati nath","title":"atipatinath"}]}


The Swift 3 equivalent is:

do {
    if let dictResult = try JSONSerialization.jsonObject(with:jsonData, options:[]) as? [String:Any] {
        if let wsResponse = dictResult["wsResponse"] as? [String:Any], let shlock = wsResponse["Bhaktamar"] as? [[String:Any]] {
            for dict in shlock {
                objBean = Beandata()
                objBean.strcontent = dict["content"] as? String ?? ""
                objBean.strtitle = dict["title"] as? String ?? ""
                dataBase.insertJsonData("BhaktamarData", Title:objBean.strtitle, Content:objBean.strcontent)
} catch {

The syntax for the insert line is probably different (there must be a parameter label for the first parameter).

PS: Consider that the variable objBean is initialized in the repeat loop but actually unused.


 ? how to check key exists in nsdictionary swift and get result in array
 ? how to check key exists in nsdictionary swift and get result in array
 ? Getting objectForKey: in an NSDictionary with JSON data returning nil even though the key is present
 ? How to Serialize a NSCFArray (possible JSON) to NSDictionary?
 ? NSDictionary; trouble getting values
 ? JSON Results into NSDictionary in Objective-C
 ? How to recursively traverse NSDictionary in swift
 ? File with string in JSON format , how to read filecontent into NSDictionary
 ? Swift 3 NSDictionary to Dictionary conversion causes NSInvalidArgumentException
 ? Swift removing duplicate from array of object