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
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.
**Context:**
Clients need a way to know the content inset of the drawer to be able to lay out their content appropriately.
**The Problem:**
Because things like the status bar, safe area, and the top handle take up more space at the top of the drawer, the content that is laid out initially will be clipped if not able to move the content appropriately as the drawer is dragged.
**The Fix:**
Add an MDCBottomDrawerViewControllerDelegate that listens to topInset changes as the drawer is dragged and provides the top inset in which the content should be laid out below.
**Testing:**
Unit Test + Tested on an iPhone X and iPhone 7 on all examples, portrait and landscape.
**Context:**
The navigation drawer's top handle should have an API to be able to customize its color.
**The Problem:**
Currently our top handle only has a default color set and can't have clients customize its color.
**The Fix:**
Provide an API to MDCBottomDrawerViewController to set the handle's background color.
**Testing:**
Unit Test + Tested on an iPhone X and iPhone 7 on all examples, portrait and landscape.
**Screenshot**

**Context:**
The Navigation Drawer should have an affordance to show scrollability in a shape of a top handle.
**The Problem:**
Currently we have no top handle in our drawer to show scrollability.
**The Fix:**
In this PR we are adding a top handle to our drawer. the top handle is hidden by default. when the top handle isn't hidden, it is visible when there is more scrolling to perform for the drawer, and then it fades away as the drawer reaches its full height, or when it goes to full screen.
**Testing:**
Unit Tests + Tested on an iPhone X and iPhone 7 on all examples, portrait and landscape.
**Related Bugs:**
Closes#5515
**Screenshot**

**Video of transition**

Context:
This change opens up an API to the nav drawer to allow clients to round the top corners using the state system. allowing them to define what corner radius will the top corners have based on the state the drawer is in.
The Problem:
There was no way for users to customize and set the top corners' radius of the drawer.
The Fix:
We now have an API open that allows users to set the corner radius using the drawer's state system. The corner radius logic was moved to the MDCBottomDrawerViewController because that logic isn't part of the drawer scrolling mechanism and shouldn't sit in MDCBottomDrawerContainerViewController if not necessary. To achieve the desired outcome we exposed internally the bottomDrawerTopTransitionRatio:transitionRatio API to the MDCBottomDrawerViewController so it can animate the transition between corner radius shapes smoothly.
Testing:
Unit Tests + Tested on an iPhone X and iPhone 7 with smaller and bigger preferredContentSize to imitate different states. Tested on Portrait and Landscape on all examples.
Related Bugs:
Closes#5516
This PR is the last step in graduating the Navigation Drawer component from Beta to Ready.
We have resolved all the outstanding issues in the Navigation Drawer Project here: https://github.com/material-components/material-components-ios/projects/85 and hotlist: 1230549 .
The only outstanding issue is the unit tests ( #5466 , #5465 ) which were approved and are pending due to GitHub issues causing CI not to run.
We are essentially migrating here the NavigationDrawer component from the MaterialComponentsAlpha podspec to the MaterialComponents podspec so it can be used publicly using the normal means of installing our Pod.
This PR is blocked and can land once #5466 and #5465 land.
Closes#5333
### The problem
BottomDrawer previously had no color themer support
### The fix
This change adds a color themer for BottomDrawer. Additionally this adds unit tests and updates the example to use the color themer. The guidelines indicate the content and header should utilize the semantic surface color, so that is what the themer applies to the BottomDrawer.
**Note:** The drawer should be configured with its header and content ViewControllers before applying the theme.
### Related issues
Closes#4910
### Code snippet
#### Swift
```
let bottomDrawerViewController = MDCBottomDrawerViewController()
bottomDrawerViewController.contentViewController = contentViewController
bottomDrawerViewController.headerViewController = headerViewController
MDCBottomDrawerColorThemer.applySemanticColorScheme(colorScheme,
toBottomDrawer: bottomDrawerViewController)
```
#### ObjC
```
MDCBottomDrawerViewController *bottomDrawer = [[MDCBottomDrawerViewController alloc] init];
bottomDrawer.contentViewController = contentViewController
bottomDrawer.headerViewController = headerViewController
[MDCBottomDrawerColorThemer applySemanticColorScheme:self.colorScheme
toBottomDrawer:bottomDrawer];
```
### Context
In working on navigation drawer bugs the navigation drawer presents itself right when you open the example view controller.
### The problem
This makes it hard to do screenshot testing and harder to work on because you have to go back to the table view and then select the example again every time you want to present.
### The fix
Add a button to present the navigation drawer.
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.
```
Adding the navigation drawer component that adds a presentation controller for showing UIViewControllers as a bottom drawer.
History of the component (last CL submitted for it): cl/209765207
Design doc: go/mdc-ios-navigation-drawer
This component will be the first alpha component in this repo, this means that it can still change and will not be included as part of the podspec at first.