Xcode 6 with Swift super slow typing and autocompletion

后端 未结 11 1289
广开言路
广开言路 2020-11-30 19:05

Is it just me or Xcode 6 (6.0.1) with Swift seems to be super slow when you type your code, especially with autocompletion?

A normal Objective-C cla

11条回答
  •  Happy的楠姐
    2020-11-30 19:34

    I had the same issues even in Xcode 6.3

    • super slow autocompletions
    • super slow indexing
    • enormous CPU usage by swift and SourceKitService
    • enormous Memory usage by SourceKitService

    All this was happening even in relatively small project. I tried all the fixes I could find:

    • deleting ~/Library/Developer/Xcode/DerivedData/*
    • deleting ~/Library/Caches/com.apple.dt.Xcode/*
    • remove all "+" String combining from the code
    • removed all suspicious dictionary declarations

    None of these actually helped in my project.

    What actually solved my problem was:

    • placing each end every class in its own file
    • placing each and every extension in its own file (Class+ExtName.swift)
    • placing "out of class swift methods" in its own file

    Now I have close to zero CPU usage, low memory usage, and decently fast completions.

提交回复
热议问题