Retirement tax questions

Is it the state you are living in when you take the distribution (file paperwork) or the state you are living in when you receive the distribution (check/direct deposit received)?