13 Commits

Author SHA1 Message Date
Jeff Verkoeyen
7ae4498a05 [FlexibleHeader] Delete the unused canAlwaysExpandToMaximumHeight API.
PiperOrigin-RevId: 457775121
2022-06-28 11:11:40 -07:00
Randall Li
502bc5d910 Ran a Swift formatter
PiperOrigin-RevId: 395947664
2021-09-10 09:48:14 -07:00
Jeff Verkoeyen
580a1ecbde [AppBar] Clarify the purpose of the example supplemental view controllers.
The prior names of composed vs inherited didn't meaningfully translate to the intended purpose of the two view controllers, which is to provide harnesses within which the flexible header can be placed either as a child or as a sibling to its tracking scroll view. This distinction is important because the flexible header behaves differently when it is a child of its tracking scroll view, as is the case when using UITableViewController.

PiperOrigin-RevId: 310869953
2020-05-11 02:11:26 -07:00
Robert Moore
bd832a416c
[AppBar] Make example titles more accurate. (#8828)
Have the titles reflect their catalog breadcrumb names.

Found while auditing dragons.
2019-11-14 15:44:55 -05:00
featherless
5425884431
[examples] Annotate all catalogShouldHideNavigation invocations with @objc. (#8791)
Context:

Due to changes in the Swift runtime over the past years, methods that are considered "optional" in Objective-C need to have @objc annotations in order for Objective-C to be able to perform `respondsToSelector:` invocations.

Problem:
Many of our examples had not annotated their `catalogShouldHideNavigation` methods with the `@objc` annotation, causing the Catalog to wrap the examples in a container app bar view controller. The reason most of these examples would implement `catalogShouldHideNavigation` is because they are managing their own navigation (e.g. to demonstrate AppBar functionality), so this would often result in duplicate AppBars appearing in the example.

The fix:
All `catalogShouldHideNavigation` Swift methods have been annotated with `@objc`.

Fixes https://github.com/material-components/material-components-ios/issues/7576
Fixes https://github.com/material-components/material-components-ios/issues/7578
2019-11-12 16:54:55 -05:00
Cody Weaver
1df302cd48
[AppBar] Update swift examples to use theming extension (#7511)
As part of #7510 we need to remove our usage of the typography themer and color themer within our examples. This removes the usages of both for all swift examples.
2019-05-28 23:13:11 -04:00
Yarden Eitan
efe61588a6
update (#7246)
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.
2019-04-23 10:21:14 -04:00
Andrew Overton
c56d5d76d3
Add @objc annotations to get examples to show up in Dragons (#7168)
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.
2019-04-17 21:35:43 -04:00
Andrew Overton
b38372192f
Update to Swift 4.2 (#7166)
This PR updates the Swift version to 4.2.

Partially resolves #6874.
2019-04-17 16:59:02 -04:00
Brian Moore
b03820da60 [AppBar] Refactor AppBar example table views (#6974)
This refactors the "simple" example table view controllers used in a bunch of these examples into two types: a "composed" one which creates its own table view and an "inherited" one which subclasses UITableViewController. They behave differently, so this makes that explicit and also reduces some code duplication.
2019-03-22 09:44:29 -04:00
Joe Aguilar
f1b96d4f81 [Catalog] Begun audit of swift forced unwrapping in catalog (#6117)
This work is related to #3984. I decided to break it up to make it easier for review.

This change audits the appbar swift examples force unwrapping.
2019-01-03 10:35:06 -05:00
Robert Moore
c1b1d25eec
[MDC Swift] Add guards for Swift 4.2+ (#5634)
[MDC Swift] Add guards for Swift 4.2+

On Xcode 10, using Tulsi, the unit test target cannot be built because much of the Swift code does
not have the correct syntax for Swift 4.2+. Adding pragmas to allow continued support for Xcode
9.4.2 and Xcode 10.

PiperOrigin-RevId: 220399935
2018-11-07 08:54:40 -05:00
rami-a
1ecf3e341a
Add dragons example for appbar that demonstrates issue #5412 (#5471)
This change is to help us fix a client-blocking bug by providing an example that reproduces the issue in #5412
2018-10-23 10:08:14 -04:00