我按照" How do I add a button to the InAppSettingsKit setting view (iPhone/iPad)?"中的说明进行操作。我的按钮出现在设置屏幕中。 但是,单击时我无法接收输入。 我的桥头:
#include <UIKit/UIKit.h>
#import "InAppSettingsKit/IASKViewController.h"
#import "InAppSettingsKit/IASKAppSettingsViewController.h"
#import "InAppSettingsKit/IASKSpecifier.h"
#import "InAppSettingsKit/IASKSettingsReader.h"
我的班级:
class settingsViewController: IASKAppSettingsViewController
{
func settingsViewController(sender: IASKAppSettingsViewController, buttonTappedForSpecifier specifier: IASKSpecifier)
{
println("click")
}
}
答案 0 :(得分:4)
要捕捉按钮点按,请将委托设置为接收回调:
import UIKit;
class settingsViewController: IASKAppSettingsViewController
{
override func viewDidLoad()
{
self.delegate = self
}
func settingsViewController(sender: AnyObject, buttonTappedForKey key: String)
{
println("click \(key)")
}
}