So… The design team just asked you to make an animation sexier and you went pale. What did they mean? The situation then got more awkward as they started talking about key frames and animation curves.
Motion graphics applications offers a lot of flexibility and to a designer there may sometimes be an expectation that the same flexibility is found in Swift / Cocoa Touch. Of course we all know that Swift is awesome and everything is possible but let’s stick to the basics.
Swift generics are a great tool when applied appropriately. They are immensely useful both in an object form, as generic parameter for class, enum or struct type, and in constraint form, as associatedtype and Self requirements in protocol. The standard library and many community libraries put generics to work for code reduction and simplification.
I don’t feel like I fully covered one aspect of protocols with associated types: why can they be such a pain to work with?
I love animations. They make users happy, they can express more than just some static UI element.
Recently, a friend of mine, Rafael Ramos (@rakaramos), showed me a code that he wrote to create an animation that he saw in CreativeDash’s Dribbble. Check this out here.
I thought that it was very cool and decided to do the same because it is such a great opportunity to:
- Practice Swift
- Learn more about CoreAnimation
- Create an open source UI component
- Have fun! 😊
With the latest changes in Xcode 7.3, you can once again build drag-and-drop playgrounds to provide simple Swift-based utility apps with minimal coding.
Unlike older solutions, XCPlayground’s interactive live views don’t require pop-up windows. You don’t have to do anything special to make the page application run with a different priority. Just open the assistant and the app is there, running, and interactive.
CoreAnimation is a very powerful framework. By using CABasicAnimation, CAKeyFrameAnimation or CAAnimationGroup we can create amazing user experience and there are basically no limits. It is up to our imagination what exactly will be presented on a screen and how it will behave. It turns out that CoreAnimation can be also used with other frameworks such as CoreGraphics or CoreText, which gives a developer the ability to create amazing animations. Using CoreText with CoreAnimation we can animate every text with a chosen font type and font size. In this article I am going to present a way how to do just that.
We are all familiar with collection types. Array, probably, the most common way to represent collection of items. We can easily iterate through by using for loop.
Another Swift collections representations, like Dictionary, Set and others has one important thing in common: all of them are adopting SequenceType protocol. We can create custom sequences for very wide range of purposes. It can be finite or inifinite sequence. For instance, we may need the ‘powers of 2’ sequence or similar.
I’m still getting used to Associated Types in Swift. Even though they’ve been around for a while, I first starting to understand them from this talk by @alexisgallagher.
So I was happy yesterday when I used them to sort of solve a common problem in iOS development: View Controller Data Injection with Storyboards and Segues in Swift.
Concepts like Functors, Applicative Functors, Monads, and Monoids in Haskell all seem totally incomprehensible at first, but translating them into Swift can make things much clearer. Each of these concepts are essentially protocols that tie together Arrays, Optionals, Streams, Promises, and a host of other data types. They make way more sense when written in Swift with descriptive variable names. Understanding them can give you a deeper understanding of programming paradigms like Reactive Programming and Railroad-Oriented Programming.
What I wish I could tell my younger self about FRP (from a RAC perspective)