Skip to content

Missing Title View Support? #19

Open
@aasatt

Description

@aasatt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions