Preheat your oven to 350°F (175°C) and grease a 9x5 inch loaf pan.
In a bowl, whisk together flour, baking powder, baking soda, cinnamon, and salt.
In another bowl, cream the softened butter and sugar until light and fluffy.
Add the eggs one at a time, mixing well after each addition.
Stir in the vanilla extract.
Gradually add the dry ingredients to the wet mixture, mixing until just combined.
Fold in the diced apples and walnuts, if using.
Pour the batter into the prepared loaf pan.
Bake for 50-60 minutes or until a toothpick inserted into the center comes out clean.
Let the bread cool before slicing and serving.