Hi everyone. I'm new to using Xcode and this is my first time coding. I'm currently following some tutorials that require this coding to create a rectangle:
let canvas = UIView(frame: CGRectMake(0, 0, 200, 200)). I know that CGRectMake was removed from xcode so I changed my code to
let canvas = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: 200))
I'm getting a swift compiler warning of 'editor placeholder in source file'. Can someone tell me how to fix this and why i'm getting it?
When you insert code via autocompletion (or via a code snippet, sometimes), there may be placeholders — blue rectangles that describe what you should put there instead. You can click on a placeholder to select it, then type your actual code.
For example (I'm guessing) when you typed "UIView(", you inserted a complete call, but with a "CGRect" placeholder where the rect was supposed to go. If you put the rect parameters after the placeholder without replacing it, you'd get this error message. You should have replaced the placeholder, not used it as code.
If that's what happened, you don't have to actually retype it in this case. If you double-click on a placeholder (or select it and press Enter), it will change to regular text.