-1
Objective-CコードをSwiftコードに移行しようとしていますが、Swiftにプロトコルエラーがあります。私のObjective-Cでは、すべてが完璧に動作します。私は1つのクラスを持っているプロトコルを定義して使用することができません
は私スウィフトクラスで
public class MGCDayPlannerEKViewController : MGCDayPlannerViewController, UIPopoverPresentationControllerDelegate {
public var calendar: NSCalendar!
public var visibleCalendars: Set<NSObject>!
public var eventStore: EKEventStore! { get }
weak public var delegate: MGCDayPlannerEKViewControllerDelegate!
/** designated initializer */
public init!(eventStore: EKEventStore!)
public func reloadEvents()
}
public protocol MGCDayPlannerEKViewControllerDelegate : NSObjectProtocol {
@available(iOS 4.0, *)
optional public func dayPlannerEKEViewController(vc: MGCDayPlannerEKViewController!, willPresentEventViewController eventViewController: EKEventViewController!)
@available(iOS 4.0, *)
optional public func dayPlannerEKViewController(vc: MGCDayPlannerEKViewController!, navigationControllerForPresentingEventViewController eventViewController: EKEventViewController!) -> UINavigationController!
}
が、私はこのクラスを継承し、また私の新しいクラス
protocol WeekViewControllerDelegate :MGCDayPlannerEKViewControllerDelegate,CalendarViewControllerDelegate,UIViewControllerTransitioningDelegate {
}
class WeekViewController: MGCDayPlannerEKViewController {
var delegate: WeekViewControllerDelegate?
var showDimmedTimeRanges = false
var isiPad : Bool {
if UIDevice.currentDevice().userInterfaceIdiom == .Pad {
return true
}else{
return false
}
}
}
内のプロトコルを作成するしかし、私はここでエラーを取得しています午前、MGCDayPlannerEKViewControllerを言いますデリゲート宣言で。エラーは
Property 'delegate' with type 'WeekViewControllerDelegate?' cannot override a property with type 'MGCDayPlannerEKViewControllerDelegate!' (aka 'ImplicitlyUnwrappedOptional<MGCDayPlannerEKViewControllerDelegate>')
私は間違っていますか?