The toddler was swinging on the hammock