Reputation: 1038
How can I use AppCode for the ios-specific parts of my Flutter plugin?
I've created the plugin with flutter create --template=plugin --platforms=ios myplugin
The command doesn't generate an XCode project or workspace for the plugin itself but it includes an example app for which it does generate these. Running flutter build ios
in example
then creates symlinks to the plugin code in example/ios/.symlinks
that I can use to edit the actual Swift code with auto completion, code navigation etc. When I open these files in AppCode however, I get the below error and no coding assistance is available at all:
Upvotes: 3
Views: 466
Reputation: 28478
I previously used AppCode quite a lot to maintain some Flutter plugins' iOS code (but switched jobs and didn't need AppCode or Xcode). However, I recently started making a free app, and also wanted to contribute to a Flutter plugin for iOS, I wanted AppCode again. I got AppCode working again, so I wanted to share.
In your flutter directory:
appcode ios
appcode example/ios
(not appcode ios
)Some principles:
flutter run
or Xcode (to make sure configuration is set up).build failed
in AppCode, you should open in Xcode or build/run the flutter app for iOS: flutter run
and read the error messages.Here's an example screenshot of AppCode with debugger working. You might be curious if telemetry flag you set in Flutter was actually being set in the iOS side... maybe there's a bug. But I take privacy seriously and confirm the telemetry is disabled. I also watch network traffic sometimes. 😂. If you're interested, you can then follow that to it's dependencies (manually, using by reading package.swift
), and find out it is set to true by default.
UserDefaults.standard.register(defaults: [
#keyPath(UserDefaults.MGLMapboxMetricsEnabled): true
])
Upvotes: 0