Skip to content

Instantly share code, notes, and snippets.

let str = "https://economictimes.indiatimes.com/rssfeedstopstories.cms"
let url = URL(string: str)
parser = XMLParser(contentsOf: url!) ?? XMLParser()
parser.delegate = self
parser.parse()
tblView.dataSource = self
tblView.delegate = self
tblView.register(UINib.init(nibName: "tblTitleCell", bundle: nil), forCellReuseIdentifier: "Cell")
https://economictimes.indiatimes.com/rssfeedstopstories.cms
@IBOutlet weak var tblView: UITableView!
var parser = XMLParser()
var arrDetail : [String] = []
var arrFinal : [[String]] = []
var content : String = ""
//MARK:- Delegate Method
func passingData(_ text: String) {
lblName.text = text
}
let storySecond = self.storyboard?.instantiateViewController(withIdentifier: "SecondVC") as! SecondVC
storySecond.delegate = self
self.navigationController?.pushViewController(storySecond, animated: true)
@IBAction func btnGetNameClicked(_ sender: UIButton) {
}
@IBOutlet weak var lblName: UILabel!
//MARK: Call protocol method when user click on button
if delegate != nil {
if (txtEnterName.text?.count)! > 0 {
self.delegate?.passingData(txtEnterName.text ?? "")
self.navigationController?.popViewController(animated: true)
}else{
@IBAction func btnSendNameClicked(_ sender: UIButton) {
}