<?xml version="1.0" encoding="utf-8"?>
<!-- generator="Kirby" -->
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">

  <channel>
    <title>Mot-cl&#233;: swift &#183; Blog &#183; Liip</title>
    <link>https://www.liip.ch/fr/blog/tags/swift</link>
    <generator>Kirby</generator>
    <lastBuildDate>Tue, 14 Mar 2017 00:00:00 +0100</lastBuildDate>
    <atom:link href="https://www.liip.ch" rel="self" type="application/rss+xml" />

        <description>Articles du blog Liip avec le mot-cl&#233; &#8220;swift&#8221;</description>
    
        <language>fr</language>
    
        <item>
      <title>Adobe After Effects: how to get started?</title>
      <link>https://www.liip.ch/fr/blog/adobe-after-effects</link>
      <guid>https://www.liip.ch/fr/blog/adobe-after-effects</guid>
      <pubDate>Tue, 14 Mar 2017 00:00:00 +0100</pubDate>
      <description><![CDATA[<p><em>Adobe After Effect is an option to build animations. In this blog post, I share some of the tutorials and blogpost I have read in order to get me started with After Effect.</em></p>
<h2>Animation with After Effects</h2>
<p><strong>Animations</strong>  greatly improve the overall user experience of an app. They also bring different <strong>benefits</strong>  to the user. In my last blog post about the SwiftAlps Conference, I wrote about the <strong>12 basic principles</strong> of animations in design (see the <a href="https://blog.liip.ch/archive/2016/12/20/swift-alps-conference.html">slides in the blogpost</a>). During the conference, we used  <a href="https://developer.apple.com/reference/quartzcore/caemitterlayer">CAEmitterLayer</a> from Core Animation to insert a snow background effect.</p>
<p><a href="http://www.adobe.com/ch_fr/products/aftereffects.html">Adobe After Effect</a> is another option to build animations. After Effects is a powerful tool that is used to create digital visual effects and motion graphics. This tool is mainly used in film and television production although is also popular to create UI/UX animation among designers.</p>
<figure><img src="https://liip.rokka.io/www_inarticle/adff6e843ccf9c035acc7fe8d17bb4f22857fa24/adobe-after-effects-cc-300x300.jpg" alt="Adobe After Effects Logo"></figure>
<h2>The main difference between After Effects and Swift</h2>
<p>When it comes to design complex animations, After Effects is the way to go. Being able to craft an animation in real-time with visual feedback is easier than coding an animation in Swift and having to compile each time to see the results.</p>
<p>For custom animations such as animating the characters of a logo or animating the path of an icon then I would recommend doing it first with After Effects and then importing the animation int your app. If the animations are simple such as moving a layer of changing its alpha value then I'd just user your languages animation properties.</p>
<p>The most important advantage is visual feedback. Having visual feedback you can easily tweak and iterate an animation to achieve the expected desire. Then as we will explain in a future blog post, this animation can now easily be imported to be used in your app projects.</p>
<p>Furthermore, another important advantage is that After Effects is very popular among designers and animators, that said there are many online tutorial and youtube videos with examples of probably what you are trying to achieve.</p>
<h2>Playing with After Effects</h2>
<p>To get me started I watched the following. They are two video-tutorial that explain how to animate a company logo step-by-step. They have some good basic knowledge explanations that help me understand the basics of how to start.</p>
<ul>
<li><a href="https://wistia.com/library/animate-your-logo">wistia.com/library/animate-your-logo</a></li>
<li><a href="https://helpx.adobe.com/premiere-pro/how-to/logo-animation.html">helpx.adobe.com/premiere-pro/how-to/logo-animation.html</a></li>
</ul>
<p>After that I checked on <a href="https://dribbble.com/search?q=logo+gif">dribbble</a> for some inspiration. Dribble is always a good source of inspiration. There are many examples of animations that may help you move in one direction when you don't know exactly what to do. After playing for a bit with our company logo, the animations below are example of what is possible to do with After Effect. It took me a few hours to build them.</p>
<h3>Liip Logo animation: 3 examples</h3>
<figure><img src="https://liip.rokka.io/www_inarticle/170a46a35209b1747256224e037bceaab2049a51/animation-1.jpg" alt="Liip Logo Animation"></figure>
<figure><img src="https://liip.rokka.io/www_inarticle/5dff45fb250c9057cff82b51a41d85b5e6ff07ba/animation-2.jpg" alt="Liip Logo Animation"></figure>
<figure><img src="https://liip.rokka.io/www_inarticle/27546266b363845568ad2f2cc4428ce3923ea50c/animation-3.jpg" alt="Liip Logo Animation"></figure>
<p>My colleague Isaline from the Marketing was enthusiastic about it! For a rather limited amount of time, it is possible to create a playful experience of a brand or to announce an event for example. The initial format I provided the animations was in .mov, which can be easily shared on social media.</p>
<h2>Conclusion</h2>
<p>What I really like about After Effects is that with a few steps looking at an example we can create an animation of a logo and give life to an static image. After Effects is a tool that has been in the market for many years. Thus, there are a lot of resources and examples online making it easy to start working on it.</p>
<h2>Next blog post I will publish:</h2>
<p>Integrate your After Effect animation in your iOS, Android or React Native app.</p>]]></description>
                  <enclosure url="http://liip.rokka.io/www_card_2/170a46a35209b1747256224e037bceaab2049a51/animation-1.jpg" length="255700" type="image/gif" />
          </item>
        <item>
      <title>Swift Alps Conference &#8211; experimentation and collaboration</title>
      <link>https://www.liip.ch/fr/blog/swift-alps-conference</link>
      <guid>https://www.liip.ch/fr/blog/swift-alps-conference</guid>
      <pubDate>Tue, 20 Dec 2016 00:00:00 +0100</pubDate>
      <description><![CDATA[<p><em>The Swift Alps Conference has a special format focused on experimentation and collaboration. This is my report of the conference and the workshop Kilian and I held. The slides are available below.</em></p>
<p>Last month my colleague Kilian and I were pleased to attend the <a href="http://theswiftalps.com">Swift Alps Conference</a>, an experimental conference about Swift taking place in the Swiss Alps. This conference had a different format from what one can expect from a typical software development conference. In this case the <a href="https://medium.com/@swiftalps/the-concept-behind-the-swift-alps-5b07e04c7ed1">format</a> was more focused in experimenting and collaborating with other attendees with the goal of learning something new.</p>
<h2>Experimenting with strangers</h2>
<blockquote>
<p>The first session of the animation workshop with <a href="https://twitter.com/manuelescrig">@manuelescrig</a> at <a href="https://twitter.com/hashtag/swiftalps?src=hash">#swiftalps</a> is in full swing <a href="https://t.co/9Cumo7sks3">pic.twitter.com/9Cumo7sks3</a></p>
<p>— Liip (@liip) <a href="https://twitter.com/liip/status/797025464372068352">November 11, 2016</a></p>
</blockquote>
<figure><img src="https://liip.rokka.io/www_inarticle/2c5e232225df4ce432de2e5f1a6c0e6609095aa2/swiftalps.jpg" alt=""></figure>
<p>The venue was located in the Swiss canton of Valais,  in Crans-Montana, which is a ski resort in the heart of the Swiss Alps.</p>
<p>The combination of this specific location with the amount of  snow, made the conference even more magical, if possible.</p>
<h2>Views from the venue</h2>
<blockquote>
<p>Current view from the <a href="https://twitter.com/swiftalps">@swiftalps</a> <a href="https://t.co/f77uIsDAjt">pic.twitter.com/f77uIsDAjt</a></p>
<p>— Manuel Escrig (@manuelescrig) <a href="https://twitter.com/manuelescrig/status/796993695799197696">November 11, 2016</a></p>
<figure><img src="https://liip.rokka.io/www_inarticle/86d9f8da5ede5a9850548b041b2059342a5af0be/swifalps2.jpg" alt=""></figure>
</blockquote>
<h2>Talking about animations</h2>
<p>My colleague Kilian and I were in charge of being mentors and creating a workshop about animations in Swift. We decided to talk about how <strong>animations</strong> can improve the overall user experience of an app together with all the different <strong>benefits</strong> that they can bring to the user. In addition we talked about the <strong>12 basic principles</strong> of animations in design.</p>
<h2>Slides from the workshop</h2>
<iframe src="https://liip.slides.com/admin_account/deck-4-22-22-d8450a3b-74a6-44ab-8dba-43d8b6774ed1/embed" scrolling="no" frameborder="0" webkitallowfullscreen="webkitallowfullscreen" mozallowfullscreen="mozallowfullscreen" allowfullscreen="allowfullscreen"></iframe>
<p>The main part of being a mentor in the conference was running different workshops during the day where attendees could join and build/create/learn something new related to the topic of the workshop. We proposed to the attendees to build something with animations using Swift. The 3 proposals we gave were, 1.- Snow background effect, 2.- Cowbell notification badge and 3.- Cheese view transition. Here we'll just cover the first proposal of how to implement a snow background effect using Core Animation in Swift.</p>
<h2>Snow background effect</h2>
<p>Using <a href="https://developer.apple.com/reference/quartzcore/caemitterlayer">CAEmitterLayer</a> from Core Animation we accomplished the following result.</p>
<figure><img src="https://liip.rokka.io/www_inarticle/795fddfd6ba01ad792c073577704c71c0a3242bc/snow-2-1.jpg" alt="Snow Background Effect"></figure>
<p>In order to accomplish the effect, we need to create an instance of  CAEmitterLayer, then append to that instance of CAEmitterLayer the different <a href="https://developer.apple.com/reference/quartzcore/caemittercell">CAEmitterCell</a> that represent the snow flakes.</p>
<pre><code>func startSnowing() {
    emitter = CAEmitterLayer()
    emitter.emitterPosition = CGPoint(x: view.frame.size.width / 2.0, y: 0)
    emitter.emitterShape = kCAEmitterLayerLine
    emitter.emitterSize = CGSize(width: view.frame.size.width, height: 1)

    var cells = [CAEmitterCell]()
    cells.append(snowFlakeWith(color:UIColor.white))
    emitter.emitterCells = cells
    view.layer.addSublayer(emitter)
}</code></pre>
<p>To stop effect, just change the birthRate parameter in the CAEmitterLayer instance.</p>
<pre><code>func stopSnowing() {
    emitter?.birthRate = 0
}</code></pre>
<p>You can append to CAEmitterLayer different instances of CAEmitterCell with different behaviour in order to accomplish a natural movement.</p>
<pre><code>func snowFlakeWith(color: UIColor) { 
    let image = #imageLiteral(resourceName: "flake") 
    let whiteImage = image.maskWithColor(color: UIColor.white) 
    let flake = CAEmitterCell() 
    flake.birthRate = 50.0 * intensity 
    flake.lifetime = 14.0 * intensity 
    flake.lifetimeRange = 0 
    flake.color = color.cgColor 
    flake.velocity = CGFloat(350.0 * intensity) 
    flake.velocityRange = CGFloat(80.0 * intensity) 
    flake.emissionLongitude = CGFloat(M_PI) 
    flake.emissionRange = CGFloat(M_PI_4) 
    flake.spin = CGFloat(3.5 * intensity) 
    flake.spinRange = CGFloat(4.0 * intensity) 
    flake.scaleRange = CGFloat(intensity) 
    flake.scaleSpeed = CGFloat(-0.1 * intensity) 
    flake.scale = 0.1 
    flake.contents = whiteImage?.cgImage 
    return flake 
}</code></pre>
<p>Link to the project example.</p>
<p><a href="https://github.com/manuelescrig/SwiftAlps2016">github.com/manuelescrig/SwiftAlps2016</a></p>
<h2>Summary</h2>
<p>We want to thank the Swift Alps conference organizers for creating and putting together such an awesome event! Indeed, by looking at the reactions of the people, we can say it was a great success. Also thanks to the other mentors for sharing all their knowledge with us, and spending time together. Finally a big thank you to the rest of the participants for bringing such a cool vibe to the conference, making it a really special event.</p>
<p>Manuel Escrig <a href="https://www.twitter.com/@manuelescrig">@manuelescrig</a></p>]]></description>
                  <enclosure url="http://liip.rokka.io/www_card_2/bed90f26cf5f6ed2a56d5c514fa51b61d4bc6ba1/cxdbdwcxeaa0h-w.jpg" length="220969" type="image/jpeg" />
          </item>
        <item>
      <title>Easy Storyboard translation in Xcode with Swift3</title>
      <link>https://www.liip.ch/fr/blog/storyboard-translation</link>
      <guid>https://www.liip.ch/fr/blog/storyboard-translation</guid>
      <pubDate>Thu, 10 Nov 2016 00:00:00 +0100</pubDate>
      <description><![CDATA[<p><em>In this post I explain how we created a modular library. Today we are happy to release and open source this lib. You can find the code <a href="https://github.com/liip/LiipKit">on GitHub</a>. Our objective was to have one set of translation files that could be used in the storyboard and Swift</em>.</p>
<p>In our multilingual iOS projects, we always struggled to translate storyboards in Xcode. We checked all around <a href="https://cocoapods.org/">CocoaPods</a>, but couldn't find any efficient solution so far. Every time, we ended up with multiple versions of the storyboard along with multiple versions of ‘Localizable.strings'. It was hard to keep everything under control, specially when translations needed to be updated throughout all files.</p>
<p>During our last mobile project, we asked ourselves: “What if we could only have one set of translation files that could be used in the storyboard and Swift?”. We brainstormed, and created a modular library to handle this painful task. Today we are happy to release and open source this lib. You can find the code <a href="https://github.com/liip/LiipKit">on GitHub</a>.</p>
<h2>Introducing LiipKit</h2>
<h3>Translation</h3>
<p>Our main requirement was to have only one set of translation files (i.e. one for each language). This should work on two aspects:</p>
<ol>
<li>Get a translation from Swift</li>
<li>Translate a UI component from the storyboard</li>
</ol>
<p>And this is how it works:</p>
<p><strong>Swift translation importer</strong> </p>
<pre><code>import LiipKit
let my_test_translation = ~"test"</code></pre>
<p><strong>Translation within the storyboard</strong> </p>
<p>UIButton, UIBarItem and UILabel have a new attribute “Localized Title”.</p>
<figure><img src="https://liip.rokka.io/www_inarticle/4d4c3cb90c484b9cfea3e3c269064434d926bee5/liipkit-storyboard.jpg" alt="New attribute for Button, BarItem and Label in Storyboard"></figure>
<h2>There is more to come</h2>
<p>On top of the translation module, we already implemented <a href="https://github.com/liip/LiipKit/blob/master/README.md#documentation">helpers on String, Int, and Date</a>. We're constantly adding new features to our LiipKit library, so be sure to watch the <a href="https://github.com/liip/LiipKit">GitHub repository</a>.</p>
<p>We welcome any input, feedback, or pull request.</p>]]></description>
                  <enclosure url="http://liip.rokka.io/www_card_2/4d4c3cb90c484b9cfea3e3c269064434d926bee5/liipkit-storyboard.jpg" length="39387" type="image/png" />
          </item>
        <item>
      <title>Introducing Swift 3.0</title>
      <link>https://www.liip.ch/fr/blog/introducing-swift-3-0</link>
      <guid>https://www.liip.ch/fr/blog/introducing-swift-3-0</guid>
      <pubDate>Tue, 20 Sep 2016 00:00:00 +0200</pubDate>
      <description><![CDATA[<p>With the new iPhone 7 Apple has released the iOS 10 operating system and with it comes Xcode 8 and a new version of the Swift language for the iOS developer community.</p>
<p>Swift 3.0 is an open source language that has been developed by the community together with Apple Engineers.</p>
<figure><img src="https://liip.rokka.io/www_inarticle/6506febdd97c8f186996ad400e68d011e955e5f0/windex.jpg" alt="Swift Logo"></figure>
<p>One of the great things about developing an open source language is that everybody can see the <a href="http://apple.github.io/swift-evolution/">evolution of the language</a> and <a href="https://github.com/apple/swift">inspect the code</a>. In the official <a href="https://swift.org/blog/swift-3-0-released/">release notes</a> there is a list of all the changes that have been implemented in the new Swift version.</p>
<p><strong>Swift 3.0</strong> is also the first release to include the <a href="https://swift.org/package-manager/">Swift Package Manager</a>, a tool for managing the distribution of Swift code trough dependencies.</p>
<h2>Top 10 changes in Swift 3</h2>
<h3>Enums</h3>
<h4>1.- Import Objective-C Constants as Swift types</h4>
<h3>Parameters</h3>
<h4>2.- Consistent first argument labels</h4>
<h4>3.- #keyPath</h4>
<h4>4.- Better translation of Obj-C APIs</h4>
<h3>Functions And Closures</h3>
<h4>5.- Closure parameter names and labels</h4>
<h3>Collections</h3>
<h4>6.- Remove the ++ and – operators</h4>
<h3>Good Looking C</h3>
<h4>7.- Import as member</h4>
<h4>8.- Modernizing Swift's Debugging Identifiers</h4>
<h4>9.- Modernized dispatching</h4>
<h3>API Design Guidelines</h3>
<h4>10.- Removing ‘NS' prefix</h4>
<p>The ‘NS' prefix from key Foundation types is getting removed in Swift 3.</p>
<p>See <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0086-drop-foundation-ns.md">SE-0086 – Drop NS Prefix in Swift Foundation</a>.</p>
<p>For those who want to read more about it: Apple has released a free book about the Swift Programming Language (Swift 3 beta) on their iBook store.</p>
<h2>Migrating from Swift 2.2</h2>
<p>Swift 2.2 unfortunately is not supported with Xcode 8 anymore. This means that you will need to migrate your current projects to Swift 3.0 if you want to compile them with the new Xcode.</p>
<p>The problem is that all the 3rd party libraries need to have the same version as your Swift project. And some of them may not be ready yet.</p>
<p>In order to make the transition smoother, Apple is still supporting Swift 2.3 in Xcode 8. Swift 2.3 is almost identical to 2.2.</p>
<h4>How to migrate?</h4>
<p>Xcode 8 includes a migration tool in order to “help” with the process. A reality check revealed that after using the tool you will end up with a list of warnings that you will have to fix manually.</p>
<p>There is a <a href="http://www.jessesquires.com/migrating-to-swift-3/">good article</a> by Jesse Squires on how to migrate libraries from Swift 2.2 to Swift 3.0 that I highly recommend.</p>
<h2>What next</h2>
<h4>Swift 4</h4>
<p>Chris Lattner, a senior director of the Developer Tools Department at Apple, <a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160725/025676.html">posted a lengthy note to the Swift mailing list</a> today that looks back at the development of Swift 3.0 and sets some expectations for Swift 4.0 next year.</p>
<p>Apple is planning to release two major Swift updates next year. Swift 3.1 in spring and Swift 4.0 in Fall 2017. For the development of Swift 4.0 there will be two stages. During stage 1 Apple would like to focus on source and ABI stability first, and then move on to other features in stage 2 depending how much extra time there is.</p>
<p>To read more about Swift, visit <a href="https://swift.org/">swift.org</a></p>]]></description>
                  <enclosure url="http://liip.rokka.io/www_card_2/6506febdd97c8f186996ad400e68d011e955e5f0/windex.jpg" length="7160" type="image/png" />
          </item>
    
  </channel>
</rss>
