Collective #569

Original Source: http://feedproxy.google.com/~r/tympanus/~3/UoTk2HT2ZkE/

C569_WOTW

Inspirational Website of the Week: Limnia

A true masterpiece that brings together modern elegance and sophisticated interactions.

Get inspired

C569_TL_Remote_Teams_300x300

This content is sponsored via Thought Leaders
Remote teams? Get on Clubhouse.

Easily collaborate with anyone in your organization and focus on what matters: building products that customers love, together.

Check it out

C569_lynn

Case Study: lynnandtonic.com 2019 refresh

An excellent case study by Lynn Fisher on the process behind the 2019 redesign of her portfolio.

Read it

C569_overlapimagescss

How to Overlap Images in CSS

A great article by Bri Camp Gomez where she shows how to overlap images with CSS Grid and provide a fallback for non-supportive browsers.

Read it

C569_flowy

Flowy

Alyssa X made this minimal JavaScript library for creating beautiful flowcharts.

Check it out

C569_caniuse

How I created 488 “live images”

Ire Aderinokun shares how she created “live images” for each feature on caniuse.com.

Read it

Does JavaScript keep you too busy to care about CSS? Here are recent features you want to know about!

Pawel Grzybek recaps some new and interesting features that are available in CSS.

Read it

The Third Generation of Interfaces

Dzianis Pomazau writes about what the next generation of interfaces might be.

Read it

C569_cssvariables

Using CSS custom properties to reduce the size of your CSS

Learn how to use CSS custom properties to create abstractions and optimize your CSS in this article by Sebastiano Guerriero.

Read it

CSS Architecture for Modern JavaScript Applications

Mike Riethmuller explorations into modernizing learnings from CSS architecture and how to apply them in the context to modern JavaScript applications.

Read it

Checklist to avoid the most common accessibility errors

Bruce Lawson gives some practical tips on how to avoid the most common accessibility errors.

Check it out

C569_ML

Machine Learning Systems Design

A booklet on machine learning systems design with practical exercises.

Check it out

C569_lib

AppLibsList

A categorized collection of trending and most commonly used libraries and components for ReactJS developers.

Check it out

C569_accessible

Accessibility drives aesthetics

In this article Alex Chen rebuts the claim that accessibility and aesthetics are at odds with each other.

Read it

C569_harry

From Milliseconds to Millions: The Numbers Driving Web Perf

At this talk Harry Roberts takes a look at some of the numbers powering the web performance industry.

Watch it

C569_chatbot

Peekobot

Peekobot is a simple choice-driven chatbot framework in less than 100 lines of JavaScript. Made by Ross Wintle.

Check it out

C569_orthogonal

The Benefits of Orthogonal React Components

Learn how striving for orthogonality in React component design can help make a system flexible and adaptable to change.

Read it

C569_whocanuse

Who Can Use

Find out who can use your color combination by checking the WCAG grading and contrast ratio.

Check it out

C569_cssanimatedbg

Animated CSS Background Generator

Vincent Will created this neat customizer of animated CSS backgrounds.

Check it out

C569_3dcard

Realistic 3D Photo Cards (Hover Effect, Vue.Js)

A beautiful demo by Jouan Marcel.

Check it out

C569_mask

From Our Blog
Creating a Distorted Mask Effect on an Image with Babylon.js and GLSL

Learn the basics of GLSL while creating a distorted mask effect on images using Babylon.js.

Read it

Collective #569 was written by Pedro Botelho and published on Codrops.

75% Off: Get the E-Commerce Bootcamp for Only $29

Original Source: http://feedproxy.google.com/~r/Designrfix/~3/CoYcSLZ5dT4/75-off-get-the-e-commerce-bootcamp-for-only-29

There is money to be made online. As more and more people prefer the convenience of online shopping, more and more businesses are putting their products online. If you’re interested in being your own boss and selling products you are passionate about, now would be the best time to start an e-commerce business. Even as […]

The post 75% Off: Get the E-Commerce Bootcamp for Only $29 appeared first on designrfix.com.

Transform Your Design with Unified UX

Original Source: https://www.webdesignerdepot.com/2019/11/transform-your-design-with-unified-ux/

Unless you’ve been hiding under a tinfoil hat for the last few years, you probably know that UX and UI are not the same thing because “UX is more ergonomic”, or some such nonsense. But what about the unified part? Normally speaking, I’ve got very little patience for hipster acronyms and nit-picking, but actually it turns out there’s more to this than fake specs and chai latte.

Imagine you’re standing outside two different coffee shops. They both sell pretty much the same coffee at pretty much the same price. How do you choose? Well I’ll bet you a unicorn frappe it’s not one specific thing that sways you, more a general “feeling” that “it’s better”. And you know what? That’s UX.

It’s probably time to rethink everything

It’s probably time to rethink everything. Experience has become much more important to users than product, and from a design perspective, this puts software in pretty much the same space as coffee shops.

For the service industry, each user-brand interaction is a touchpoint. It’s not important where or how that interaction happens: seeing the shop, opening the door, speaking to someone at the counter, whatever. The aim is to create a feeling of familiarity, ease and comfort for the target user.

Now imagine scaling that experience. Say you wanted to take your coffee shop into a mobile vending unit. How can you make sure that your users get the same feeling of comfort and familiarity that they had in the high street? That’s Unified UX.

The Broader Context

Unified UX is much more than a DLS or style guide. In fact, you’d be better off thinking about tools like Atlassian and Sketch as…well, tools, to help you achieve the broader aim of unity.

It’s more than responsive design and digital ecosystem too. If you’re still thinking in terms of “mobile”, “tablet” and “desktop” configurations, you’d do well to heed the words of design guru Cameron Moll who urges us to recognise that, for today’s users:

The best interface is the one within reach

Take the Galaxy Fold, for example: Phone, tablet, phablet or plain old monstrous? What about Echo, Dot and Alexa with no screen at all? Or Apple Watch? As Cameron points out in the same talk, the concept of “TV” has also become pretty loose. Do we mean the content, or the device it’s viewed on? Is “mobile” a noun, a verb or an adjective? How is a native app different from a mobile browser experience?

The point is, from a unified UX perspective, it doesn’t matter. The job of the UX team is to create that “brand feeling” across all platforms and in all facets of the design.

Take a look at Southwest Airlines’ “Virtual Booking Desk” from — wait for it — 1998; laugh all you want, but remember that back then, most people were completely new to the internet. Seeing a familiar scene gave users a sense of confidence, which is (still) integral to the Southwest brand.

What Goes in to Unified UX?

Everything!

It starts with deep awareness of the needs, expectations and current experience of the user. Watch people using your stuff. Talk to them afterwards about what it felt like. You’ll definitely learn something. If it’s a new project, do focus groups, then do some more. Co-create if you can.

From there, develop a design principles framework. The key concerns of your user group should shine through in every single aspect of their brand experience.

Broadly, there are two key concepts to unify:

Form and Function – Yes, you need both!
Data Symmetry – Data should follow users.

Here are some questions to consider:

Available Media

How do your users want to interact with the brand?

Android/iOS app;
Voice Interface;
Live Chat;
Bot;
SMS integration (very popular in the US);
Telephone/VOIP;
Video;
Print Media;
Face to Face.

A website doesn’t work for everyone!

Look and Feel

Does your framework include:

color;
shape;
imagery;
story;
art direction;
icons?

Do your choices work everywhere? How do you balance unity of UX and compatibility? How do you merge native OS elements with brand-specific ones?

Layout

Guide users to the content they’re looking for. Will their needs change across:

platform;
device;
time;
user journey?

How do you balance usability and unity of UX on small screens?

Interaction

Are some features device specific?

Camera;
Location Services;
Accelerometer;
Compass.

If so, is this what users want? How will interactive behavior transfer?

Responsive Behaviour

Remember the device continuum – it’s usually best to think in terms of

small;
smallish;
biggish;
big.

(Not specific devices.)

Tone

Important for:

Written copy;
Voice Interface;
Phone Help;
Face to Face;
Video;
Text or Automated Chat.

Does the tone need to change in certain situations:

errors;
call to action;
feedback/complaints;
specific user groups?

Are you using dated words like “click” when “tap” would be a better choice?

Continuation

If the user starts an interaction on one device and transfers to another, does their data follow them? If shopping cart items, elapsed time, favourites etc are consistent across interfaces, you’re doing it right!

Single Sign-On is one of those features that’s bound to make your users smile. With this in mind, are your protocols up to scratch? If you’ve got a native app, you need LDAP or similar, for example. Don’t try and use cookies! Is the backend architecture able to handle the load?

Development Environment

As you probably see by now, unified UX isn’t something you can do by yourself. The better organised your resource repository, the easier it will be to onboard new team members and maintain consistency. Consider:

Toolsets;
Documentation;
Coding and File Naming Conventions;
Standard Elements Repo.

Upgrades and Integration

How will you update legacy material and add new elements as the design evolves?

Who’s Doing it Well?

Yes, unified UX can be a pretty large and expensive undertaking, and even the giants still get it wrong. That said, here are some nice little highlights from a few unexpected places:

Spotify

No surprises here in terms of the company’s size, and sure, their UX is (arguably) pretty slick no matter where you find it. But what really caught my eye today is their commitment to their backend and support for third party developers.

This gives Spotify users enormous scope to enjoy a highly integrated, reliable and ever-expanding ecosystem that always feels the same.

Mailchimp

Not only do they have great cross device, cross platform consistency, their famously chirpy tone and loveable mascot are instantly relatable. What’s even cooler is that, when something goes wrong, the tone subtly changes.

This isn’t surprising because they have a really extensive style guide for new writers.

Linguee

Primarily a web-based translation application, their iOS app is a real favourite of mine. It not only offers dictionary-style definitions, but use-in-context translations as well, which really helps to avoid the classic google translate failures. It’s understandable at a glance on both small and large screens… and it’s free!

Good evidence that simplicity and functionality often win out.

Conclusion – Why Bother?!

Well, in a nutshell, because it’s what your users want. Yes, to really nail a unified experience is a big undertaking, particularly if you’re coming into an old project and dealing with legacy code, but the fact is, it’s the future.

The range of available devices is growing rapidly, and users want whichever one is closest. At the same time, we’re becoming more and more sensitive to experience, and less tolerant of inconsistency or nuisance. Smaller companies must find ways to provide the kind of unified experience that customers expect, or face being swallowed by giants.

As independent developers, it’s in our interests, and within our ability, to find ways to make UX unified.

 

Featured image via DepositPhotos.

Source

p img {display:inline-block; margin-right:10px;}
.alignleft {float:left;}
p.showcase {clear:both;}
body#browserfriendly p, body#podcast p, div#emailbody p{margin:0;}

That 90s Look is Coming Back: Work of Dylan Levionnois

Original Source: http://feedproxy.google.com/~r/abduzeedo/~3/Wde0fAr0atU/90s-look-coming-back-work-dylan-levionnois

That 90s Look is Coming Back: Work of Dylan Levionnois
That 90s Look is Coming Back: Work of Dylan Levionnois

abduzeedoNov 22, 2019

For the past few years, or I dare to say decade, we saw a resurgence of the 80s in fashion, movies/TV and design in a way. Look at the work of amazing people like James White for example. However, I have noticed a slow shift to a new trend. We are moving ahead and beginning to see an influx of 90s inspiration. There are a ton of references already in plain site. There’s an amazing movie called the Mid 90s, the blockbuster Captain Marvel is supposed to take place in the 90s and of course, I started to see more projects on Behance, especially from students, capturing the style of that incredible decade. That’s the case of the projects that Dylan Levionnois have been sharing on his profile.

Dylan Levionnois is a graphic designer from Vire, France and his projects definitely have a lot of 90s references. From the dirty/grunge look using some patterns or texture, to probably the most classic reference, the typography. Dark looking images and simple color palettes, white on black, perhaps with a pop of red. The 90s had a lot of the David Carson, End of Print look and Dylan brings that back on projects like Print – NIKE x BSMNT x ALCH.

One of biggest criticisms of some of the 90s look in terms of graphic design was how difficult things were to read. There was definitely an accessibility issue there. I hope the new designers that take that style and are capable to solve this problem and create a totally inclusive design, yet with that awesome 90s look.

Graphic Design Examples


90% Off: Get the Insta-Famous Photography Bundle for Only $19

Original Source: http://feedproxy.google.com/~r/Designrfix/~3/GIzJY3YnPsw/insta-famous-photography-bundle-deal

For those who have a passion for photography, your social media feed can serve as your portfolio. This is the perfect landscape for getting exposure. With today’s smartphone, you can take stunning photos. If you want to level up your mobile photography and improve your Instagram feed, then the Insta-Famous Photography Bundle is for you. […]

The post 90% Off: Get the Insta-Famous Photography Bundle for Only $19 appeared first on designrfix.com.

Adobe Black Friday Creative Cloud sale kicks off with MEGA 40% discount

Original Source: http://feedproxy.google.com/~r/CreativeBloq/~3/7c6eHKHzFEo/adobe-black-friday-creative-cloud-sale-kicks-off-with-mega-40-discount

Black Friday is almost upon us, and the Adobe Black Friday sale has arrived. If you want to pick up a bargain subscription on the industry-leading suite of creative software, now is the time. Adobe is known for making its offers region-specific, but this time it's treats all round: you can get 40% or more off a CC subscription wherever you are in the world.

For more deals and advice, take a look at our guide to nailing Black Friday and Cyber Monday 2019, or explore our roundup of all the Adobe Black Friday deals.  

The price reduction applies to the complete Adobe Creative Cloud suite, which encompasses over 20 different apps. That includes all the big players – photo editing favourite Photoshop, digital artists' go-to Illustrator, video editing software Premiere Pro, web prototyping tool Adobe XD and motion effects creator After Effects. You'll also be able to explore the new additions to the Adobe family, tablet-based art app Adobe Fresco, and Photoshop on iPad. 

If you need any extra encouragement, remember that when you buy Adobe's full All Apps package you're also getting 100GB of cloud storage (with the option to upgrade to 10TB) and premium features like Adobe Portfolio, Adobe Fonts, and Adobe Spark.

Created on Illustrator by Karan Singh

The programmes are fully integrated, so you can switch between them (and jump from one device to another) seamlessly – whether you’re out and about or in the studio. Built-in templates help you jump-start your designs, while step-by-step tutorials will help you sharpen your skills and get up to speed quickly.

This deal will be available until 29 November 2019, so if you want to save big on Adobe's entire suite of creative software, grab it now.

Related articles:

Top-class Photoshop tutorials to hone your skillsThe best Apple Black Friday dealsThe best web hosting services for designers

Collective #567

Original Source: http://feedproxy.google.com/~r/tympanus/~3/1c3nFqjEyhQ/

Inspirational Website of the Week: It’s not violent

A fantastic sharp design that gets the message across using “textversation”. Our pick this week.

Get inspired

Instanced Line Rendering

Rye Terrell shows how to tackle lines in WebGL using instanced line rendering.

Read it

Our Sponsor
Black Friday Is Coming

Not only do you get the best deal ever on Divi memberships and upgrades, but you can also win a Mac Pro worth over $6,000!

Enter now

Adaptive Loading – Improving Web Performance on low-end devices

Addy Osmani explains how to use Adaptive Loading optimally to allow users get an experience best suited to their constraints.

Read it

Lite YouTube Embed

A YouTube embed that renders much faster than a normal embed. By Paul Irish.

Check it out

Pika Registry

Pika is a new kind of package registry and code editor for package authors. Open for early access.

Check it out

Framer – Web Beta

Exciting news from Framer: Framer will offer a web-based collaborative version and you can request a beta invite now.

Check it out

Alex Pierce – Designer. Art Director. Geek.

Alex Pierce’s portfolio is a unique example of “maximalism” that leverages color, bold typography, motion, and pixel art to deliver a surprising and delightful user experience.

Check it out

Highlights from Chrome Dev Summit 2019

Ire Aderinokun’s roundup article that highlights the most interesting ideas and projects from the Chrome Dev Summit 2019.

Read it

Building a Football Ticket With CSS and SVG

Learn some advanced CSS techniques from this tutorial by Ahmad Shadeed.

Read it

Cube.js Templates

Cube.js templates are open-source, ready-to-use frontend analytics apps.

Check it out

Illlustrations

A set of 100 free illustrations made by Vijay Verma.

Check it out

SVG favicons

An exciting tweet by Mathias Bynens: you can use SVG for a favicon in Chrome now.

Check it out

The Firefox UI is now built with Web Components

An interesting article by Brian Grinstead on how the Firefox UI was migrated to modern web standards.

Read it

What are Microservices?

Sarah Drasner breaks down the term of Microservices.

Read it

Lynn Fisher Portfolio

Lynn Fisher’s awesome new portfolio has a super cool resize effect!

Check it out

Tetris & Snake

Can you play Tetris and Snake at the same time? Try it in this cool experiment by Grégoire Divaret-Chauveau.

Check it out

LegraJS

Legra is a small JavaScript library that lets you draw LEGO like brick shapes on an HTML canvas element.

Check it out

Password Guide

A fantastic little checklist for a password input by Andreas Storm.

Check it out

Multiple-column Layout and column-span in Firefox 71

In this post Rachel Andrew takes a look at the implementation of the column-span property.

Read it

From Our Blog
Inspirational Websites Roundup #10

Get some website inspiration with this set of beautiful and modern site designs freshly picked over the past few weeks.

Check it out

Collective #567 was written by Pedro Botelho and published on Codrops.

10 Useful Firefox Developer Tools You Should Know

Original Source: https://www.hongkiat.com/blog/firefox-developers-tools/

Firefox being “developer’s browser” has many great tools to help make our work easier. You can find more on its tool collection on the Firefox Developer Tools webpage and can also try their…

Visit hongkiat.com for full content.

Performing iOS Animations On Views With UIKit And UIView

Original Source: https://www.smashingmagazine.com/2019/11/performing-ios-animations-views-uikit-uiview/

Performing iOS Animations On Views With UIKit And UIView

Performing iOS Animations On Views With UIKit And UIView

Saravanan V

2019-11-20T11:00:00+00:00
2019-11-20T17:35:47+00:00

I have been an iOS developer for over a decade now and have rarely seen articles that consolidate all possible ways to perform animations in iOS. This article aims to be a primer on iOS animations with the intent of exhaustively covering the different ways of doing the same.

Given the extensiveness of the topic, we would cover each part succinctly at a fairly high level. The goal is to educate the reader with a set of choices to add animations to his/ her iOS app.

Before we start off with topics related to iOS, let us take a brief look at animation speed.

Animating At 60FPS

Generally in videos, each frame is represented by an image and the frame rate determines the number of images flipped in the sequence. This is termed as ‘frames per second’ or FPS.

FPS determines the number of still images flipped within a second, which literally means that the more the number of images/ frames, more details/ information are displayed in the video. This holds true for animations as well.

FPS is typically used to determine the quality of animations. There is a popular opinion that any good animation should run at 60fps or higher — anything less than 60fps would feel a bit off.

Do you want to see the difference between 30FPS and 60FPS? Check this!

Did you notice the difference? Human eyes can definitely feel the jitter at lower fps. Hence, it is always a good practice to make sure that any animation you create, adheres to the ground rule of running at 60FPS or higher. This makes it feel more realistic and alive.

Having looked at FPS, let’s now delve into the different core iOS frameworks that provide us a way to perform animations.

Core Frameworks

In this section, we will touch upon the frameworks in the iOS SDK which can be used for creating view animations. We will do a quick walk through each of them, explaining their feature set with a relevant example.

UIKit/ UIView Animations

UIView is the base class for any view that displays content in iOS apps.

UIKit, the framework that gives us UIView, already provides us some basic animation functions which make it convenient for developers to achieve more by doing less.

The API, UIView.animate, is the easiest way to animate views since any view’s properties can be easily animated by providing the property values in the block-based syntax.

In UIKit animations, it is recommended to modify only the animatable properties of UIVIew else there will be repercussions where the animations might cause the view to end up in an unexpected state.

animation(withDuration: animations: completion)

This method takes in the animation duration, a set of view’s animatable property changes that need to be animated. The completion block gives a callback when the view is done with performing the animation.

Almost any kind of animation like moving, scaling, rotating, fading, etc. on a view can be achieved with this single API.

Now, consider that you want to animate a button size change or you want a particular view to zoom into the screen. This is how we can do it using the UIView.animate API:

let newButtonWidth: CGFloat = 60

UIView.animate(withDuration: 2.0) { //1
self.button.frame = CGRect(x: 0, y: 0, width: newButtonWidth, height: newButtonWidth) //2
self.button.center = self.view.center //3
}

Here’s what we are doing here:

We call the UIView.animate method with a duration value passed to it that represents how long the animation, described inside the block, should run.
We set the new frame of the button that should represent the final state of the animation.
We set the button center with its superview’s center so that it remains at the center of the screen.

The above block of animation code should trigger the animation of the button’s frame changing from current frame:

Width = 0, Height = 0

To the final frame:

Width = Height = newButtonWidth

And here’s what the animation would look like:

animateWithDuration:delay:usingSpringWithDamping:initialSpringVelocity:options:animations:completion

This method is like an extension of the animate method where you can do everything that you can perform in the prior API with some physics behaviors added to the view animations.

For example, if you want to achieve spring damping effects in the animation that we have done above, then this is how the code would look like:

let newButtonWidth: CGFloat = 60
UIView.animate(withDuration: 1.0, //1
delay: 0.0, //2
usingSpringWithDamping: 0.3, //3
initialSpringVelocity: 1, //4
options: UIView.AnimationOptions.curveEaseInOut, //5
animations: ({ //6
self.button.frame = CGRect(x: 0, y: 0, width: newButtonWidth, height: newButtonWidth)
self.button.center = self.view.center
}), completion: nil)

Here’s the set of parameters we use:

duration
Represents the duration of the animation determining how long the block of code should run.
delay
Represents the initial delay that we want to have before the start of the animation.
SpringWithDamping
Represents the value of the springy effect that we want the view to behave. The value must be between 0 to 1. The lower the value, the higher the spring oscillation.
velocity
Represents the speed at which the animation should start.
options
Type of animation curve that you want to apply to your view animation.
Finally, the block of code where we set the frame of the button that needs to be animated. It is the same as the previous animation.

And here’s what the animation would look like with the above animation configuration:

UIViewPropertyAnimator

For a bit more control over animations, UIViewPropertyAnimator comes handy where it provides us a way to pause and resume animations. You can have custom timing and have your animation to be interactive and interruptible. This is very much helpful when performing animations that are also interactable with user actions.

The classic ‘Slide to Unlock’ gesture and the player view dismiss/ expand animation (in the Music app) are examples of interactive and interruptible animations. You can start moving a view with your finger, then release it and the view will go back to its original position. Alternatively, you can catch the view during the animation and continue dragging it with your finger.

Following is a simple example of how we could achieve the animation using UIViewPropertyAnimator:

let newButtonWidth: CGFloat = 60
let animator = UIViewPropertyAnimator(duration:0.3, curve: .linear) { //1
self.button.frame = CGRect(x: 0, y: 0, width: newButtonWidth, height: newButtonWidth)
self.button.center = self.view.center
}
animator.startAnimation() //2

Here’s what we are doing:

We call the UIViewProperty API by passing the duration and the animation curve.
Unlike both the above UIView.animate API’s, the animation won’t start unless you specify it by yourself i.e. you’re in full control of the complete animation process/ flow.

Now, let’s say that you want even more control over the animations. For example, you want to design and control each and every frame in the animation. There’s another API for that, animateKeyframes. But before we delve into it, let’s quickly look at what a frame is, in an animation.

What Is A frame?

A collection of the view’s frame changes/ transitions, from the start state to the final state, is defined as animation and each position of the view during the animation is called as a frame.

animateKeyframes

This API provides a way to design the animation in such a way that you can define multiple animations with different timings and transitions. Post this, the API simply integrates all the animations into one seamless experience.

Let’s say that we want to move our button on the screen in a random fashion. Let’s see how we can use the keyframe animation API to do so.

UIView.animateKeyframes(withDuration: 5, //1
delay: 0, //2
options: .calculationModeLinear, //3
animations: { //4
UIView.addKeyframe( //5
withRelativeStartTime: 0.25, //6
relativeDuration: 0.25) { //7
self.button.center = CGPoint(x: self.view.bounds.midX, y: self.view.bounds.maxY) //8
}

UIView.addKeyframe(withRelativeStartTime: 0.5, relativeDuration: 0.25) {
self.button.center = CGPoint(x: self.view.bounds.width, y: start.y)
}

UIView.addKeyframe(withRelativeStartTime: 0.75, relativeDuration: 0.25) {
self.button.center = start
}
})

Here’s the breakdown:

duration
Call the API by passing in the duration of the animation.
delay
Initial delay duration of the animation.
options
The type of animation curve that you want to apply to your view animation.
animations
Block that takes all keyframe animations designed by the developer/ user.
addKeyFrame
Call the API to design each and every animation. In our case, we have defined each move of the button. We can have as many such animations as we need, added to the block.
relativeStartTime
Defines the start time of the animation in the collection of the animation block.
relativeDuration
Defines the overall duration of this specific animation.
center
In our case, we simply change the center property of the button to move the button around the screen.

And this is how the final animations looks like:

CoreAnimation

Any UIKit based animation is internally translated into core animations. Thus, the Core Animation framework acts as a backing layer or backbone for any UIKit animation. Hence, all UIKit animation APIs are nothing but encapsulated layers of the core animation APIs in an easily consumable or convenient fashion.

UIKit animation APIs don’t provide much control over animations that have been performed over a view since they are used mostly for animatable properties of the view. Hence in such cases, where you intend to have control over every frame of the animation, it is better to use the underlying core animation APIs directly. Alternatively, both the UIView animations and core animations can be used in conjunction as well.

UIView + Core Animation

Let’s see how we can recreate the same button change animation along with specifying the timing curve using the UIView and Core Animation APIs.

We can use CATransaction’s timing functions, which lets you specify and control the animation curve.

Let’s look at an example of a button size change animation with its corner radius utilizing the CATransaction’s timing function and a combination of UIView animations:

let oldValue = button.frame.width/2
let newButtonWidth: CGFloat = 60

/* Do Animations */
CATransaction.begin() //1
CATransaction.setAnimationDuration(2.0) //2
CATransaction.setAnimationTimingFunction(CAMediaTimingFunction(name: CAMediaTimingFunctionName.easeInEaseOut)) //3

// View animations //4
UIView.animate(withDuration: 1.0) {
self.button.frame = CGRect(x: 0, y: 0, width: newButtonWidth, height: newButtonWidth)
self.button.center = self.view.center
}

// Layer animations
let cornerAnimation = CABasicAnimation(keyPath: #keyPath(CALayer.cornerRadius)) //5
cornerAnimation.fromValue = oldValue //6
cornerAnimation.toValue = newButtonWidth/2 //7

button.layer.cornerRadius = newButtonWidth/2 //8
button.layer.add(cornerAnimation, forKey: #keyPath(CALayer.cornerRadius)) //9

CATransaction.commit() //10

Here’s the breakdown:

begin
Represents the start of the animation code block.
duration
Overall animation duration.
curve
Represents the timing curve that needs to be applied to the animation.
UIView.animate
Our first animation to change the frame of the button.
CABasicAnimation
We create the CABasicAnimation object by referring the cornerRadius of the button as the keypath since that’s what we want to animate. Similarly, if you want to have granular level control over the keyframe animations, then you can use the CAKeyframeAnimation class.
fromValue
Represents the starting value of the animation, i.e. the initial cornerRadius value of the button from where the animation must start off.
toValue
Represents the final value of the animation, i.e. the final cornerRadius value of the button where the animation must end.
cornerRadius
We must set the cornerRadius property of the button with the final value of the animation else the button’s cornerRadius value will get auto-reverted to its initial value after the animation completes.
addAnimation
We attach the animation object that contains the configuration of the entire animation process to the layer by representing the Keypath for which the animation needs to be performed.
commit
Represents the end of the animation code block and starts off the animation.

This is how the final animation would look like:

This blog is a great read to help create more advanced animations as it neatly walks you through most of the Core Animation framework APIs with instructions guiding you through every step of the way.

UIKitDynamics

UIKit Dynamics is the physics engine for UIKit which enables you to add any physics behaviors like collision, gravity, push, snap, etc, to the UIKit controls.

UIKitDynamicAnimator

This is the admin class of the UIKit Dynamics framework that regulates all animations triggered by any given UI control.

UIKitDynamicBehavior

It enables you to add any physics behavior to an animator which then enables it to perform on the view attached to it.

Different kinds of behaviors for UIKitDynamics include:

UIAttachmentBehavior
UICollisionBehavior
UIFieldBehavior
UIGravityBehavior
UIPushBehavior
UISnapBehavior

The architecture of UIKitDynamics looks something like this. Note that Items 1 to 5 can be replaced with a single view.

Let us apply some physics behavior to our button. We will see how to apply gravity to the button so that it gives us a feeling of dealing with a real object.

var dynamicAnimator : UIDynamicAnimator!
var gravityBehavior : UIGravityBehavior!

dynamicAnimator = UIDynamicAnimator(referenceView: self.view) //1

gravityBehavior = UIGravityBehavior(items: [button]) //2
dynamicAnimator.addBehavior(gravityBehavior) //3

Here’s the breakdown:

UIKitDynamicAnimator
We have created a UIKitDynamicAnimator object which acts as an orchestrator for performing animations. We have also passed the superview of our button as the reference view.
UIGravityBehavior
We have created a UIGravityBehavior object and pass our button into the array elements on which this behavior is injected.
addBehavior
We have added the gravity object to the animator.

This should create an animation as shown below:

Notice how the button falls off from the center (its original position) of the screen to the bottom and beyond.

We should tell the animator to consider the bottom of the screen to be the ground. This is where UICollisionBehavior comes into picture.

var dynamicAnimator : UIDynamicAnimator!
var gravityBehavior : UIGravityBehavior!
var collisionBehavior : UICollisionBehavior!

dynamicAnimator = UIDynamicAnimator(referenceView: self.view) //1

gravityBehavior = UIGravityBehavior(items: [button]) //2
dynamicAnimator.addBehavior(gravityBehavior) //3

collisionBehavior = UICollisionBehavior(items: [button]) //4
collisionBehavior.translatesReferenceBoundsIntoBoundary = true //5
dynamicAnimator.addBehavior(collisionBehavior) //6

UICollisionBehavior
We have created a UICollisionBehavior object and passed along the button so that the behavior is added to the element.
translatesReferenceBoundsIntoBoundary
Enabling this property tells the animator to take the reference views boundary as the end, which is the bottom of the screen in our case.
addBehavior
We have added collision behavior to the animator here.

Now, our button should hit the ground and stand still as shown below:

That’s pretty neat, isn’t it?

Now, let us try adding a bouncing effect so that our object feels more real. To do that, we will use the UIDynamicItemBehavior class.

var dynamicAnimator : UIDynamicAnimator!
var gravityBehavior : UIGravityBehavior!
var collisionBehavior : UICollisionBehavior!
var bouncingBehavior : UIDynamicItemBehavior!

dynamicAnimator = UIDynamicAnimator(referenceView: self.view) //1

gravityBehavior = UIGravityBehavior(items: [button]) //2
dynamicAnimator.addBehavior(gravityBehavior) //3

collisionBehavior = UICollisionBehavior(items: [button]) //4
collisionBehavior.translatesReferenceBoundsIntoBoundary = true //5
dynamicAnimator.addBehavior(collisionBehavior) //6

//Adding the bounce effect
bouncingBehavior = UIDynamicItemBehavior(items: [button]) //7
bouncingBehavior.elasticity = 0.75 //8
dynamicAnimator.addBehavior(bouncingBehavior) //9

UIDynamicItemBehavior
We have created a UIDynamicItemBehavior object and pass along the button so that the behavior is added to the element.
elasticity
Value must be between 0-1, it represents the elasticity i.e. the number of times the object must bounce on and off the ground when it is hit. This is where the magic happens — by tweaking this property, you can differentiate between different kinds of objects like balls, bottles, hard-objects and so on.
addBehavior
We have added collision behavior to the animator here.

Now, our button should bounce when it hits the ground as shown below:

This repo is quite helpful and shows all UIKitDynamics behaviors in action. It also provides source code to play around with each behavior. That, in my opinion, should serve as an extensive list of ways to perform iOS animations on views!

In the next section, we will take a brief look into the tools that will aid us in measuring the performance of animations. I would also recommend you to look at ways to optimize your Xcode build since it will save a huge amount of your development time.

Performance Tuning

In this section, we will look at ways to measure and tune the performance of iOS animations. As an iOS developer, you might have already used Xcode Instruments like Memory Leaks and Allocations for measuring the performance of the overall app. Similarly, there are instruments that can be used to measure the performance of animations.

Core Animation Instrument

Try the Core Animation instrument and you should be able to see the FPS that your app screen delivers. This is a great way to measure the performance/ speed of any animation rendered in your iOS app.

Drawing

FPS is vastly lowered in the app that displays heavy content like images with effects like shadows. In such cases, instead of assigning the Image directly to the UIImageView’s image property, try to draw the image separately in a context using Core Graphics APIs. This overly reduces the image display time by performing the image decompression logic asynchronously when done in a separate thread instead of the main thread.

Rasterization

Rasterization is a process used to cache complex layer information so that these views aren’t redrawn whenever they’re rendered. Redrawing of views is the major cause of the reduction in FPS and hence, it is best to apply rasterization on views that are going to be reused several times.

Wrapping Up

To conclude, I have also summed up a list of useful resources for iOS animations. You may find this very handy when working on iOS animations. Additionally, you may also find this set of design tools helpful as a (design) step before delving into animations.

I hope I have been able to cover as many topics as possible surrounding iOS animations. If there is anything I may have missed out in this article, please let me know in the comments section below and I would be glad to make the addition!

Smashing Editorial
(dm, yk, il)

Amazing Illustration Work of Mercedes Bazan

Original Source: http://feedproxy.google.com/~r/abduzeedo/~3/GOtwRIUcHOo/amazing-illustration-work-mercedes-bazan

Amazing Illustration Work of Mercedes Bazan
Amazing Illustration Work of Mercedes Bazan

abduzeedoNov 15, 2019

I recently came back from a trip to Japan, it was my first time there and I was blown away by the culture, especially the visuals. I was familiar with the aesthetics from video-games and mangas, however seeing some of the contrasts of peaceful and minimal to chaotic and colorful is incredible in person. The reason I’m bringing this up is because I was reading this interview with James White and he mentioned Mercedes Bazan as an illustrator he admires. James is one of my favorite people so I had to check out and of course he was right, again. So here we are, featuring the amazing work of Mercedes Bazan

Illustration