macbook pro – Can I manually sync/refresh data from iCloud

I have a MacBook Air with the Xcode app that I use to add data to an array in one of the files.

The file is saved to the desktop.

I also have a MacBook Pro with the Xcode app that I use to add data and code throughout.

The file is also saved to the desktop.

I can’t understand why or when the iCloud is syncing because sometimes I add the data to the MacBook Air and then when I open the file on the MacBook Pro I can see it update/refresh.

Sometimes I close the file on the MacBook Pro and open it up again so it can refresh the new data from iCloud.

The problem is that sometimes I can’t do anything to update/sync/refresh the data to appear on the file on the MacBook Pro.

It changes from day to day and because I haven’t been able to figure out why this happens, I want to know if there’s a way to manually refresh the data from iCloud so it syncs to my MacBook Pro when I want it to.

Please advise if there’s a way to do this.
Thanks ✌️