Taylor Swift was dating Harris when the song This Is What You Came For was written .
On 13 July 2016 , TMZ reported that the track was written with Harris 's girlfriend Taylor Swift , who used the pseudonym Nils Sjöberg because they did not want their relationship to overshadow the song .
This Is What You Came For