I have been looking at the function definitions that XCode pops up when I type the opening parenthises of a function call - trying to understand the syntax better. I am a bit confused about whether there is a way to know if it's ok to leave the parameters out. Paul seems to leave parameters out fairly often.
An example is:
when following the Color and Frames lesson Paul types this @ 3:00
.frame(minWidth: 200, maxWidth: .infinity, maxHeight: 200)
but when I type the open parenthises XCode shows this
.frame(minWidth: CGFloat?, idealWidth: CGFloat?, maxWidth: GFloat?, minHeight: CGFloat?, idealHeight: CGFloat?, maxHeight: CGFloat?, alignment: Alignment)
I assume that Swift automagically decides optional parameters can default to nil but the last parameter, alignment, seems like it is required - however Paul leaves it out and it still works fine. I guess the developer has specified a default parameter for it - but how do I know that. I have tried searching the documentation using the app that XCode opens when selecting Developer Documentation from the Help menu but I haven't managed to get anything useful out of it - seaching for frame or .frame doesn't seem to provide any useful information.
Does anyone have any hints/tips on how to know then it's ok to leave parameters out?