Apple has agreed to settle a class-action lawsuit alleging that the company was aware of battery swelling issues on its early Apple Watch models.