I managed to edit the g.square.fill symbol in Sketch by also downloading f.square.fill and copying and moving around the respective paths.
I saved the sketch file and exported the new symbol as an SVG and dragged it into Xcode. Works perfectly so I have learned something new in the process. Thanks for posting the question and initiating a challenge for me. I can post the SVG file to you if you like.