As we know that Composer is a tool for dependency management and we are going to use it to implement Swift Mailer. According to the Codeigniter Documentation, We can use Composer by settings
$config['composer_autoload']; in your application/config/config.php. Now use terminal and locate your projects application directory by simple CD (Change Directory) command. Now make sure you have installed Composer, You can check the installation by typing the following command
composer --v and if Composer installed into your machine it will tell you about the current version of the Composer.