I've tried these commands in OS X El Capitan, but it doesn't work:
$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist
$ sudo rm /private/var/vm/swapfile*
$ sysctl vm.swapusage
vm.swapusage: total = 2048.00M used = 596.00M free = 1452.00M (encrypted)
I have 16GB of RAM and 256GB SSD, I just don't want the SSD to tear down faster just because I enable the swapfile.