Migrate `MDCBottomNavigationBarColorThemer` logic to theming extensions to prepare for the eventual deletion of `MDCBottomNavigationBarColorThemer`.
Part of #9130
Examples titles were incorrectly removed in #6718. Restoring those
titles. These mistakes weren't found because the original PR only
checked the Dragons app and not the Catalog.
{MDC iOS} No longer using `-init` for Color Scheme.
Based on the discussions in go/mdc-ios-theming, we should not use the `-init` default initializer. Instead, we should use an explicit set of defaults.
Search regex: '\[\[MDCSemanticColorScheme alloc\] init\]'
Removes the need to copy-paste stanzas from other files anymore as we'll rely on #4478 to generate the correct stanza for us instead.
This was an automated change generated by running a find-and-replace regular expression:
```
/\*
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 $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.
```
We can now make use of @available throughout our codebase.
We support Xcode 9 and up, which includes the iOS 11 SDK. This means we can remove any guards for SDKs prior to iOS 11.
This was cleaned up by running a global find-and-replace with the following regular expression:
```
Find:#if defined\(__IPHONE_11_0\) && \(__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0\)\n(.+if \(@available\(iOS 11.0, \*\)\) \{(?:.|\n)*?)(?:#else(?:.|\n)*?)?\n#endif
Replace:$1
```
With some additional cleanup for stragglers that didn't match this pattern. Note that else clauses were intentionally dropped.
Closes https://github.com/material-components/material-components-ios/issues/4909
When title strings are very long (as may be common in localization to
non-default languages), MDCBottomNavigationBar was incorrectly computing the
expected height of the title label. Instead of querying the NSString for its
bounding rect, we can allow the UILabel to size itself and simply restrict
its width to the tab's width.
Closes#4040
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
The `BottomNavigationTypicalUseExample` has a retain cycle in the
`dispatch_after` block it uses to update the badge value. This causes
example VCs to be accumulated if they are opened repeatedly. A simple
fix is to keep a weak reference in the dispatched block making the next
update call a no-op.
* 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
* Fix badge color iOS version check
* Fix minor typo
* Add shadow layer and elevation dependency to podspec
* Remove (@available(iOS 10.0, *))