Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios PopUpDialog cocoapod自定义按钮不';行不通_Ios_Swift_Dialog_Cocoapods_Custom Button - Fatal编程技术网

Ios PopUpDialog cocoapod自定义按钮不';行不通

Ios PopUpDialog cocoapod自定义按钮不';行不通,ios,swift,dialog,cocoapods,custom-button,Ios,Swift,Dialog,Cocoapods,Custom Button,我正在我的应用程序中使用此PopUpDialog CoCoPapod: 我已经做了一个自定义VC,希望我的两个按钮在我点击时增加/减少家具标签上显示的数字(标签在按钮上方的弹出对话框上)。 我的弹出窗口是这样的: 我不知道我遗漏了什么,但当我创建两个按钮时,我得到了这个错误消息:表达式的类型是不明确的,没有更多的上下文 它显示在该行的右侧: furnitureVC.furnitureLabel.text = String(Int(furnitureVC.furnitureLabel.text)

我正在我的应用程序中使用此PopUpDialog CoCoPapod:

我已经做了一个自定义VC,希望我的两个按钮在我点击时增加/减少家具标签上显示的数字(标签在按钮上方的弹出对话框上)。 我的弹出窗口是这样的:

我不知道我遗漏了什么,但当我创建两个按钮时,我得到了这个错误消息:表达式的类型是不明确的,没有更多的上下文

它显示在该行的右侧:

furnitureVC.furnitureLabel.text = String(Int(furnitureVC.furnitureLabel.text) - 1) 
你能把我的密码改一下吗

func handleForward(animated: Bool = true) {

     //Create a custom view controller
    let furnitureVC = FurniturePopUp(nibName: "FurniturePopUp", bundle: nil)


     //Create the dialog
    var popup = PopupDialog(viewController: furnitureVC,
                            buttonAlignment: .horizontal,
                            transitionStyle: .bounceDown,
                            tapGestureDismissal: true,
                            panGestureDismissal: false)
    
    
    let vc = popup.viewController as! PopupDialogDefaultViewController

    // Set dialog properties
    
    vc.titleText = "..."
    vc.messageText = "0"
    
    
    
    // Create first button
    let buttonOne = DefaultButton(title: "Decrease", height: 60, dismissOnTap: false) {
        furnitureVC.furnitureLabel.text = String(Int(furnitureVC.furnitureLabel.text) - 1)
        vc.messageText = furnitureVC.furnitureLabel.text
    }

    // Create second button
    let buttonTwo = DefaultButton(title: "Increase", height: 60, dismissOnTap: false) {
        furnitureVC.furnitureLabel.text = String(Int(furnitureVC.furnitureLabel.text) + 1)
        
            
    }
    buttonOne.setImage(#imageLiteral(resourceName: "minus").withRenderingMode(.alwaysOriginal), for: .normal)
    buttonTwo.setImage(#imageLiteral(resourceName: "plus").withRenderingMode(.alwaysOriginal), for: .normal)

    // Add buttons to dialog
    popup.addButtons([buttonOne, buttonTwo])

    // Present dialog
    present(popup, animated: animated, completion: nil)
}
家具弹出窗口:

    class FurniturePopUp: UIViewController {
    @IBOutlet weak var decreaseButton: UIButton!
    @IBOutlet weak var increaseButton: UIButton!
    @IBOutlet weak var furnitureLabel: UILabel!
    
}