Especially for Apple products I hear this a lot.
This is a myth.
You have at least three years in my opinion, apple does forecasts assuming a product lifespan of 3 years https://www.apple.com/environment/pdf/products/ipad/iPad_PER…
The Act does not state "two years" anywhere. It says goods must be lasting, that they must last a reasonable time.
Where does this myth come from?
The company I work for does Apple authorised repairs, and even though I'm not a technician I know that from time to time devices are repaired under ACL beyond 24 months. I'm not specifically aware of iPhone or iPad (although I can't exclude them based on my knowledge), but iMac and MacBook Pro screen and logic board problems most certainly are routinely covered for longer than 24 months.