Three AppCode plugins for Swift development

There are a lot of helpful plugins in AppCode plugin repository – such as, for example, the Markdown support. Today we will take a look at three plugins dedicated to Swift development.

SwiftLint

SwiftLint is a static analysis tool by Realm that helps you enforce Swift style and conventions in your project. You can use it in AppCode in the same way as in Xcode, by adding the corresponding build phase into your project settings. However, it may be easier to configure it once for all projects. To do that, install the SwiftLint plugin directly from Preferences | Plugins:
SwiftLint
Restart AppCode and open Preferences | Tools | SwiftLint. Here you can set the path for the SwiftLint executable (default is /usr/local/bin/swiftlint), select if you want the Autocorrect quick-fix to appear for each SwiftLint warning, or disable SwiftLint if there is no .swiftlint.yml in the root folder of your project:

SwiftLint preferences
Finally, you should be able to see SwiftLint diagnostic messages right in your code editor window and be able to invoke swiftlint autocorrect for the current file using the Autocorrect quick-fix:
Autocorrect

Swift Mock Generator

Swift Mock Generator
This awesome plugin automatically generates mock classes for Swift protocols and has the following features:

  • Captures invocation status of a method.
  • Captures invoked method parameters.
  • Stubs values for your mocks to return.
  • Automatically calls closure parameters with stubbed values.
  • Supports mocks conforming to one or many protocols.
  • Handles overloaded method declarations.
  • Regenerates your mock in one action.
  • Supports associated types.
  • Respects public mocks and makes queries publicly available.

Read the full overview of its functionality here.

Swiftify

Swiftify is a paid tool that aims to be a full-featured Objective-C to Swift converter. Now you can configure and use it directly in AppCode by installing the plugin by the Swiftify team. Enter your API key in Preferences | Tools | Swiftify:
Swiftify preferences
Check the Tools | Swiftify menu and convert some code:
Convert to Swift
That’s it! Of course, you can set the shortcut for each Swiftify action in Preferences | Keymap:
Swiftify actions
Using any other useful plugins with AppCode? Tell us about them in the comments section below, and we’ll include it in the next blog post about plugins.

Your AppCode team
JetBrains
The Drive to Develop

Posted in Tips'n'Tricks | Tagged , | Leave a comment

New AppCode 2017.2 EAP: documentation fixes and first part of Xcode 9 support

AppCode 2017.2 EAP (build 172.3095.17) is available for download on our site (if using previous 2017.2 EAP build, the patch update is also available).

The most important part of the new functionality included into this EAP is the initial support for the new documentation format introduced in Xcode 8 (OC-13906):
Quick documentation
Note, that some issues still exist and we are working on them.

In addition, this build delivers the following Xcode 9 support fixes:

  • Fix for the simulator startup (OC-15651)
  • Support for multiple simulators running simultaneously (OC-15669)

Besides, now completion of raw enum cases and global/static constants in Swift includes the value preview:
value_completion@2x
For the full list of fixes please see the release notes.

Your AppCode team
JetBrains
The Drive to Develop

Posted in Announcement | Tagged , | 1 Comment

AppCode 2017.2 EAP: type hints in Swift, fixes for override/implement and more

Hi everyone,

AppCode 2017.2 EAP (build 172.2953.16) is available for download on our site (if using previous 2017.2 EAP build, the patch update is also available). Let’s see what’s on board!

Swift

Inline type hints

This build brings a handy feature for Swift language – type hints in the editor. Hints are displayed for variables which have no explicit type annotation:

Type hints

Type hints are disabled by default and can be enabled globally via Preferences | Editor | General | Appearance | Show Swift type hints.

There is also an option to toggle type hints on/off in the file you’re currently working on without touching global preference: View | Active Editor | Show Type Hints.

Besides, the following issues are fixed in this build:

  • Delayed processing of extensions in resolve (OC-15539)
  • Override completion suggestions at unexpected position (OC-15507)
  • Completion list being hidden too early in certain cases (OC-15296)
  • Generated methods not respecting “keep simple methods in one line” option (OC-15309)

For the full list of fixes please see the release notes.

Your AppCode team
JetBrains
The Drive to Develop

Posted in Announcement | Tagged , | 1 Comment

New AppCode 2017.2 EAP: fixes for Run configurations and override completion

AppCode 2017.2 EAP (build 172.2656.14) is available for download on our site (if using previous 2017.2 EAP build, the patch update is also available). The following issues are fixed in this build:

  • AppCode messes up product name in Xcode schema and fails to find the product (OC-15021)
  • Run configuration: spaces are inserted into program arguments with slashes when IDE is brought to background (OC-15555)
  • Override by completion for operators doesn’t work without func
    (OC-15554)
  • Regression when type for global variable/property is not inferred after additional code changes (OC-15560)
  • Regression with open keyword clashed with the method name (OC-15569)

Besides, override/implement completion in Swift now takes into account parameter names.

The full release notes are available here.

Your AppCode team
JetBrains
The Drive to Develop

Posted in Announcement | Tagged , | Leave a comment

New AppCode 2017.2 EAP, build 172.2465.14

AppCode 2017.2 EAP (build 172.2465.14) is available for download on our site (if using previous 2017.2 EAP build, the patch update is also available). The following issues are fixed in this build:

  • AppCode only lists run destinations for the first platform in SUPPORTED_PLATFORMS (OC-14416)
  • False error highlighting for #import directives when using Swift classes from Objective-C (OC-14074)
  • Regressions in completion (OC-15540) and Override/Implement (OC-15523) in Swift
  • Issue with string literals formatting (OC-15410)
  • Issue with formatting of method arguments with keywords used as argument labels (OC-13430)
  • Problem with build messages reporting in certain case (OC-15542)

The full release notes are available by the link.

Your AppCode team
JetBrains
The Drive to Develop

Posted in Announcement | Tagged , | Leave a comment

New AppCode 2017.2 EAP, build 172.2273.3

AppCode 2017.2 EAP (build 172.2273.3) is available for download on our site (if using previous 2017.2 EAP build, the patch update is also available). This build delivers the following new features:

  • SE-0112: Improved NSError Bridging (OC-14141)
  • New Swift code style option: keep simple methods and functions in one line (OC-15212). Find it in Preferences | Editor | Code Style | Swift | Wrapping and Braces | Keep when reformatting section

The following issues are fixed in this build:

  • SourceKit annotations do not work under certain conditions (OC-15482)
  • Cannot stop build with keyboard or menu (IDEA-168849)

The full release notes are available here.

Your AppCode team
JetBrains
The Drive to Develop

Posted in Announcement | Tagged , | 1 Comment

AppCode 2017.2 EAP: override/implement via completion and new intentions in Swift, __auto_type support and more!

Hi everyone,

Today we are starting the Early Access Program for AppCode 2017.2. The first build is already available on our site, so let’s see what’s on board!

Swift

Override/Implement via completion

This build brings one of the long-awaited features from our roadmap – Swift override/implement via completion in the editor! Just type the name of the entity you need to override or implement, select it in the completion list and have the corresponding stub automatically generated by AppCode:
Override completion

Intention for required protocol methods

In AppCode you can implement required protocol methods for the class derived from a protocol. Simply press ⌥ ⏎ on the Objective-C class name:
Implement intention
The same functionality is now available for Swift protocols:
Override intention Swift

Code style

Now settings for blank lines between properties and methods can be configured separately for classes and protocols:
Blank line settings
Besides, you can toggle spaces within braces in Swift code using Editor | Code Style | Swift | Spaces | Within | Code braces.

Objective-C

__auto_type support

AppCode is now able to parse __auto_type expressions in Objective-C/C/C++ and shows the __auto_type keyword in the completion list:
Auto type

Other

The following major issues are fixed in this build:

  • Problem with enum completion in Swift (OC-15192)
  • Regression in resolve for Swift initializer calls (OC-15286)

That’s it! For the full list of fixes please see the release notes.

Your AppCode team
JetBrains
The Drive to Develop

Posted in Announcement | Tagged , | Leave a comment

AppCode starts 2017.1.2 EAP

Today we are starting the Early Access Program for AppCode 2017.1.2, a bug-fix update to the recently released AppCode 2017.1. Build 171.4249.35 is now available for download on our confluence page.

The following issues are fixed in this build:

  • Incorrect reporting of Kiwi tests with Xcode 8.3 (OC-15261)
  • Broken code insight when __has_include() argument is not a header (OC-15329)

Besides, AppCode now correctly handles Clang 8.1 bundled in Xcode 8.3 (OC-14952) and provides support for type(of:) as a part of standard Swift library for Swift 3.1 (OC-15313).

The full list of fixes and improvements can be found here.

Your AppCode team
JetBrains
The Drive to Develop

Posted in Announcement | Tagged , | 6 Comments

New video: What’s New in AppCode 2017.1

Hi,

Video about new features and improvements in AppCode 2017.1 is here!

Your AppCode team
JetBrains
The Drive to Develop

Posted in Announcement | Tagged , | Leave a comment

AppCode 2017.2 Roadmap

Hi everyone,

Today we are ready to share our future plans for AppCode 2017.2.

Please note this is a preliminary plan, so not all features listed below may be included in AppCode 2017.2.

We are going to work on the following areas:

  • Swift:
    • Swift 3 and upcoming Swift 3.x support tasks
    • Resolution improvements
    • Override/Implement via completion (OC-13342)
    • Access modifiers in resolution (OC-10954)
    • Extract method/function (OC-12049)
  • Objective-C and mixed code:
  • Xcode 8.x support tasks (OC-13906, OC-14170)
  • Navigation improvements for projects with multiple targets (OC-9050 and related)

We are planning to open 2017.2 EAP at the end of April. If you have any suggestions or questions, feel free to share them in the comments below.

Your AppCode team
JetBrains
The Drive to Develop

Posted in Announcement | Tagged , | 12 Comments