Chop the butter with the flour and mix with a fork. Add salt, sugar and baking powder and mix little more.
Add the yolks and mix roughly only until all ingredients are incorporated and start forming a dough. Do not over mix it or the pastry will become tough. Cover dough ball in a cling film and refrigerate for at least an hour.
Peel and roughly chop the apples. Mix with the sugar, vanilla and cinnamon and slowly heat up in a pan. If you think the apples are sticking to the bottom, add a little bit of water.
Continue stewing and stirring every minute until all apples fall apart. Leave aside to cool down.
Whisk the egg whites with salt until stiff. Slowly add the sugar and whisk until glossy.
Preheat the oven to 180C (fan assisted) and prepare 26cm cake tin (square tin is perfect too).
Press about 3/4 of the cold pastry on the bottom of the tin. Prick with the fork on the whole surface. If the apples are too wet, sprinkle some breadcrumbs on the pastry to prevent it going soggy.
Layer the apples. You can sprinkle more cinnamon if you like.
Layer the meringue. Grate the rest of the pastry on top of meringue.
Bake for at least 45-50 min until top is golden. If the top is becoming too dark, cover it with the tin foil and continue to bake until the cake is done.