Xcode 11 Won’t Open New Editor Pane

Ok, this is embarrassing. I was in a ‘focus’ mode and could only add editors after I had ‘hidden focus’. There are a few ways to do this: View > Editor > Hide Focus Tap the ‘arrows pointing at each other’ icon in the top left of the editor toolbar ^⇧⌘↩︎ ps. I was seriously … Read more

Shouldn’t NSUserDefault be clean slate for unit tests?

Using named suites like in this answer worked well for me. Removing the user defaults used for testing could also be done in func tearDown(). class MyTest : XCTestCase { var userDefaults: UserDefaults? let userDefaultsSuiteName = “TestDefaults” override func setUp() { super.setUp() UserDefaults().removePersistentDomain(forName: userDefaultsSuiteName) userDefaults = UserDefaults(suiteName: userDefaultsSuiteName) } }

Creating groups using a custom template xcode 8

In case this helps someone, here’s a project template that works with Xcode 12.4: <key>Nodes</key> <array> <string>ViewController.swift:comments</string> <string>ViewController.swift:imports:importCocoa</string> <string>ViewController.swift:implementation(___FILEBASENAME___: UIViewController)</string> <string>ViewController.swift:implementation:methods:viewDidLoad(override func viewDidLoad(\))</string> <string>ViewController.swift:implementation:methods:viewDidLoad:super</string> <string>Info.plist:UIMainStoryboardFile</string> <string>Info.plist:UIApplicationSceneManifest:UISceneStoryboardFile</string> <string>Some/MainCoordinator.swift</string> <string>Some/Other/TestClass.swift</string> </array> <key>Definitions</key> <dict> <key>Some/MainCoordinator.swift</key> <dict> <key>Group</key> <array> <string>Some</string> </array> <key>Path</key> <string>MainCoordinator.swift</string> </dict> <key>Some/Other/TestClass.swift</key> <dict> <key>Group</key> <array> <string>Some</string> <string>Other</string> </array> <key>Path</key> <string>TestClass.swift</string> </dict> </dict> The group is Some. … Read more

‘Class FIFinderSyncExtensionHost is implemented in both …’ warning in Xcode since update to macOS High Sierra

There’s nothing you can do about this. It’s an Apple problem, but it’s probably harmless. Note: I’m not sure what other description could be given than what the warning says. It just means that the same class is defined in two modules. With Apple stuff, they’re often identical so it doesn’t matter which copy is … Read more