I know that with at least the elementaryOS 5.0 "Juno" install media you are able to create custom partition tables.
Proceed through the installation wizard, and when you get to the "Installation Type" screen, select "Something else."

From here you can add/remove/change partitions.

If you're using a different version or are used to using other tools, you could consider partitioning the disk first, and then install the OS later.
For example, with the elementaryOS 5.0 install disk:
- Boot from the installation media and select "Try elementaryOS without installing" from the menu.

- Run GParted and create the partitions exactly as you'd like. If you'd only like to create the swap partition, then you could do that and point the installer at it later. In this example, I'm creating a 2GB swap partition at the end of the disk.
Note: GParted is included with the live distro by default (at least in 5.0 Juno), but some people prefer to use Gnome-Disk-Utilities. You can install it from the command line with sudo apt install gnome-disk-utility
.
- Save the partition table changes and reboot the PC
- Proceed through the installation wizard, and when you get to the "Installation Type" screen, select "Something else."
From here you can add/remove/change partitions.

Also as a side note, it may not be necessary to set the swap as double your RAM.
Abhishek Prakash over at It's Foss recently wrote an article about swap file sizing that you might want to check out. The short version is that RedHat, CentOS, and Ubuntu suggest slightly different calculations. Since elementaryOS is Ubuntu-derived, here's what he says Ubuntu recommends:
If hibernation is used, swap size should be equal to size of RAM plus the square root of the RAM size
Check the article for a table containing examples with common RAM sizes if you don't have to worry about performing the calculation yourself.