From eec2be6d05479ee4a959c4cdb330acaaf7e91f48 Mon Sep 17 00:00:00 2001 From: StainlessStlRat Date: Wed, 14 Oct 2020 21:14:42 -0700 Subject: [PATCH] Update PopMenuViewController.swift Remove @objc modifiers. They cause mixed objc/swift projects to fail to compile because any class that uses the delegate won't be able to find the delegate definition in the bridge file. This is because the protocol passes PopMenuViewController but that class is not @objc compatible. Remove the @objc, remove the optional because it requires objc. It's irrelevant anyway because there is only one function, therefore anyone passing in the delegate should implement that function --- PopMenu/View Controller & Views/PopMenuViewController.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PopMenu/View Controller & Views/PopMenuViewController.swift b/PopMenu/View Controller & Views/PopMenuViewController.swift index f2507f9..5bcc4a2 100644 --- a/PopMenu/View Controller & Views/PopMenuViewController.swift +++ b/PopMenu/View Controller & Views/PopMenuViewController.swift @@ -9,9 +9,9 @@ import UIKit /// Delegate for handling PopMenu selection. -@objc public protocol PopMenuViewControllerDelegate: class { +public protocol PopMenuViewControllerDelegate: class { /// Called when an action is selected. - @objc optional func popMenuDidSelectItem(_ popMenuViewController: PopMenuViewController, at index: Int) + optional func popMenuDidSelectItem(_ popMenuViewController: PopMenuViewController, at index: Int) } final public class PopMenuViewController: UIViewController { @@ -623,7 +623,7 @@ extension PopMenuViewController { } // Notify delegate - delegate?.popMenuDidSelectItem?(self, at: index) + delegate?.popMenuDidSelectItem(self, at: index) // Should dismiss or not if shouldDismissOnSelection {