Skip to content

Commit

Permalink
Add @objc annotations to get examples to show up in Dragons (material…
Browse files Browse the repository at this point in the history
…-components#7168)

This is a follow up PR for material-components#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 material-components#7166. See this article: https://useyourloaf.com/blog/objc-warnings-upgrading-to-swift-4/ for additional context.
  • Loading branch information
andrewoverton authored Apr 18, 2019
1 parent 9e7848c commit c56d5d7
Show file tree
Hide file tree
Showing 70 changed files with 70 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class ActionSheetSwiftExampleViewController: UIViewController {
// MARK: Catalog by Convensions
extension ActionSheetSwiftExampleViewController {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Action Sheet", "Action Sheet (Swift)"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ extension ActivityIndicatorSwiftExampleViewController : MDCActivityIndicatorDele
}

// MARK: Catalog by convention
class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Activity Indicator", "Activity Indicator (Swift)"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ extension AnimationTimingSwiftExampleViewController {
scrollView.addSubview(materialSharpView)
}

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Animation Timing", "Animation Timing (Swift)"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ extension AppBarAnimatedJumpExample: MDCTabBarDelegate {

extension AppBarAnimatedJumpExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["App Bar", "Manual Tabs Jump (Animated)"],
"primaryDemo": false,
Expand Down
2 changes: 1 addition & 1 deletion components/AppBar/examples/AppBarGlitchExample.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ extension AppBarJumpExample: MDCTabBarDelegate {

extension AppBarJumpExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["App Bar", "Manual Tabs Jump"],
"primaryDemo": false,
Expand Down
2 changes: 1 addition & 1 deletion components/AppBar/examples/AppBarImageryExample.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class AppBarImagerySwiftExample: UITableViewController {
// MARK: Catalog by convention
extension AppBarImagerySwiftExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["App Bar", "Imagery (Swift)"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ extension AppBarInheritedAnimatedJumpExample: MDCTabBarDelegate {

extension AppBarInheritedAnimatedJumpExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["App Bar", "Manual Tabs Jump (Animated, UITableViewController)"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class AppBarInterfaceBuilderSwiftExample: UIViewController, UIScrollViewDelegate
// MARK: Catalog by convention
extension AppBarInterfaceBuilderSwiftExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["App Bar", "Interface Builder (Swift)"],
"primaryDemo": false,
Expand Down
2 changes: 1 addition & 1 deletion components/AppBar/examples/AppBarManualTabsExample.swift
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ extension AppBarManualTabsExample: MDCTabBarDelegate {

extension AppBarManualTabsExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["App Bar", "Manual tabs"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class AppBarModalPresentationSwiftExample: UITableViewController {
// MARK: Catalog by convention
extension AppBarModalPresentationSwiftExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["App Bar", "Modal Presentation (Swift)"],
"primaryDemo": false,
Expand Down
2 changes: 1 addition & 1 deletion components/AppBar/examples/AppBarTypicalUseExample.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class AppBarTypicalUseSwiftExample: UITableViewController {
// MARK: Catalog by convention
extension AppBarTypicalUseSwiftExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["App Bar", "App Bar (Swift)"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class AppBarWithUITableViewController: UITableViewController {

extension AppBarWithUITableViewController {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["App Bar", "AppBar+UITableViewController"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class BottomAppBarTypicalUseSwiftExample: UIViewController {
// MARK: Catalog by convention
extension BottomAppBarTypicalUseSwiftExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Bottom App Bar", "Bottom App Bar (Swift)"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class BottomNavigationControllerExampleViewController: MDCBottomNavigationBarCon
viewControllers = [ viewController1, viewController2, viewController3 ]
}

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Bottom Navigation", "Bottom Navigation Controller"],
"presentable": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class BottomNavigationExplicitlySetColorExample: UIViewController {
// MARK: Catalog by convention
extension BottomNavigationExplicitlySetColorExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Bottom Navigation", "Bottom Navigation Set Color (Swift)"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class BottomNavigationNilBadges : UIViewController {
// MARK: Catalog by convention
extension BottomNavigationNilBadges {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Bottom Navigation", "Badge Value Test"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class BottomNavigationResetExample: UIViewController {
// MARK: Catalog by convention
extension BottomNavigationResetExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Bottom Navigation", "Bottom Navigation Reorder (Swift)"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class BottomNavigationSelectedIconExample: UIViewController {
// MARK: - Catalog by Conventions
extension BottomNavigationSelectedIconExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Bottom Navigation", "Bottom Navigation Selected"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class BottomNavigationTitleVisibilityChangeExample: UIViewController, MDCBottomN
// MARK: Catalog by convention
extension BottomNavigationTitleVisibilityChangeExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Bottom Navigation", "Bottom Navigation Title Visibility (Swift)"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class BottomNavigationTypicalUseSwiftExample: UIViewController {
// MARK: Catalog by convention
extension BottomNavigationTypicalUseSwiftExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Bottom Navigation", "Bottom Navigation (Swift)"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private class BottomSheetTableViewMenu: UITableViewController {
// MARK: Catalog by convention
extension BottomSheetTableViewExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Bottom Sheet", "Table View Menu"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class ButtonBarTypicalUseSwiftExample: UIViewController {
// MARK: Catalog by convention
extension ButtonBarTypicalUseSwiftExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Button Bar", "Button Bar (Swift)"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ButtonsCustomFontViewController: UIViewController {

var containerScheme = MDCContainerScheme()

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Buttons", "Buttons (Custom Font)"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import MaterialComponentsBeta.MaterialContainerScheme

class ButtonsDynamicTypeViewController: UIViewController {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Buttons", "Buttons (DynamicType)"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class ButtonsSimpleExampleSwiftViewController: UIViewController {

extension ButtonsSimpleExampleSwiftViewController {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Buttons", "Buttons (Swift)"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class ButtonsSwiftAndStoryboardController: UIViewController {

extension ButtonsSwiftAndStoryboardController {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Buttons", "Buttons (Swift and Storyboard)"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class FloatingButtonExampleSwiftViewController: UIViewController {

extension FloatingButtonExampleSwiftViewController {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Buttons", "Floating Action Button (Swift)"],
"primaryDemo": false,
Expand Down
2 changes: 1 addition & 1 deletion components/Cards/examples/CardExampleViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class CardExampleViewController: UIViewController {

extension CardExampleViewController {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Cards", "Card (Swift)"],
"description": "Cards contain content and actions about a single subject.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ class EditReorderCollectionViewController: UIViewController,

extension EditReorderCollectionViewController {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Cards", "Edit/Reorder"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class EditReorderShapedCollectionViewController: UIViewController,

extension EditReorderShapedCollectionViewController {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Cards", "Shaped Edit/Reorder"],
"primaryDemo": false,
Expand Down
2 changes: 1 addition & 1 deletion components/Cards/examples/ShapedCardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ class ShapedCardViewController: UIViewController {
@available(iOS 9.0, *)
extension ShapedCardViewController {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Cards", "Shaped Card"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class ChipsFieldDeleteEnabledViewController : UIViewController, MDCChipFieldDele
}
// MARK - Catalog by Convention
extension ChipsFieldDeleteEnabledViewController {
class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs" : ["Chips", "Chips Input Delete Enabled (Swift)"],
"primaryDemo" : false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class CollectionsSimpleSwiftDemo: MDCCollectionViewController {
// MARK: Catalog by convention
extension CollectionsSimpleSwiftDemo {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": [ "Collections", "Simple Swift Demo"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class DialogsAlertComparisonExample: UIViewController {
// MARK: Catalog by convention
extension DialogsAlertComparisonExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Dialogs", "Alert Comparison"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ private extension MDCButton {
// MARK: Catalog by convention
extension DialogsAlertCustomizationExampleViewController {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Dialogs", "Alert Customization"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class DialogsCustomShadowExampleViewController: UIViewController {

// MARK: Catalog by convention

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Dialogs", "View with Corner Radius"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class DialogsLongAlertExampleViewController: UIViewController {
// MARK: Catalog by convention
extension DialogsLongAlertExampleViewController {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Dialogs", "Swift Alert Demo"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class DialogsThemedPresentationExampleViewController: UIViewController {

extension DialogsThemedPresentationExampleViewController {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Dialogs", "Dialog Presentation Controller Theming"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class DialogsWithEmphasisButtonExampleViewController: UIViewController {

extension DialogsWithEmphasisButtonExampleViewController {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Dialogs", "Dialog with Themed Emphasis Buttons"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class FeatureHighlightSwiftViewController: UIViewController {

extension FeatureHighlightSwiftViewController {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Feature Highlight", "Feature Highlight (Swift)"],
"primaryDemo": false,
Expand Down
2 changes: 1 addition & 1 deletion components/List/examples/BaseCellExample.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ extension BaseCellExample: UICollectionViewDataSource {
// MARK: Catalog By Convention
extension BaseCellExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["List Items", "MDCBaseCell Example (Swift)"],
"description": "MDCBaseCell Example (Swift)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ private class ModalViewController: UIViewController {

extension MaskedTransitionTypicalUseSwiftExample {
// MARK: - CatalogByConvention
class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs" : [ "Masked Transition", "Masked Transition (Swift)" ],
"description" : "Examples of how the Floating Action Button can transition to other "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import MaterialComponents.MaterialNavigationBar
extension NavigationBarTypicalUseSwiftExample {

// (CatalogByConvention)
class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Navigation Bar", "Navigation Bar (Swift)"],
"primaryDemo": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class ExpandFullscreenContentViewController: UITableViewController {

extension BottomDrawerExpandFullscreenExample {

class func catalogMetadata() -> [String: Any] {
@objc class func catalogMetadata() -> [String: Any] {
return [
"breadcrumbs": ["Navigation Drawer", "Expand to Fullscreen Example"],
"description": "Navigation Drawer",
Expand Down
Loading

0 comments on commit c56d5d7

Please sign in to comment.