Xcode rss阅读器中的多个提要(swift)
我正在使用swift在xcode中创建rss阅读器。我遵循这个图坦卡蒙,但在图坦卡蒙中,他没有为用户添加多个你自己的提要。他们是一个滑出菜单,但他们只是一个添加提要按钮,用户可以添加他们自己的提要。我已经将其取出,并使用feedNames.append将其他提要名称放在滑出菜单上,但我现在需要的是,当用户点击滑出菜单上的一个提要名称后,提要将打开。我想我知道代码在哪里,但我不知道该放什么。这是带项目的滑出菜单的代码。代码仍然实现了addfeed,但是忽略它,因为我要去掉它Xcode rss阅读器中的多个提要(swift),xcode,swift,rss,Xcode,Swift,Rss,我正在使用swift在xcode中创建rss阅读器。我遵循这个图坦卡蒙,但在图坦卡蒙中,他没有为用户添加多个你自己的提要。他们是一个滑出菜单,但他们只是一个添加提要按钮,用户可以添加他们自己的提要。我已经将其取出,并使用feedNames.append将其他提要名称放在滑出菜单上,但我现在需要的是,当用户点击滑出菜单上的一个提要名称后,提要将打开。我想我知道代码在哪里,但我不知道该放什么。这是带项目的滑出菜单的代码。代码仍然实现了addfeed,但是忽略它,因为我要去掉它 func sideBa
func sideBarDidSelectMenuButtonAtIndex(index: Int) {
if index == 0{ // ADD FEED BUTTON
let alert = UIAlertController(title: "Add new feed", message: "Enter feed name and URL", preferredStyle: UIAlertControllerStyle.Alert)
alert.addTextFieldWithConfigurationHandler({ (textField:UITextField!) -> Void in
textField.placeholder = "Feed name"
})
alert.addTextFieldWithConfigurationHandler({ (textField:UITextField!) -> Void in
textField.placeholder = "Feed URL"
})
alert.addAction(UIAlertAction(title: "Cancel", style: UIAlertActionStyle.Cancel, handler: nil))
alert.addAction(UIAlertAction(title: "Save", style: UIAlertActionStyle.Default, handler: { (alertAction:UIAlertAction!) -> Void in
let textFields = alert.textFields
let feedNameTextField = textFields?.first as UITextField
let feedURLTextField = textFields?.last as UITextField
if feedNameTextField.text != "" && feedURLTextField.text != "" {
let moc = SwiftCoreDataHelper.managedObjectContext()
let feed = SwiftCoreDataHelper.insertManagedObject(NSStringFromClass(Feed), managedObjectConect: moc) as Feed
feed.name = feedNameTextField.text
feed.url = feedURLTextField.text
SwiftCoreDataHelper.saveManagedObjectContext(moc)
self.loadSavedFeeds()
}
}))
所以我确定,代码在这里,但我不确定该放什么。谢谢你的帮助
func sideBarDidSelectMenuButtonAtIndex(index: Int)
if index == 0{
let url = NSURL(string: "http://www.widadclub.tk/feed")
let feedParser = MWFeedParser(feedURL: url)
feedParser.delegate = self
feedParser.parse()
}