ProtocolDecl - XcodeExtKit/XcodeExtBase GitHub Wiki
ProtocolDecl
(public) protocol CatP { var name: Str {get set} funcs inits } + extensions
public struct ProtocolDecl: AnyTypeDeclP
Inheritance
Initializers
init(name:properties:funcInterfaces:initInterfaces:exts:_:)
init(name: Str, properties: [Arg] = [], funcInterfaces: [FuncInterface] = [], initInterfaces: [InitInterface] = [], exts: [ExtDecl] = [], _ access: AccessMod? = nil)
Properties
name
type name
var name: Str
properties
by default only getter is required "{get}"
var properties: [Arg]
funcInterfaces
var funcInterfaces: [FuncInterface]
initInterfaces
var initInterfaces: [InitInterface]
access
var access: AccessMod?
exts
var exts: [ExtDecl]
Methods
str(usesTabs:tabIndent:)
Makes full protocol declaration (public) protocol CatP properties, format: { var name: Str {get set} } funcs, inits, extensions
func str(usesTabs: Bool = false, tabIndent: Int = 4) -> Str
initInterfaceStr(_:usesTabs:tabIndent:)
makes a list of protocol initializer declarations with , separated by 2 newlines and prefixed with indent only to use in protocols
func initInterfaceStr(_ interfaces: [InitInterface], usesTabs: Bool = false, tabIndent: Int = 4) -> Str
funcInterfaceStr(_:usesTabs:tabIndent:)
makes a list of protocol function declarations with , separated by 2 newlines and prefixed with indent only to use in protocols
func funcInterfaceStr(_ interfaces: [FuncInterface], usesTabs: Bool = false, tabIndent: Int = 4) -> Str
propertyStr(_:withSetters:usesTabs:tabIndent:)
makes a list of protocol property declarations with { get (set) } separated by 2 newlines and prefixed with indent used by protocol - to add "var property name: Type {get set}"
func propertyStr(_ properties: [Arg], withSetters: Bool = false, usesTabs: Bool = false, tabIndent: Int = 4) -> Str