1

我按照“如何将按钮添加到 InAppSettingsKit 设置视图 (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")
    }
}
4

1 回答 1

4

要捕捉按钮点击,请将委托设置为接收回调:

import UIKit;
class settingsViewController: IASKAppSettingsViewController
{
    override func viewDidLoad()
    {
        self.delegate = self
    }
    func settingsViewController(sender: AnyObject, buttonTappedForKey key: String)
    {
         println("click \(key)")
    }
}
于 2015-08-30T15:00:36.573 回答