While Apple introduced the M1 in 2020, they just stopped selling M1 Airs in March 2024 (still available to education when I checked last month). The M1 is such an amazing chip that Apple sold as new products for nearly 4 and a half years. (M1 mini was available through January 2023) Relax. You have a lot of time left on the M1. Let's do some napkin math.
Let's assume a 2020 M1 Air was purchased in early March 2024 before Apple removed it from the retail store. That unit could have been purchased with a 3 year AppleCare. This means the M1 model classes will be supported through at minimum March 2027 (to allow the 3-year AppleCare to run out). Generally, you can add 2 additional years which likely will push the unit into 2029. And then, there could still be two years beyond that for the -1 and -2 OS version (when Apple drops a model from current OS support, it still receives supported updates for up to two years on the prior OS).
This being the case, and since you are just starting out, you will be fine with the M1 mini. Download Xcode and start creating. The extra RAM is fortuitous. The 256 GB storage may be constraining if you are working on a lot of projects and have a lot of local data. But don't make storage a concern until it needs to be. And when it is, just offload to external storage or the cloud.
Oh, and if you are not aware, Stanford University provides the iOS development class online for free. https://cs193p.sites.stanford.edu/2023.
Hope this is helpful and best of luck on your journey.