How can I flip an iOS UITableViewCell?

后端 未结 4 948
走了就别回头了
走了就别回头了 2020-12-29 16:45

I have a tableview with a number of cells. Each cell has a little info \"i\" button, which I would like the user to be able to click in order to edit the information in that

4条回答
  •  无人及你
    2020-12-29 17:32

    Swift 4:

    @IBAction func flipButtonAction(_ sender: UIButton) {
    
        UIView.transition(with: contentView, duration: 0.6, options: .transitionFlipFromRight, animations: {() -> Void in
            self.contentView.insertSubview(flipView, aboveSubview: normalView)
        }, completion: {(_ finished: Bool) -> Void in
        })
    }
    
    //flip the view back to normalView
    
    @IBAction func flipBackButtonAction(_ sender: Any) {
    
        UIView.transition(with: contentView, duration: 0.6, options: .transitionFlipFromLeft, animations: {() -> Void in
            self.contentView.insertSubview(normalView, aboveSubview: flipView)
        }, completion: {(_ finished: Bool) -> Void in
        })
    }
    

提交回复
热议问题