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.
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.
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.
This change is the part of the move to add all examples to `BUILD` files, this additionally adds the missing imports in the `.swift` example.
Closes#6213
{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\]'
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.
```
Many of our Swift examples are either missing imports or are importing all of
MaterialComponents. Both of these will cause failures during internal builds.
* separating action and feature button.
* separate button to show the feature highlight.
* colors should not be catalog presentable.
* revert.
* removing redundant theming.
* custom view with no morphing.
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
* Replacing ColorThemer and FontThemer with SemanticColorThemer and TypographyThemer.
* Headline 6 is being used for FeatureHighlights not Headline2 (example update).
* Removed Feature Highlight Themer example since it's redundant, no scheme color changes in Feature Highlight Examples.
https://github.com/material-components/material-components-ios/pull/3489
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 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.
* 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.
* [TextFields] Beginning to update the docs to show the new controller styles.
* [TextFields] Correcting the name of a file.
* [TextFields] Adding content to controller styles doc.
* [TextFields] Images for the text field styles doc.
* [TextFields] Renaming styling doc.
* [TextFields] Moving doc images.
* [TextFields] Updating image ref paths.
* [TextFields] Text clarity in doc.
* [TextFields] Updated photo.
* [TextFields] Nits of grammar.
* [TextFields] Spelling correction.
All examples now have at least the required `+catalogBreadcrumbs` and `+catalogIsPrimaryDemo`. All examples in the same breadcrumbs path have only one primary demo. There should be only one `-catalogDescription` attached to the primary demo.
Closes#1897