2 Replies
      Latest reply on Oct 18, 2019 6:08 AM by mrugesh
      mrugesh Level 1 Level 1 (0 points)

        How i can Erase My Draw Line. i m Create app like Paint so I'm Drawing line in canvas and i want to remove my line in cavas mode so how i can

        note: my backround is transfranat

        • Re: How I can Erase my Draw line in macOS using cocoa not in iOS
          Claude31 Level 8 Level 8 (6,995 points)

          Could you give more information ?

           

          And post the code where you draw the line that you want to erase.

            • Re: How I can Erase my Draw line in macOS using cocoa not in iOS
              mrugesh Level 1 Level 1 (0 points)

              I am using swift 4 version and below is the code for line using the nsbezierpath.

               

              private let StartPoint: CGPoint

                

                  override var actionName: String {

                      return Copy("renderable.type.Singal")

                  }

                

                  required init(center: CGPoint) {

                     // self.startpoint1 = center

                      self.StartPoint = center

                      let newPath = NSBezierPath()

                    

              //        newPath.move(to: StartPoint)

                    

                      super.init(path: newPath)

                      lineWidth = 3

                  }

                

                  override func mouseMoved(to point: CGPoint) {

                              super.mouseMoved(to: point)

                      let newPath1 = NSBezierPath()

                      newPath1.move(to: self.StartPoint)

                      newPath1.line(to: point)

                      path = newPath1

                  }

               

              Store this methods to my chlid class and setting the chlid class objecte to the parentclass that hold the path line points array and store into the class object.