为什么在查看“显示结果”时Xcode Playground扩展中出现一条水平线?

问题描述 投票:-1回答:1

我正在学习Swift扩展,并在Playground中为Double编写了一个简单扩展。代码如下。

extension Double {          
    func round(to places: Int) -> Double {
        let precisionNumber = pow(10, Double(places))
        var n = self        //self contains the value of the myDouble variable
        n = n * precisionNumber
        n.round()
        n = n / precisionNumber
        return n
    }
}

var myDouble = 3.14159
myDouble.round(to: 1)

该扩展程序按计划工作,但是当我在扩展程序中的任何代码行按右列中的“显示结果”(眼睛图标)时,我看到一条水平线。

enter image description here

任何人都知道这行应表示什么?使用Xcode 11.2.1和Swift 5。

我正在学习Swift扩展,并在Playground中为Double编写了一个简单扩展。代码如下。扩展Double {func round(to place:Int)-> Double {let ...

swift swift-playground xcode11
1个回答
0
投票

这里的麻烦是您还没有露面所有操场。我的猜测是还有更多代码,您可以在其中将扩展名称为[[再次

© www.soinside.com 2019 - 2024. All rights reserved.