Additional API to the MDCBottomSheetControllerDelegate delegate, allowing clients to conform to the delegate and get callbacks for:
1. The offset of the sheet changes in respect to the top of the screen in points.
2. The state of the sheet changes to one of the possible states of type MDCSheetState.
This has been tested on examples to check for correctness of values and that the methods are called appropriately once the controller conforms to the protocol.
Additional unit tests have been written to test that the added delegate methods are rightly called when the value changes and a callback needs to be made.
Resolves: #7227
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.
```
The BottomSheet scrim (dimmed background overlay) can function as a button for
UIAccessibility features. This allows a discoverable close/dismiss function
for users. Turning this feature on by default in the catalog to showcase that
it is recommended.
Related to #4275
This enables the new FlexibleHeader/AppBar behavior that correctly updates the content view controller's safe area insets/top layout guide to match the flexible header's height and sets the frame of the content view controller to match the bounds of the container view controller.
As part of this change, we were able to remove the Catalog logic that would manually adjust the frame of examples that did not have a scroll view. Examples are now expected to adjust their content according to the top layout guide / safe area insets, as can be seen in the ButtonsTypicalUse example.
Examples that *do* have a scroll view will also now make use of the correct top layout guide / safe area insets behavior. This behavioral change can most notably be seen in the ActivityIndicator example, which no longer has a 20 point "dead zone" above the table view.
This API allows clients to specify which view should be considered as the tracking scroll view for the bottom sheet gestural behaviors.
The API name is consistent with the FlexibleHeader component's similar API.
* First bottom sheet commit
* Add empty files of needed classes
* Do animation using presentation controller and transitioning delegate
* Implement bottom sheet transition using just a UIPresentationController
* Tap background to dismiss
* Clean up and document bottom sheet interface
* Minor cleanup
* Fix usePreferredHeight
* Toggle usePreferredHeight
* Let UIPresentationController layout sheet view
* Expand bottom sheet delegate api
* Remove automaticallyDismissBottomSheet and usePreferredHeight
* Remove shouldDismiss
* Delegate method docs
* Allow custom bottom sheet widths
* Animate sheet view to new frame when rotating bottom sheet
* Fix sheet view starting in bad location
* Specify float for background color
* Clean up bottom sheet presentation controller
* Minor cleanup
* Copy cl/148818444
* GOO -> MDC
* s/draging/dragging/
* Use init instead of initWithCoder
* Bottom sheet example description
* Big improvements to bottom sheet examples
* MDCBottomSheetTransitionController
* Wrap up everything in MDCBottomSheetViewController
* Move all examples to MDCBottomSheetViewController
* Move supplemental code to BottomSheetSupplemental
* bottomSheetPresentationControllerDidDismissBottomSheet
* Check delegate implements methods before calling
* MDCBottomSheetViewController -> MDCBottomSheetController
* Add comments for MDCBottomSheetController
* Use MDCMath
* Change style of preferredContentSize setter
* Support preferredContentSize.height
* Add an example layed out using Autolayout
* More correctly set frame for non scrolling content
* Minor improvements to examples
* Small fixes for examples
* Use umbrella import headers
* Show custom preferredContentSize width in example
* MDCBottomSheetTransitionController now vends a presentation controller
* Expose bottom sheet presentation controller on UIViewController
* Final review comments