This change connects the recently-added "dismiss" affordance to an action that
allows UIAccessibility to reject the Feature Highlight. In #8959, a
discoverable affordance was added to Feature Highlight so UIAccessibility
would present dismiss options more easily to users. That change did not
include connecting the view to any action or gesture recognizer, so users
could discover a "dismiss" button but nothing happened when it was activated.
This change does the following:
* Changes the dismiss view to a UIButton. There were complications when
attempting to add another gesture recognizer to the view hierarchy and a
UIButton was a simpler solution.
* Sets the layout frame of the dismiss view to `{0, 0, 1, 1}`, creating a
nearly-invisible clear view in the upper-left corner of the screen. The
`accessibilityFrame` is set to match
the Feature Highlight's bounds, which presents the affordance to
UIAccessibility in a manner similar to a Scrim. This is necessary to
avoid introducing accidental "reject" taps if the user pressed on the
Feature Highlight itself.
Closes#9450
Currently the feature highlight didn't have a proper dismiss affordance when voiceover is on.
It will instead speak a hint of "double tap to dismiss" on the title but without allowing the user to dismiss even when double tapped.
This adds a dismiss affordance and passes the accessibility hint to dismiss to that view.
Frame of dismissal button in VO:

Closes#8961#8888#8884#8886#8885
This PR adds adjustsFontForContentSizeCategory property to MDCFeatureHighlightViewController, allowing clients to have their scalable fonts adjust based on content size category changes.
Due to FeatureHighlight using an attributedText to set up the text for its labels, for the scalable fonts to adjust properly, the attributedText needs to have the font as an attribute. This is an interesting gotcha that was found while working on this PR.
Closes#8634
Adds a traitCollectionDidChangeBlock to MDCFeatureHighlightViewController and MDCFeatureHighlightView, called when its trait collection changes.
Additionally this moves the FeatureHighlightView test to a more generic name, instead of FeatureHighlightNoopTests they were moved to FeatureHighlightViewTests.
Closes#8050
Add support for the new dynamic type scaling curves to feature highlight.
The new curves are enabled by default, but a flag has been added allowing existing users to opt-in to the older behavior.
Replacing all non-integral, single-precision floating point literals with double-precision values explicitly cast to CGFloat. For example, `0.1f` should become `(CGFloat)0.1`.
Regex used:
```
([0-9]*\.)([0-9]*?)([1-9]+)([0-9]*?)[fF]
```
PiperOrigin-RevId: 220683126
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.
```
Removes the need to copy-paste stanzas from other files anymore as we'll rely on https://github.com/material-components/material-components-ios/pull/4478 to generate the correct stanza for us instead.
This was an automated change generated by running a find-and-replace regular expression:
### 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\.
\*/
```
### 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.
```
This PR (#4796) closes issue #4791, which was related to a crash that resulted from a fix to an internal client bug where the layout of the feature highlight was incorrect after rotations.
The approach taken was to revert the change that resulted in the crash and add a safeguard against incorrect layout by applying the positioning code both in the animation block (which will be sufficient for most cases) as well as after (which will be sufficient for cases where the frames we rely on in the positioning code are incorrect during the animation.)
This change further formalizes our pattern of annotating APIs that will be or are deprecated using class categories. Moving an API into such a category has the benefit of being picked up by the API diff toolchain and elevated into our release notes as a result.
* Feature Highlight must not load the view unless the view property is called or it's presented.
* fixed the tests,
added new tests for loading view,
Moved the logic for accessibility hint default to view controller,
Match the pattern of of MDCAlertController for not loading the view.
* moving the string files in to the right folder
* change the if logic to isViewLoaded for more clarity?
https://github.com/material-components/material-components-ios/pull/4234
Users should be able to override the default `accessibilityHint` on the
title text of the Feature Highlight view. The current hint is incorrect
instructions about dismissing the view.
Since we are not currently making breaking changes to components, this
change will permit teams to override the incorrect hint by assigning
either an empty string (to have no hint) or to set an appropriate hint.
Partially implements #3644
We do not intend to actively support UIAppearance any further. This change removes any references to supporting UIAppearance from our public documentation.
Pivotal story: https://www.pivotaltracker.com/story/show/157048342
* Adding TypographyThemer for FeatureHighlight.
* finish the deprecation comment.
* fix blaze build
* Typography -> TypographyThemer
* Updated old tests.
* Cleaning up comments, and test.
* use an instead of a for MDC
* Added Semantic Color Scheme Method for FeatureHighlight.
* change the applied color for title and body.
* Added Color Scheme for Feature Highlight.
* [Color] Implement a swift-friendly API for color scheme defaults. (#3246)
The old API required swift code like so:
MDCSemanticColorScheme(materialDefaults: ())
The new API allows swift code like so:
MDCSemanticColorScheme(defaults: .material)
Pivotal story: https://www.pivotaltracker.com/story/show/156527002
Many internal clients are breaking because of this API change. Instead, we
should follow the deprecation policy so clients can make a gradual migration
to the final API.
This reverts commit 24be789f57aedb732ceddecc36699f52875dc8d6.
Reopens#3144
* Extracting Accessibility out of FeatureHighlightViewController to a mutator.
Tests added.
Example updated.
* Revert "Extracting Accessibility out of FeatureHighlightViewController to a mutator."
This reverts commit 0b5433ebf86366087b240c4dc4992a0603fa73e0.
* Feature Highlight Clean up.
* Update examples.
* make title and body font defaults a class property.
Many of our color themers are accessing optional properties without
first verifying that the color scheme responds to the selector. This
can result in crashes. Instead, each optional property should be checked
for safety before being used.
* Extracting Accessibility out of FeatureHighlightViewController to a mutator.
Tests added.
Example updated.
* Added the new folder to pod setting.
* Splitting Title and Body Mutators, added tests for case of nil color.
* extra lf.
* Options is now a variable that can be given to the mutator.
* Fixing unit test issues, Updating all examples.
* Fixing Build file.
* Fixing build file.
* build file fix
* extra pace in the build file
* Revert "extra pace in the build file"
This reverts commit 18195fc893da2bcef7f8ef21f20b9f016b6c6011.
* extra space.
* cleaning up based on PR feedback.
* call super on setup and teardown.
* has to include to folder.
* build file indentation and variable name fixes.
* added color test.
* Document the test
* Made single method for accessibility.
* removing option input from public API.
* improving tests and documentation.
* putting this change in a separate PR.