Prep the pan and oven. Heat oven to 350°F (175°C).
Grease and line a 9-inch square pan with parchment, leaving overhang for easy lifting.
Make the apple filling. In a skillet over medium heat, melt butter. Add apples, sugar, cinnamon, lemon juice, vanilla, and salt. Cook 4–6 minutes, stirring, until apples soften and release juices.
Remove from heat and cool slightly.
Stir together the cinnamon swirl. In a small bowl, mix brown sugar and cinnamon. Set aside.
Mix the dry ingredients. In a medium bowl, whisk flour, baking powder, baking soda, and salt.
Cream butter and sugar. In a large bowl, beat butter and granulated sugar until light and fluffy, about 2 minutes. Add eggs one at a time, beating well.
Mix in vanilla.
Combine wet and dry. Add half the dry ingredients to the butter mixture; mix just to combine. Add buttermilk; mix briefly. Add remaining dry ingredients; mix until no dry streaks remain.
Do not overmix.
Layer the cake. Spread half the batter into the pan. Spoon half the apples evenly over the batter, avoiding excess liquid. Sprinkle half the cinnamon-sugar over the apples.
Repeat the layers. Add remaining batter in dollops, spreading gently.
Top with the rest of the apples and cinnamon-sugar. Use a butter knife to gently swirl the top layer a few times.
Bake. Bake 35–45 minutes, until the top is golden and a toothpick comes out with a few moist crumbs (avoid testing only in the apple pockets).
Make the glaze. Whisk powdered sugar, milk, vanilla, and salt until smooth and pourable.
Glaze warm cake. Cool cake in the pan 10 minutes, then poke a few holes with a skewer. Drizzle glaze over the warm cake so it sinks in.
Cool at least 20 minutes more before slicing.