Christa  Stehr

Christa Stehr

1593341640

Recreating Instagram’s Like ❤️Animation in Swift

Animations can greatly improve a user’s experience when interacting with a mobile application. In this tutorial, I will show you how to recreate a very simple animation most of us are familiar with: Instagram’s “like” animation.

Instagram’s “like” animation.

Let’s start by adding the heart icon assets we’re going to be using in our Xcode project. One is white and the other red (I usually find great icons on Icons8).

Assets folder in Xcode

Now let’s create a class for our button. We will call it HeartButton and will make it a subclass of UIButton. Let’s start by just setting the initial image to the empty heart.

import UIKit

	class HeartButton: UIButton {

	  private let unlikedImage = UIImage(named: "heart_empty")
	  private let likedImage = UIImage(named: "heart_filled")

	  override public init(frame: CGRect) {
	    super.init(frame: frame)

	    setImage(unlikedImage, for: .normal)
	  }

	  required init?(coder: NSCoder) {
	    fatalError("init(coder:) has not been implemented")
	  }
	}

If you add a HeartButton to your app and run it, it will look something like this:

Let’s add some code to keep track of the state of the button, as well as a method to flip this state and animate the button accordingly. The animation itself consists of two main steps:

  • Step one: When the button is pressed, we scale the button down (using the scale transform) and flip the heart image.
  • Step two: When the animation has finished, we return the button to its original scale (we do this by applying the [identity](https://developer.apple.com/documentation/coregraphics/cgaffinetransform/1455180-identity) transform).

We will achieve these steps by using [UIView.animate](https://developer.apple.com/documentation/uikit/uiview/1622515-animate), where the animation block will execute step one above and the completion block will execute step two in an animation of itself:

import UIKit

	class HeartButton: UIButton {
	  private var isLiked = false

	  // ...

	  public func flipLikedState() {
	    isLiked = !isLiked
	    animate()
	  }

	  private func animate() {
	    // Step 1
	    UIView.animate(withDuration: 0.1, animations: {
	      let newImage = self.isLiked ? self.likedImage : self.unlikedImage
	      self.transform = self.transform.scaledBy(x: 0.8, y: 0.8)
	      self.setImage(newImage, for: .normal)
	    }, completion: { _ in
	      // Step 2
	      UIView.animate(withDuration: 0.1, animations: {
	        self.transform = CGAffineTransform.identity
	      })
	    })
	  }
	}

Now, when your button is tapped, you can call the flipLikedState method to execute the animations.

#programming #ios #mobile #swift #xcode

What is GEEK

Buddha Community

Recreating Instagram’s Like ❤️Animation in Swift

Marcus Anthony

1613539912

Instagram Clone | Instagram Clone App Development | App-like Instagram

People love to be a user on social media platforms as it is part of a trend in this era. Thus developing an app like Instagram would be much beneficial for users and a huge success for entrepreneurs as the revenue of this app would reach heights. Our solution is pre-packed with all functionality, features, and premium versions. So why wait, call to know more about this app!

#instagram clone #instagram clone app #instagram clone script #instagram like app #app like instagram #instagram clone software

Mike  Kozey

Mike Kozey

1656151740

Test_cov_console: Flutter Console Coverage Test

Flutter Console Coverage Test

This small dart tools is used to generate Flutter Coverage Test report to console

How to install

Add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get):

dev_dependencies:
  test_cov_console: ^0.2.2

How to run

run the following command to make sure all flutter library is up-to-date

flutter pub get
Running "flutter pub get" in coverage...                            0.5s

run the following command to generate lcov.info on coverage directory

flutter test --coverage
00:02 +1: All tests passed!

run the tool to generate report from lcov.info

flutter pub run test_cov_console
---------------------------------------------|---------|---------|---------|-------------------|
File                                         |% Branch | % Funcs | % Lines | Uncovered Line #s |
---------------------------------------------|---------|---------|---------|-------------------|
lib/src/                                     |         |         |         |                   |
 print_cov.dart                              |  100.00 |  100.00 |   88.37 |...,149,205,206,207|
 print_cov_constants.dart                    |    0.00 |    0.00 |    0.00 |    no unit testing|
lib/                                         |         |         |         |                   |
 test_cov_console.dart                       |    0.00 |    0.00 |    0.00 |    no unit testing|
---------------------------------------------|---------|---------|---------|-------------------|
 All files with unit testing                 |  100.00 |  100.00 |   88.37 |                   |
---------------------------------------------|---------|---------|---------|-------------------|

Optional parameter

If not given a FILE, "coverage/lcov.info" will be used.
-f, --file=<FILE>                      The target lcov.info file to be reported
-e, --exclude=<STRING1,STRING2,...>    A list of contains string for files without unit testing
                                       to be excluded from report
-l, --line                             It will print Lines & Uncovered Lines only
                                       Branch & Functions coverage percentage will not be printed
-i, --ignore                           It will not print any file without unit testing
-m, --multi                            Report from multiple lcov.info files
-c, --csv                              Output to CSV file
-o, --output=<CSV-FILE>                Full path of output CSV file
                                       If not given, "coverage/test_cov_console.csv" will be used
-t, --total                            Print only the total coverage
                                       Note: it will ignore all other option (if any), except -m
-p, --pass=<MINIMUM>                   Print only the whether total coverage is passed MINIMUM value or not
                                       If the value >= MINIMUM, it will print PASSED, otherwise FAILED
                                       Note: it will ignore all other option (if any), except -m
-h, --help                             Show this help

example run the tool with parameters

flutter pub run test_cov_console --file=coverage/lcov.info --exclude=_constants,_mock
---------------------------------------------|---------|---------|---------|-------------------|
File                                         |% Branch | % Funcs | % Lines | Uncovered Line #s |
---------------------------------------------|---------|---------|---------|-------------------|
lib/src/                                     |         |         |         |                   |
 print_cov.dart                              |  100.00 |  100.00 |   88.37 |...,149,205,206,207|
lib/                                         |         |         |         |                   |
 test_cov_console.dart                       |    0.00 |    0.00 |    0.00 |    no unit testing|
---------------------------------------------|---------|---------|---------|-------------------|
 All files with unit testing                 |  100.00 |  100.00 |   88.37 |                   |
---------------------------------------------|---------|---------|---------|-------------------|

report for multiple lcov.info files (-m, --multi)

It support to run for multiple lcov.info files with the followings directory structures:
1. No root module
<root>/<module_a>
<root>/<module_a>/coverage/lcov.info
<root>/<module_a>/lib/src
<root>/<module_b>
<root>/<module_b>/coverage/lcov.info
<root>/<module_b>/lib/src
...
2. With root module
<root>/coverage/lcov.info
<root>/lib/src
<root>/<module_a>
<root>/<module_a>/coverage/lcov.info
<root>/<module_a>/lib/src
<root>/<module_b>
<root>/<module_b>/coverage/lcov.info
<root>/<module_b>/lib/src
...
You must run test_cov_console on <root> dir, and the report would be grouped by module, here is
the sample output for directory structure 'with root module':
flutter pub run test_cov_console --file=coverage/lcov.info --exclude=_constants,_mock --multi
---------------------------------------------|---------|---------|---------|-------------------|
File                                         |% Branch | % Funcs | % Lines | Uncovered Line #s |
---------------------------------------------|---------|---------|---------|-------------------|
lib/src/                                     |         |         |         |                   |
 print_cov.dart                              |  100.00 |  100.00 |   88.37 |...,149,205,206,207|
lib/                                         |         |         |         |                   |
 test_cov_console.dart                       |    0.00 |    0.00 |    0.00 |    no unit testing|
---------------------------------------------|---------|---------|---------|-------------------|
 All files with unit testing                 |  100.00 |  100.00 |   88.37 |                   |
---------------------------------------------|---------|---------|---------|-------------------|
---------------------------------------------|---------|---------|---------|-------------------|
File - module_a -                            |% Branch | % Funcs | % Lines | Uncovered Line #s |
---------------------------------------------|---------|---------|---------|-------------------|
lib/src/                                     |         |         |         |                   |
 print_cov.dart                              |  100.00 |  100.00 |   88.37 |...,149,205,206,207|
lib/                                         |         |         |         |                   |
 test_cov_console.dart                       |    0.00 |    0.00 |    0.00 |    no unit testing|
---------------------------------------------|---------|---------|---------|-------------------|
 All files with unit testing                 |  100.00 |  100.00 |   88.37 |                   |
---------------------------------------------|---------|---------|---------|-------------------|
---------------------------------------------|---------|---------|---------|-------------------|
File - module_b -                            |% Branch | % Funcs | % Lines | Uncovered Line #s |
---------------------------------------------|---------|---------|---------|-------------------|
lib/src/                                     |         |         |         |                   |
 print_cov.dart                              |  100.00 |  100.00 |   88.37 |...,149,205,206,207|
lib/                                         |         |         |         |                   |
 test_cov_console.dart                       |    0.00 |    0.00 |    0.00 |    no unit testing|
---------------------------------------------|---------|---------|---------|-------------------|
 All files with unit testing                 |  100.00 |  100.00 |   88.37 |                   |
---------------------------------------------|---------|---------|---------|-------------------|

Output to CSV file (-c, --csv, -o, --output)

flutter pub run test_cov_console -c --output=coverage/test_coverage.csv

#### sample CSV output file:
File,% Branch,% Funcs,% Lines,Uncovered Line #s
lib/,,,,
test_cov_console.dart,0.00,0.00,0.00,no unit testing
lib/src/,,,,
parser.dart,100.00,100.00,97.22,"97"
parser_constants.dart,100.00,100.00,100.00,""
print_cov.dart,100.00,100.00,82.91,"29,49,51,52,171,174,177,180,183,184,185,186,187,188,279,324,325,387,388,389,390,391,392,393,394,395,398"
print_cov_constants.dart,0.00,0.00,0.00,no unit testing
All files with unit testing,100.00,100.00,86.07,""

Installing

Use this package as an executable

Install it

You can install the package from the command line:

dart pub global activate test_cov_console

Use it

The package has the following executables:

$ test_cov_console

Use this package as a library

Depend on it

Run this command:

With Dart:

 $ dart pub add test_cov_console

With Flutter:

 $ flutter pub add test_cov_console

This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get):

dependencies:
  test_cov_console: ^0.2.2

Alternatively, your editor might support dart pub get or flutter pub get. Check the docs for your editor to learn more.

Import it

Now in your Dart code, you can use:

import 'package:test_cov_console/test_cov_console.dart';

example/lib/main.dart

import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
        // This makes the visual density adapt to the platform that you run
        // the app on. For desktop platforms, the controls will be smaller and
        // closer together (more dense) than on mobile platforms.
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key? key, required this.title}) : super(key: key);

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
        // Here we take the value from the MyHomePage object that was created by
        // the App.build method, and use it to set our appbar title.
        title: Text(widget.title),
      ),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(
          // Column is also a layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          //
          // Invoke "debug painting" (press "p" in the console, choose the
          // "Toggle Debug Paint" action from the Flutter Inspector in Android
          // Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
          // to see the wireframe for each widget.
          //
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

Author: DigitalKatalis
Source Code: https://github.com/DigitalKatalis/test_cov_console 
License: BSD-3-Clause license

#flutter #dart #test 

Marcus Anthony

1627018676

Instagram Clone | Instagram Clone App Development | App-like Instagram

Introduction to social media is a needless thing as we all are aware of how successful they are. They provide a social networking platform for people to connect with others across the world. Instagram, the photo-sharing social networking site, has gained a huge user base. The app is a photo-sharing medium where people can post their photos and videos more than social media.

If the app strongly influences you, then you can try your best to launch an app like Instagram. Here, you will find some important features to include in your Instagram clone.

The Must-have features of an Instagram clone app

Home screen

The home screen is where the users can find all the posts and feeds shared by people in their following list.

Profile creation

Upon downloading the app, the users can create their profiles by adding their photos. They can also give a bio about themselves. This will let others know about them before sending the following request.

Search option

The advanced search option allows the users to search various accounts or feeds featured in the app. By entering their keywords in the search option, they will see the top results out of it.

Uploading photos and videos

The app should allow users to upload their photos and videos from their libraries. While the users upload their media, ask them if they would like to make their post public or visible only to the selected profiles.

Activity log

The Instagram clone will list the mutual list friends in the app to give them follow requests. And if someone from their Facebook friend list has joined the app, they can see them in the app.

Summing up,

Social media apps will always have a warm response from people. Even in recent days, the Clubhouse app has gained huge recognition from people. So, there is still scope for you to entertain people with your** Instagram clone**. Then Appdupe will be your one-stop solution for developing your Instagram clone app. Visit our website for more insights.

#instagram clone #instagram clone app #instagram clone app development #instagram clone script #instagram like app development #instagram app clone

Create an App Like Instagram

Create your own video & photo sharing clone app like Instagram for iPhone and Android with all the latest features, unique design, and easy to navigate UI that attracts more users.

Get a quote now: https://www.appcluesinfotech.com/get-a-quote/

#create an app like instagram #make an app like instagram #build a mobile app like instagram #cost to create an app similar to instagram #make an app similar to instagram

dia adalyn

1603264482

How to get your social media app like Instagram popular in the shortest time?

Over 1 million people use Instagram over a month, isn’t that stunning? It is the kind of reach Instagram has over people. If you consider its core functionality, it is just an app to share pictures and videos with people. The reason for its popularity can be attributed to a variety of factors such as- vast library of features, an attractive user interface, and moreover popularity among a wide circle of global users.

People mainly use social media apps to connect with their friends and family. So, it is important that the app is popular among a wider audience. The marketing for social media apps is equally important as the development process. In this blog, let us look at the marketing techniques to adopt for making your Instagram clone app famous.

Instagram’s global presence can be best understood through the following statistics:

  • Almost 63% of Instagram users log in at least once in a day.
  • Like button on Instagram are being hit more than 4.2 million times per day.
  • Popular Instagrammers earn millions of dollars. According to reports, 31% of the users earn more than $75k per year on Instagram, following that 32% of the users earn $50-70k per annum.
  • In comparison with Facebook, Instagram has younger users part of it. Nearly two out of three users of Instagram are between the age group of 18 to 34.

**Ways to make your Instagram like app popular **

People regularly check social media apps multiple times a day. So there is not going to be much difficulty in retaining the customers. The challenge lies in acquiring customers.

Make it free

The phrase ”Make it free” doesn’t make much sense. When we look at popular social media apps such as Facebook, Instagram, Twitter, etc., they offer the app for free. There are certain in-app purchases involved, for instance, an assortment of custom stickers or certain exclusive features for a price. People will not be hesitant to pay for that. The moment the app is labeled with a price to install it, people stay away from it.

Advertise social media app

People are not going to know about the app unless you advertise it. Advertise your application on major platforms like Google Play Store and iOS App Store. So when people search for social media apps in the app store, the application will be listed at the top and customers are more likely to download the app.

Promote your social media app

Before the launch of the social media app create a page exclusively dedicated to your social media app and promote it on major platforms. In order to make your product known before its launch, have an expert marketing team by your side to assist in marketing your product.

Some of the popular apps make it default to subscribe to the official handle of the social media app. It would be an effective strategy to promote features and exciting offers among users.

Referral program

Users can get amazing offers and deals for referring a friend to use the application. It motivates people to recommend the app to more friends. One of the crucial aspects to keep in mind is that referral marketing does not happen on its own. Offer highlights in the form of banners on the home page and notifications so that customers are aware of the referral programs.

Personalities and Social media influences

People will want to become part of your application to know more about their favorite idols. Invite popular celebrities and social media influencers of other popular apps to use your application.

**Aspects to pay close attention while developing Instagram like app **

Profile completion updates

There are certain aspects that are part of popular social media apps that annoy people. One of the main concerns is the profile completion status. Customers are not always comfortable with sharing all their personal information on social media apps. But when they see frequent push notifications for profile completion. They are in a way compelled to provide this information to avoid future pop-ups. There is a simple way to make users more comfortable with Instagram-like apps. Have a provision on the built-in Instagram software to offer a quick tour for first-time users so that they are familiar with the features and aspects of the app.

Make your app unique

Already, there are several social media apps present. In order for more users to prefer your application, offer certain unique features. When we look at Twitter, it acts as a platform for users to share their thoughts and opinions. Snapchat allows users to share small clips of videos. So the application idea need not be complex, but it needs an operating USP and be impressive enough to captivate the presence of a global audience.

Summing Up

The big picture of the success of your social media application lies in the methodologies adopted to promote your application among a wide audience. Have a skilled development team for top-notch Instagram clone app development and a marketing team to promote your app on a global level.

#instagram clone #instagram like app development #app like instagram #instagram clone software #instagram clone script