Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode lagging in large swift files

Why does Xcode lag in large files and does anyone know how to stop this?

I have a .swift file which is 8,000+ lines of code and when I try to modify the file Xcode changes my cursor into a beachball and lags.

Does anyone know why this happens or how to fix it without breaking the file up into smaller pieces?

like image 458
Petri Avatar asked Jan 19 '15 13:01

Petri


1 Answers

The last versions of Xcode are "buggy", specially with SourceKit.

Be aware that Swift is a type safe language and every time you modify something, the project code is re-analyzed. Because of that and the combination of your large app, this may be the cause of your issue.

in addition, verify that your hardware specs are "ok" for development (it may be simple as to free up memory, or may involve to upgrade your hardware)

These issues may be resolved in Xcode 6.3 + Swift 1.2.

Hope this lighted :)

like image 102
Hadrien Pierre Mazelier Avatar answered Nov 15 '22 11:11

Hadrien Pierre Mazelier