当处于子视图时,我无法将按钮的 touchUpInside 调用到 ViewController
I can't call touchUpInside of button to ViewController when is at a subview
我正在用卡片钱包制作一个图书馆,但是当我按下控制器中的一个按钮时,我无法正常工作,如果我的实例坏了,我不知道,需要帮助。
项目的存储库在 github 这是 link:
https://github.com/RAES9/WalletOfCards
姓名class身份证WalletOfCards.swift
let controller = self.delegate?.storyboard!.instantiateViewController(withIdentifier: self.destitaionController as String)
self.delegate?.addChild(controller!)
controller!.didMove(toParent: self.delegate!)
Lines: 143,144,15.
Function: tappedButton
我为我的控制器创建了新的变量,并在其中添加了新的子视图
let controller = self.dataSource.storyboard!.instantiateViewController(withIdentifier:
self.destitaionController as String)
self.dataSource.addChild(controller)
controller.didMove(toParent: self.dataSource)
controller.view.frame = CGRect(x: 0, y: 0, width: (cardSelected?.frame.width)!, height: (cardSelected?.frame.height)!)
controller.view.alpha = 0.0
self.dataSource.view.addSubview(controller.view)
controller.view.alpha = 1.0
我正在用卡片钱包制作一个图书馆,但是当我按下控制器中的一个按钮时,我无法正常工作,如果我的实例坏了,我不知道,需要帮助。
项目的存储库在 github 这是 link: https://github.com/RAES9/WalletOfCards
姓名class身份证WalletOfCards.swift
let controller = self.delegate?.storyboard!.instantiateViewController(withIdentifier: self.destitaionController as String)
self.delegate?.addChild(controller!)
controller!.didMove(toParent: self.delegate!)
Lines: 143,144,15.
Function: tappedButton
我为我的控制器创建了新的变量,并在其中添加了新的子视图
let controller = self.dataSource.storyboard!.instantiateViewController(withIdentifier:
self.destitaionController as String)
self.dataSource.addChild(controller)
controller.didMove(toParent: self.dataSource)
controller.view.frame = CGRect(x: 0, y: 0, width: (cardSelected?.frame.width)!, height: (cardSelected?.frame.height)!)
controller.view.alpha = 0.0
self.dataSource.view.addSubview(controller.view)
controller.view.alpha = 1.0