lundi 1 juillet 2019

Swift CustomReflectable doesn't work in separated static library

Swift CustomReflectable doesn't work if it's been implemented in separated file in separated static library.

//  BBB.swift
public struct BBB {
    public var xcv = 344
    public init() {}
}

//  BBB.mirror.swift
extension BBB: CustomReflectable {}
public extension BBB {
    var customMirror: Mirror {
        return Mirror(
            self,
            children: [
                "xxx": 342,
                "www": 999])
    }
}

How to make it work?





Aucun commentaire:

Enregistrer un commentaire