A priori does not mean "previous". That is, we don't get logical/metaphysical rules before physical/empirical knowledge. The Kantian a priori essentially means "necessary for".
Instead, both types of knowledge, a priori and a posteriori, are developed simultaneously. That was Kant's essential contribution to empiricism and rationalism.
The confusion with "previous" probably comes from this fact which is effectively related with time: at some point in time, a priori knowledge can be enough, and stop developing, while a posteriori keep developing (e.g. you already know the rules of arithmetics, you don't need to learn more arithmetics, but you continue adding numbers every day). So, in relationship to the amount of knowledge, a priori is developed relatively before a posteriori. But such is a loose interpretation.
Consider the following example, to gather the notion of their simultaneity.
It is necessary to experience the interaction to spherical objects, as an apple, in order to develop the a priori concept of sphere, and so, being able to know the actual apple. Without the notion of sphere, it is impossible to know the form of an apple, because there wouldn't be no reference form to compare to that of the apple. How can you know what is a line, if you don't know what IS NOT a line? Without such knowledge, an apple might take the form of a line, and that's not an apple: you still don't get a posteriori knowledge. A posteriori knowledge (an apple) is possible only if the a priori = necessary knowledge for knowing an apple exists.
That simple exercise shows that, while touching and experiencing physical bodies in the world, knowledge of geometric forms is developed in parallel. The same happens to all types of knowledge in the Transcendental Aesthetic and the Transcendental Analytic.
A personal speculation: I would consider instinctive newborn reflex as a form of a priori knowledge, but, again, not because it occurs before acquiring aesthetic or analytic a prioris: the mechanics of living (and non-living) entities have been developed simultaneously to all nature. Such mechanisms express a tendency for existence (an analog to a priori knowledge), simultaneously to the systemic and interactive behavior of nature (an analog to a posteriori knowledge).