Swift. Declaring private functions in internal protocol

前端 未结 2 1477
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-13 02:34

How can I achieve something like this (doesn\'t compile):

internal protocol InternalPrivateMix {
    private func doPrivately()
    internal func doInternaly         


        
2条回答
  •  旧时难觅i
    2021-01-13 03:11

    From Apple's docs it looks like the only way to achieve what you are trying to do is to implement 2 protocols - one internal, and one private, as Apple states "You cannot set a protocol requirement to a different access level than the protocol it supports."

提交回复
热议问题