TOPasscodeViewController icon indicating copy to clipboard operation
TOPasscodeViewController copied to clipboard

Missing Title View Support?

Open aasatt opened this issue 7 years ago • 3 comments

It looks like titleView is never added to the passcodeView I tried to search for [addSubView:self.titleView] in the project and didn't come across anything.

I forked and added:

if (self.titleView.superview == nil) {
        [self addSubview:self.titleView];
 }

To the LayoutSubviews methods of passcodeView for now. (inside the if (self.titleView) {...})

  • [✅] I have read this issue template and provided all possible information.
  • [✅ ] I'm using CocoaPods and have run pod update before filing this issue.

Hardware / Software

Which version of the library were you using? 0.0.2 Which version of iOS are you running? 11.2 What model of iOS device were you testing on? iPhone X If using CocoaPods, which version of CocoaPods are you on? Set git url directly to this repo

Goals

What is the outcome result you want to achieve with this library? n/a

Expected Results

Setting a UIVew for passCodeController.passcodeView.titleView will have it show up above the title label

What did you expect to happen? To see the title view above the title label

Actual Results

What happened instead? (Please attach a screenshot/screen recording if possible) The title label moves down to the proper offset for the titleView height but no title view is added to the passcodeView

Steps to Reproduce

Give the passcodeView of the controller a title view:

        let controller = TOPasscodeViewController(style: .translucentDark, passcodeType: .fourDigits)
        controller.passcodeView.titleView = {
            let width = controller.passcodeView.titleLabel.bounds.width
            let i = UIImageView(frame: CGRect(x: 0, y: 0, width: width, height: width*0.2672413793))
            i.image = #imageLiteral(resourceName: {imageName})
            i.contentMode = .scaleAspectFit
            return i
        }()

Build and run. Use the UI explorer to inspect the views. See that titleView was never added to passcodeView

aasatt avatar Jan 19 '18 20:01 aasatt

Hi @aasatt!

Ah, you might be right. I've put in all of the layout provisioning code for the title view, but I might have forgotten to put in the actual set up code.

I'll look into it when I get the chance.

Thanks for the issue!

TimOliver avatar Jan 26 '18 05:01 TimOliver

+1

Duanyangyu avatar Jan 31 '18 07:01 Duanyangyu

Hi @TimOliver Did you get a chance to check? I have facing same issue. Hi @aasatt Do you do that titleview ?

jasmit34 avatar Jun 30 '20 09:06 jasmit34