How to draw emojis like the Lock Screen customisation?

On iOS you can create a new Lock Screen that contains a bunch of emoji, and they'll get put on the screen in a repeating pattern, like this:

When you have two or more emoji they're placed in alternating patterns, like this:

How do I write something like that? I need to handle up to three emoji, and I need the canvas as large as the device's screen, and it needs to be saved as an image. Thanks!

(I've already written an emojiToImage() extension on String, but it just plonks one massive emoji in the middle of an image, so I'm doing something wrong there.)

How to draw emojis like the Lock Screen customisation?
 
 
Q