Postsynthetic N-methylation making a metal-organic framework responsive to alkylamines.