Shyamalan conceived of the idea for Split years, even far back to before The Sixth Sense, before he actually wrote the screenplay, which kept untouched until recently. Having found the perfect time, Shyamalan finally decided to breathe new life into it when started to work on the script. Shyamalan then decided to re-team with producer Jason Blum, who produced Shyamalan's previous film The Visit (2015), and presented the script to Blum. Originally, Joaquin Phoenix was cast in the lead role. However, due to scheduling conflicts and not being able to reach a contractual agreement, James McAvoy was cast instead in October 2015. In the same month, Anya Taylor-Joy, Betty Buckley, Jessica Sula, and Haley Lu Richardson were added to the cast. In addition, Universal Pictures came on board to release the film and the film's title, Split, was announced. Principal photography on the film began in November 2015 in Shyamalan's hometown of Philadelphia, Pennsylvania.