material-components-ios icon indicating copy to clipboard operation
material-components-ios copied to clipboard

[BottomNavigation] Lack of designated initializers causes crash in Swift subclass

Open inickt opened this issue 4 years ago • 0 comments

A clear and concise description of what the bug is.

Reproduction steps

Steps to reproduce the behavior:

  1. Create MDCBottomNavigationBarController subclass in Swift
  2. Create a custom initializer that calls super.init(nibName:bundle:)

Expected behavior

Designated initializers should be overriden and initialize MDCBottomNavigationBarController properties.

Actual behavior

App will crash in viewDidLoad() on loadConstraints() due to navigationBar being null and init inaccessible as an initializer from the subclass.

Platform (please complete the following information)

  • Device: All
  • OS: iOS 14.4
  • MaterialComponents: 123.0.0

Additional context

Also noticed https://github.com/material-components/material-components-ios/pull/6038 fixed this but was closed.

inickt avatar Mar 03 '21 00:03 inickt