We recommend using `initWithDefaults` and we should follow the recommendation. This change removes all usage of `init` within MDC components in order to let us remove that initializer from the public surface.
PiperOrigin-RevId: 302958447
Migrate `MDCBottomNavigationBarColorThemer` logic to theming extensions to prepare for the eventual deletion of `MDCBottomNavigationBarColorThemer`.
Part of #9130
We need to add @objc annotations to colorScheme and typographyScheme instances in our Swift examples, because we moved to Swift 4.2, the respondsToSelector won't find `setColorScheme:` and `setTypographyScheme:` setters otherwise.
This is a follow up PR for #7166 adds @objc annotations to Swift catalogMetadata() methods, because the Swift 4 compiler no longer attempts to infer what methods should be visible to Objective-C. As a result of this change in the compiler, no Swift examples were showing up in Dragons after #7166. See this article: https://useyourloaf.com/blog/objc-warnings-upgrading-to-swift-4/ for additional context.
Our creativity knows no bounds.
### Find
```
/\*
*Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
*
*Licensed under the Apache License,? Version 2\.0 \(the "License"\);
*you may not use this file except in compliance with the License\.
*You may obtain a copy of the License at
*
*http://www\.apache\.org/licenses/LICENSE-2\.0
*
*Unless required by applicable law or agreed to in writing,? software
*distributed under the License is distributed on an "AS IS" BASIS,?
*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,? either express or implied\.
*See the License for the specific language governing permissions and
*limitations under the License\.
*\*/
```
```
/\*
*Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
*Licensed under the Apache License, Version 2\.0 \(the "License"\);
*you may not use this file except in compliance with the License\.
*You may obtain a copy of the License at
*http://www\.apache\.org/licenses/LICENSE-2\.0
*Unless required by applicable law or agreed to in writing, software
*distributed under the License is distributed on an "AS IS" BASIS,
*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
*See the License for the specific language governing permissions and
*limitations under the License\.
*\*/
```
```
/\*
*Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
*
*Licensed under the Apache License, Version 2\.0 \(the "License"\);
*you may not use this file except in compliance with the License\.
*You may obtain a copy of the License at
*
*http://www\.apache\.org/licenses/LICENSE-2\.0
*
*Unless required by applicable law or agreed to in writing, software
*distributed under the License is distributed on an "AS IS" BASIS,
*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
*See the License for the specific language governing permissions and
*limitations under the License\.
*\*/
```
```
/\*
*Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
*
*Licensed under the Apache License, Version 2\.0 \(the "License"\);
*you may not use this file except in compliance with the License\.
*You may obtain a copy of the License at
*
*http://www\.apache\.org/licenses/LICENSE-2\.0
*
*Unless required by applicable law or agreed to in writing, software
*distributed under the License is distributed on an "AS IS" BASIS,
*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
*See the License for the specific language governing permissions and
*limitations under the License\.
*\*/
```
```
/\*
Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
Licensed under the Apache License, Version 2\.0 \(the "License"\);
you may not use this file except in compliance with the License\.
You may obtain a copy of the License at
http://www\.apache\.org/licenses/LICENSE-2\.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
See the License for the specific language governing permissions and
limitations under the License\.
\*/
```
```
/\*
Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
+Licensed under the Apache License, Version 2\.0 \(the "License"\);
+you may not use this file except in compliance with the License\.
+You may obtain a copy of the License at
+http://www\.apache\.org/licenses/LICENSE-2\.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
+See the License for the specific language governing permissions and
+limitations under the License\. *\*/
```
```
/\*
Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
+Licensed under the Apache License, Version 2\.0 \(the "License"\);
+you may not use this file except in compliance with the License\.
+You may obtain a copy of the License at
+http://www\.apache\.org/licenses/LICENSE-2\.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
+See the License for the specific language governing permissions and
+limitations under the License\.
*\*/
```
```
/\*
Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
Licensed under the Apache License, Version 2\.0 \(the "License"\)
you may not use this file except in compliance with the License\.
You may obtain a copy of the License at
http://www\.apache\.org/licenses/LICENSE-2\.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
See the License for the specific language governing permissions and
limitations under the License\.
\*/
```
```
/\*
Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
Licensed under the Apache License, Version 2\.0 \(the "License"\);
you may not use this file except in compliance with the License\.
You may obtain a copy of the License at
http://www\.apache\.org/licenses/LICENSE-2\.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
See the License for the specific language governing permissions and
limitations under the License\.
\*/
```
```
/\*
Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
Licensed under the Apache License, Version 2\.0 \(the "License"\);
you may not use this file except in compliance with the License\.
You may obtain a copy of the License at
http://www\.apache\.org/licenses/LICENSE-2\.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
See the License for the specific language governing permissions and
limitations under the License\.
\*/
```
### Replace
```
// Copyright $1-present the Material Components for iOS authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
```
Many of our Swift examples are either missing imports or are importing all of
MaterialComponents. Both of these will cause failures during internal builds.
* Add example when we explicitly set color of bottom navigation bar
* Clean up app bar stuff and move code out of init.
* Fix error with appBar
* Remove lines where I set color and remove extra example from this PR.
* Fix whitespace issue
* Adjust colors and tags.
* Change tags and colors, forgot to add this to the last commit.
Made colorScheme and typographyScheme properties in the class interfaces for all our examples.
Moved theming away from example inits and into viewDidLoad
Small update for slider example to allow it to grab the theming properly.
Related Pivotal: https://www.pivotaltracker.com/story/show/156616695
* Adding bottom nav component
* Add bottom navigation item
* Add nav item and cell badge classes
* Add badge color
* Update Bottom Nav Item
* Use KVO
* Update centering for orientation change
* Update badgeValue property
* Add nav bar container view for items
* Check text height when setting frame
* Update badge height calculation
* Add select and unselected color, add icons for demo, RTL support
* Add MDCMath as dependency
* Add demo description to example
* Add selection states for hiding item titles on select
* Change hide state name to default
* Rename view to bar
* Update nullability
* Rename properties for consistency with UITabBar
* Rename container view
* Update selected item property name
* Rename properties for consistency with UITabBar
* Rename classes, formatting
* Replace custom badge layer path with corner radius
* Remove MDCMath as dependency, update formatting
* Update layout to accommodate iPhone X
* Remove unused constant
* Move autoresizing to init
* Update landscape mode layout, add interim selection state
* Remove safeAreaInsetsDidChange
* Separate layout from setSelected
* Update landscape item layout
* Add landscape layout states, update sizeThatFits
* Update some setters, properties and formatting
* Update to dot setter syntax
* Change how image tintColor is modified
* Add i18n and a11y support for VoiceOver
* Update s/copy/strong
* Add a11y selected indicator
* Minor formatting updates
* Minor formatting
* Fix order of operations for remove item views
* Only permit badge color change if iOS 10 or higher.
* Add support for RTL for item adjacent titles
* Spelling correction in comments.
* Update title visibility enum names
* Update title visibility enum names
* Update title visibility names
* Remove 3-5 item requirement and change to recommendation
* nullability updates, distribution mode updates
* Add UIAppearance
* Lower bottom nav height when using adjacent titles
* Changing color/font properties to nonnull.
* Add bottom navigation color themer
* Update bottom nav bar main view so it's not an a11y element
* Add shadow to bottom nav
* Make imageview non a11y element.
* Adding tab a11y string
* Remove comment
* Rename distribution enum to alignment, stylistic updates
* Move badgeValue out of setters section
* Add check for iOS 10 when using badge color
* Remove newer availability checks
* Remove unncessary call to viewSafeAreaInsetsDidChange
* Add @available(iOS 11.0, *) check
* Fix badge color iOS version check
* Fix minor typo
* Add shadow layer and elevation dependency to podspec
* Remove (@available(iOS 10.0, *))
* Remove code diff
* Update podspec
* Code style updates, improve comments
* Add theming to swift example
* Adding bottom nav component
* Add bottom navigation item
* Add nav item and cell badge classes
* Add badge color
* Update Bottom Nav Item
* Use KVO
* Update centering for orientation change
* Update badgeValue property
* Add nav bar container view for items
* Check text height when setting frame
* Update badge height calculation
* Add select and unselected color, add icons for demo, RTL support
* Add MDCMath as dependency
* Add demo description to example
* Add selection states for hiding item titles on select
* Change hide state name to default
* Rename view to bar
* Update nullability
* Rename properties for consistency with UITabBar
* Rename container view
* Update selected item property name
* Rename properties for consistency with UITabBar
* Rename classes, formatting
* Replace custom badge layer path with corner radius
* Remove MDCMath as dependency, update formatting
* Update layout to accommodate iPhone X
* Remove unused constant
* Move autoresizing to init
* Update landscape mode layout, add interim selection state
* Remove safeAreaInsetsDidChange
* Separate layout from setSelected
* Update landscape item layout
* Add landscape layout states, update sizeThatFits
* Update some setters, properties and formatting
* Update to dot setter syntax
* Change how image tintColor is modified
* Add i18n and a11y support for VoiceOver
* Update s/copy/strong
* Add a11y selected indicator
* Minor formatting updates
* Minor formatting
* Fix order of operations for remove item views
* Only permit badge color change if iOS 10 or higher.
* Add support for RTL for item adjacent titles
* Spelling correction in comments.
* Update title visibility enum names
* Update title visibility enum names
* Update title visibility names
* Remove 3-5 item requirement and change to recommendation
* nullability updates, distribution mode updates
* Add UIAppearance
* Lower bottom nav height when using adjacent titles
* Changing color/font properties to nonnull.
* Update bottom nav bar main view so it's not an a11y element
* Add shadow to bottom nav
* Make imageview non a11y element.
* Adding tab a11y string
* Remove comment
* Rename distribution enum to alignment, stylistic updates
* Move badgeValue out of setters section
* Add check for iOS 10 when using badge color
* Remove newer availability checks
* Remove unncessary call to viewSafeAreaInsetsDidChange
* Add @available(iOS 11.0, *) check
* Add bottom navigation Swift example
* Fix badge color iOS version check
* Fix minor typo
* Add shadow layer and elevation dependency to podspec
* Remove (@available(iOS 10.0, *))
* Stylistic updates