There are some mistakes in this chapter so if you follow according to text you will get stuck
- 
The first one is that you cannot use DrawViewas the rootview of the project asDrawViewis the instance of theUIViewnotViewControllerso you need to use the default ViewController.swift file as the root view controller
 
- 
In the ViewController.swift set the view to DrawViewlike this
 override func loadView() { super.loadView() drawView = DrawView() view = drawView view.backgroundColor = UIColor.white }
 
- 
You need to create a constructor in the Line.swift file like this
 init(begin: CGPoint, end: CGPoint){ self.begin = begin self.end = end }
 
 
            
              
              
              
            
            
           
          
            
            
              I disagree. I think the chapter is correct.
- You’re asked to select the viewof the view controller, notViewControlleritself. When you do so, you can select a custom class that is a subclass ofUIView. To make sure you’re selecting the view and not the view controller, select the view from the Document Outline. If properly selected, when you click on the Identity Inspector, you should seeUIViewgreyed out as the default value for the Custom Class.
- Follow the previous point and you avoid setting up ViewController.viewin theViewController.swiftfile.
- As mentioned in the book, structs get a member-wise initializer if no other initializers are declared. If you remove that declaration, you get it for free. See “Memberwise Initializers for Structure Types” under The Swift Programming Language: Classes and Structures.
 
            
              
              
              1 Like
            
            
           
          
            
            
              Agree with you. And even add that in the solution discussed in the book everything is out of the box because if you set custom view to the root view in storyboard you don’t need to write a line of code to get the default view configuration and structs have built-in memberwise initializers.