Swift Error: Editor placeholder in source file

后端 未结 7 694
长发绾君心
长发绾君心 2020-12-06 03:39

Hello I am implementing a graph data structure. When I try to build the application the I get the error \"Editor placeholder in source file\"

The full graph implemen

7条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-06 04:37

    you had this

    destination = Node(key: String?, neighbors: [Edge!], visited: Bool, lat: Double, long: Double)
    

    which was place holder text above you need to insert some values

    class Edge{
    
    }
    
    public class Node{
    
      var key: String?
      var neighbors: [Edge]
      var visited: Bool = false
      var lat: Double
      var long: Double
    
      init(key: String?, neighbors: [Edge], visited: Bool, lat: Double, long: Double) {
        self.neighbors = [Edge]()
        self.key = key
        self.visited = visited
        self.lat = lat
        self.long = long
      }
    
    }
    
    class Path {
    
      var total: Int!
      var destination: Node
      var previous: Path!
    
      init(){
        destination = Node(key: "", neighbors: [], visited: true, lat: 12.2, long: 22.2)
      }
    }
    

提交回复
热议问题