Populating information in swift 3 for iPad

You could implement UITextFieldDelegate and your delegate will be called when the user enter something in your text field. First set the delegate to self txtField.delegate = self Use this if you want to change the other fields when the user is done editiing your master field func textFieldDidEndEditing(_ textField: UITextField, reason: UITextFieldDidEndEditingReason) { // … Read more

Type ‘Any’ Has no Subscript Members in Xcode 8.1 Swift 3

You need to cast snapshot.value as? [String: AnyObject] first because the compiler does not know what type of snapshot.value is. Like this: if let value = snapshot.value as? [String: AnyObject] { let title = value[“title”] as! String let message = value[“message”] as! String self.posts.insert(contentsOf: postStruct(title: title, message: message), at: index, 0) self.tableView.reloadData() }

How to parse JSON response to show Image and Webview.

Try doing something like this. This is not the exact solution and you’ll have to work around your way. NSString *link = [NSString stringWithFormat:@”yourServiceURL”]; NSString *encdLink = [link stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSURL *url=[NSURL URLWithString:encdLink]; NSData *response = [NSData dataWithContentsOfURL:url]; NSError *error; NSArray *jsonArray = [NSJSONSerialization JSONObjectWithData:response options: NSJSONReadingMutableContainers error: &error]; Now you have your data in the … Read more