Type 'Boolean' does not conform to protocol 'BooleanType'

后端 未结 2 588
既然无缘
既然无缘 2020-12-07 01:39

In attempting to create a Launch Helper as per the Apple docs (and tutorial-ized), I seem to be hitting a hiccup caused by porting the Objective-C code into Swift... who\'s

2条回答
  •  孤街浪徒
    2020-12-07 01:42

    Right, I had a similar issue trying to get the BOOL return of an objective-C method in Swift.

    Obj-C:

    - (BOOL)isLogging
    {
        return isLogging;
    }
    

    Swift:

        if (self.isLogging().boolValue)
        {
            ...
        }
    

    this was the way that I got rid of the error.

提交回复
热议问题