xcode-extension

Can an Xcode Source Editor Extension prompt the user for input?

主宰稳场 提交于 2019-12-11 15:52:19
问题 Simple question. I've written an Xcode Source Editor Extension and as part of one of my commands, I have to prompt the user for input to know which option they want. I'm hoping there's a simple way to present an alert, but I'm guessing that's not the case and I'll have to instead launch the app from the extension (via URL schemes), then use inter-process communications. Like I said, hoping I'm wrong. So am I? 回答1: There is no way to prompt the user. I wanted something similar where I wanted

Xcode 8 Extension disabled

徘徊边缘 提交于 2019-12-10 13:29:25
问题 I tried to create new Xcode 8 Source Editor Extension , but for some reason basic examples are always disabled (screenshot) for me and I am not sure whether it is some bug with beta version or I am missing something. So I created almost basic extension like from WWDC video and sample tutorials, and for some reason this menu item is always disabled. I ran sudo /usr/libexec/xpccachectl in Terminal and reboot the Mac. I am using 10.11.5 Mac OS. Also I tested working examples from github like

Xcode 8 extension executing NSTask

故事扮演 提交于 2019-12-08 16:09:45
问题 My goal is to create an extension that executes clang-format. My code looks something like this: - (void)performCommandWithInvocation:(XCSourceEditorCommandInvocation *)invocation completionHandler:(void (^)(NSError * _Nullable nilOrError))completionHandler { NSError *error = nil; NSURL *executableURL = [[self class] executableURL]; if (!executableURL) { NSString *errorDescription = [NSString stringWithFormat:@"Failed to find clang-format. Ensure it is installed at any of these locations\n%@"