I have updated to Xcode 10 and and am unable to compile my code. I get the following error from the Facebook SDK (FacebookCore).
Argument type 'SDKLoggingBehavior?' does not conform to expected type 'Sequence'
On line
return Set(behaviors)
I have installed the lastest FBSDK using cocoapods.
How would I go about resolving this or is it a case of waiting for an updated SDK from FB?
extension SDKSettings {
/**
Current logging behaviors of Facebook SDK.
The default enabled behavior is `.DeveloperErrors` only.
*/
public static var enabledLoggingBehaviors: Set<SDKLoggingBehavior> {
get {
let behaviors = FBSDKSettings.loggingBehavior().flatMap { object -> SDKLoggingBehavior? in
if let value = object as? String {
return SDKLoggingBehavior(sdkStringValue: value)
}
return nil
}
return Set(behaviors)
}
set {
let behaviors = newValue.map({ $0.sdkStringValue })
FBSDKSettings.setLoggingBehavior(Set(behaviors))
}
}
/**
Enable a particular Facebook SDK logging behavior.
- parameter behavior: The behavior to enable
*/
public static func enableLoggingBehavior(_ behavior: SDKLoggingBehavior) {
FBSDKSettings.enableLoggingBehavior(behavior.sdkStringValue)
}
/**
Disable a particular Facebook SDK logging behavior.
- parameter behavior: The behavior to disable.
*/
public static func disableLoggingBehavior(_ behavior: SDKLoggingBehavior) {
FBSDKSettings.disableLoggingBehavior(behavior.sdkStringValue)
}
}
}