Skip to content

Instantly share code, notes, and snippets.

@pilky
Created July 7, 2017 17:21
Show Gist options
  • Save pilky/727d3138c5f4de59fee45824b104a236 to your computer and use it in GitHub Desktop.
Save pilky/727d3138c5f4de59fee45824b104a236 to your computer and use it in GitHub Desktop.
//Obj-C
typedef NSString * ABCMessageField NS_STRING_ENUM;
extern ABCMessageField const ABCMessageFieldSubject;
extern ABCMessageField const ABCMessageFieldFrom;
//Expected Swift (according to https://developer.apple.com/library/content/documentation/Swift/Conceptual/BuildingCocoaApps/InteractingWithCAPIs.html#//apple_ref/doc/uid/TP40014216-CH8-ID17)
struct ABCMessageField: RawRepresentable {
typealias RawValue = String
init(rawValue: RawValue)
var rawValue: RawValue { get }
static var subject: ABCMessageField { get }
static var from: ABCMessageField { get }
}
//Actual Swift
public struct ABCMessageField : RawRepresentable, Equatable, Hashable, Comparable {
public init(rawValue: String)
}
public static let subject: ABCMessageField
public static let from: ABCMessageField
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment