{"id":3719,"date":"2017-06-23T15:04:50","date_gmt":"2017-06-23T15:04:50","guid":{"rendered":"https:\/\/blog.jetbrains.com\/objc\/?p=5838"},"modified":"2019-01-25T16:00:44","modified_gmt":"2019-01-25T16:00:44","slug":"3-plugins-for-swift","status":"publish","type":"appcode","link":"https:\/\/blog.jetbrains.com\/fr\/appcode\/2017\/06\/3-plugins-for-swift","title":{"rendered":"Three AppCode plugins for Swift development"},"content":{"rendered":"<p>There are a lot of helpful plugins in AppCode <a href=\"https:\/\/plugins.jetbrains.com\/objc\" target=\"_blank\" rel=\"noopener\">plugin repository<\/a> &#8211; such as, for example, the <a href=\"https:\/\/plugins.jetbrains.com\/plugin\/7793-markdown-support\" target=\"_blank\" rel=\"noopener\">Markdown support<\/a>. Today we will take a look at three plugins dedicated to Swift development.<\/p>\n<h2>SwiftLint<\/h2>\n<p><a href=\"https:\/\/github.com\/realm\/SwiftLint\" target=\"_blank\" rel=\"noopener\">SwiftLint<\/a> is a static analysis tool by <a href=\"http:\/\/realm.io\" target=\"_blank\" rel=\"noopener\">Realm<\/a> 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 <a href=\"https:\/\/plugins.jetbrains.com\/plugin\/9175-swiftlint\" target=\"_blank\" rel=\"noopener\">SwiftLint plugin<\/a> directly from <code>Preferences | Plugins<\/code>:<br \/>\n<img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2017\/06\/objc-swiftlint@2x.png\" alt=\"SwiftLint\" width=\"624\" \/><br \/>\nRestart AppCode and open <code>Preferences | Tools | SwiftLint<\/code>. Here you can set the path for the SwiftLint executable (default is <code>\/usr\/local\/bin\/swiftlint<\/code>), select if you want the <strong>Autocorrect<\/strong> quick-fix to appear for each SwiftLint warning, or disable SwiftLint if there is no <code>.swiftlint.yml<\/code> in the root folder of your project:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2017\/06\/objc-swiftlint_prefs@2x.png\" alt=\"SwiftLint preferences\" width=\"624\" \/><br \/>\nFinally, you should be able to see SwiftLint diagnostic messages right in your code editor window and be able to invoke <code>swiftlint autocorrect<\/code> for the current file using the <strong>Autocorrect<\/strong> quick-fix:<br \/>\n<img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2017\/06\/objc-swiftlint@2x-1.png\" alt=\"Autocorrect\" width=\"624\" data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2017\/06\/objc-swiftlint@2x.gif\" \/><\/p>\n<h2>Swift Mock Generator<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2017\/06\/objc-mockgen@2x.png\" alt=\"Swift Mock Generator\" width=\"624\" data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2017\/06\/objc-mockgen@2x.gif\" \/><br \/>\nThis awesome plugin automatically generates mock classes for Swift protocols and has the following features:<\/p>\n<ul>\n<li>Captures invocation status of a method.<\/li>\n<li>Captures invoked method parameters.<\/li>\n<li>Stubs values for your mocks to return.<\/li>\n<li>Automatically calls closure parameters with stubbed values.<\/li>\n<li>Supports mocks conforming to one or many protocols.<\/li>\n<li>Handles overloaded method declarations.<\/li>\n<li>Regenerates your mock in one action.<\/li>\n<li>Supports associated types.<\/li>\n<li>Respects public mocks and makes queries publicly available.<\/li>\n<\/ul>\n<p>Read the full overview of its functionality <a href=\"http:\/\/seanhenry.codes\/ios\/swift-mock-generator-for-appcode-automatically-generate-your-swift-mocks\/\" target=\"_blank\" rel=\"noopener\">here<\/a>.<\/p>\n<h2>Swiftify<\/h2>\n<p><a href=\"https:\/\/objectivec2swift.com\" target=\"_blank\" rel=\"noopener\">Swiftify<\/a> 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 <a href=\"https:\/\/plugins.jetbrains.com\/plugin\/9701-swiftify\" target=\"_blank\" rel=\"noopener\">plugin<\/a> by the Swiftify team. Enter your API key in <code>Preferences | Tools | Swiftify:<\/code><br \/>\n<img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2017\/06\/objc-swiftify_prefs@2x.png\" alt=\"Swiftify preferences\" width=\"624\" \/><br \/>\nCheck the <code>Tools | Swiftify<\/code> menu and convert some code:<br \/>\n<img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2017\/06\/objc-swiftify@2x.png\" alt=\"Convert to Swift\" width=\"624\" data-gif-src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2017\/06\/objc-swiftify@2x.gif\" \/><br \/>\nThat\u2019s it! Of course, you can set the shortcut for each Swiftify action in <code>Preferences | Keymap<\/code>:<br \/>\n<img decoding=\"async\" src=\"https:\/\/blog.jetbrains.com\/wp-content\/uploads\/2017\/06\/objc-swiftify_keymap@2x.png\" alt=\"Swiftify actions\" width=\"624\" \/><br \/>\nUsing any other useful plugins with AppCode? Tell us about them in the comments section below, and we\u2019ll include it in the next blog post about plugins.<\/p>\n<p><em>Your AppCode team<br \/>\nJetBrains<br \/>\nThe Drive to Develop<\/em><\/p>\n","protected":false},"author":437,"featured_media":0,"comment_status":"open","ping_status":"open","template":"","categories":[601],"tags":[743,41,445],"cross-post-tag":[],"acf":[],"_links":{"self":[{"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/appcode\/3719"}],"collection":[{"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/appcode"}],"about":[{"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/types\/appcode"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/users\/437"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/comments?post=3719"}],"version-history":[{"count":0,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/appcode\/3719\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/media?parent=3719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/categories?post=3719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/tags?post=3719"},{"taxonomy":"cross-post-tag","embeddable":true,"href":"https:\/\/blog.jetbrains.com\/fr\/wp-json\/wp\/v2\/cross-post-tag?post=3719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}