<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jaleel Nazir</title>
    <description>The latest articles on DEV Community by Jaleel Nazir (@jaleelnazir).</description>
    <link>https://dev.to/jaleelnazir</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F905565%2F9f216ded-95a6-42d8-93e4-86c3a5b53c94.png</url>
      <title>DEV Community: Jaleel Nazir</title>
      <link>https://dev.to/jaleelnazir</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jaleelnazir"/>
    <language>en</language>
    <item>
      <title>Avoid These 6 Common Password Mistakes – Protect Your Accounts Now!</title>
      <dc:creator>Jaleel Nazir</dc:creator>
      <pubDate>Wed, 13 Nov 2024 19:56:02 +0000</pubDate>
      <link>https://dev.to/jaleelnazir/avoid-these-6-common-password-mistakes-protect-your-accounts-now-2ii6</link>
      <guid>https://dev.to/jaleelnazir/avoid-these-6-common-password-mistakes-protect-your-accounts-now-2ii6</guid>
      <description>&lt;h2&gt;
  
  
  Top 6 Essential Password Management Tips for All Ages
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Use a Trusted Password Manager (Like Google or Apple):&lt;/em&gt;&lt;/strong&gt; Rely on browser-based password managers to store complex passwords securely across devices. This keeps your passwords safe, synced, and easily accessible wherever you log in.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Avoid Confusing, Similar Characters Steer clear of look-alikes:&lt;/em&gt;&lt;/strong&gt; &lt;strong&gt;&lt;em&gt;i, I, l, L, 1; o, O, 0; S and 5; Z and 2.&lt;/em&gt;&lt;/strong&gt; Passwords should be memorable yet distinct to avoid typos that cause login frustrations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Stay Clear of Basic, Easy-to-Guess Patterns Skip&lt;/em&gt;&lt;/strong&gt; obvious choices like “1234,” “abcd,” “password,” or your name, birthdate, phone number, or any personal info. Simple patterns are easily guessed by attackers!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Don’t Reuse Passwords&lt;/em&gt;&lt;/strong&gt; Across Sites Reusing passwords increases your risk across accounts. Keep each password unique, so if one account is compromised, others remain safe.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Enable Two-Factor Authentication (2FA)&lt;/em&gt;&lt;/strong&gt; For added security, enable 2FA whenever possible. This second layer protects you even if someone discovers your password by requiring a time-sensitive code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use a &lt;a href="https://fictos.com/password-generator" rel="noopener noreferrer"&gt;Password Generator&lt;/a&gt;&lt;/strong&gt; to Create Strong Passwords Password generators create complex, randomized passwords with numbers, symbols, and mixed cases. Using a generator reduces the temptation to rely on predictable patterns or names.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>How we implemented a straightforward post history system at Glynk</title>
      <dc:creator>Jaleel Nazir</dc:creator>
      <pubDate>Tue, 12 Dec 2023 13:50:29 +0000</pubDate>
      <link>https://dev.to/jaleelnazir/how-we-implemented-a-straightforward-post-history-system-at-glynk-1h3m</link>
      <guid>https://dev.to/jaleelnazir/how-we-implemented-a-straightforward-post-history-system-at-glynk-1h3m</guid>
      <description>&lt;p&gt;In #Glynk, a community platform enabling users to create social content posts and events, a comprehensive moderation system is implemented to manage user-generated content.&lt;/p&gt;

&lt;p&gt;We have a system in place with both an automation script and a team to moderate content. The challenge was to track the edit history of posts, detailing when they were created and the modifications made.&lt;/p&gt;

&lt;p&gt;Our main backend and web apps are created with Django. Despite the availability of Django libraries for this purpose, an alternative setup was chosen. The decision was made to create an independent module, separate from the existing ones, to facilitate easy tracking of modifications. At that time, the Post model comprised around 100 fields, but the product requirement was to monitor only a select few.&lt;/p&gt;

&lt;p&gt;The chosen solution involved implementing a new MongoDB model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"post_unique_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;post_unique_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;//&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;Indexed&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"original_post_obj"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;serialized_post&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"change_logs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"modified_at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"modified_by"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"serialized_post_obj"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;serialized_post_obj&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"modified_at"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"modified_by"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;user_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"serialized_post_obj"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;serialized_post_obj&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The "post_unique_id" serves as a unique identifier and is indexed for efficient retrieval. The "change_logs" array stores instances of the post object representing modifications over time.&lt;/p&gt;

&lt;p&gt;To view the post details and history, a separate AJAX call was integrated into the moderation console. This call retrieves both the initial and the last modified data, providing a comprehensive view of the post's evolution.&lt;/p&gt;

&lt;p&gt;We wrapped up the whole setup — design, backend, and web frontend—in just four days. For the past two years, the system has been strong and reliable, effortlessly managing numerous post modifications. Teamwork played a key role in making it all work seamlessly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;P.S:&lt;/strong&gt;&lt;br&gt;
We specialise in procuring products and fostering application developments from overseas. Our robust team excels in mobile app development, encompassing Android, iOS, and Flutter platforms, as well as web app and dashboard development.&lt;/p&gt;

&lt;p&gt;Our track record includes successfully conceptualising, developing, and delivering applications and infrastructure that have seamlessly scaled from initial stages to serving millions of users.&lt;/p&gt;

&lt;p&gt;For further inquiries and detailed discussions, please feel free to connect with us:&lt;br&gt;
&lt;a href="https://pods.studio/"&gt;https://pods.studio/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/jaleelnazir/"&gt;https://www.linkedin.com/in/jaleelnazir/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>django</category>
      <category>mongodb</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Solving Celery Asynchronous Task Collisions with RabbitMQ vHosts</title>
      <dc:creator>Jaleel Nazir</dc:creator>
      <pubDate>Thu, 07 Dec 2023 09:34:00 +0000</pubDate>
      <link>https://dev.to/jaleelnazir/solving-celery-asynchronous-task-collisions-with-rabbitmq-vhosts-2mao</link>
      <guid>https://dev.to/jaleelnazir/solving-celery-asynchronous-task-collisions-with-rabbitmq-vhosts-2mao</guid>
      <description>&lt;p&gt;I encountered challenges when managing Celery asynchronous tasks across three different codebases: the backend REST API, the frontend web app, and the dashboard app, each residing in its own repository and each app ran on a separate AWS EC2 instance with its dedicated RabbitMQ, and things worked smoothly.&lt;/p&gt;

&lt;p&gt;However, when we brought all the apps under a single instance, we ran into issues with Celery asynchronous tasks during development. Tasks collided between apps, causing disruptions. This problem stemmed from using the same RabbitMQ with its default guest account.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why did it happen?
&lt;/h2&gt;

&lt;p&gt;It occurred because the codebase was from 2013, and during fast development sprints, it was easier and faster to work on separate repositories and instances.&lt;br&gt;
We directly used Python functions to call Celery with &lt;code&gt;.apply_async&lt;/code&gt; and &lt;code&gt;.delay&lt;/code&gt;, without using the async call with topic and queue.&lt;/p&gt;
&lt;h2&gt;
  
  
  The RabbitMQ vHosts
&lt;/h2&gt;

&lt;p&gt;To address this, we implemented a simple yet effective solution: creating separate virtual hosts (vHosts) for each app within one RabbitMQ instance.&lt;/p&gt;
&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;
&lt;h3&gt;
  
  
  1. Password Pattern Management
&lt;/h3&gt;

&lt;p&gt;Ensuring a correct password pattern (devoid of characters like &lt;code&gt;oO0|.,@ ‘ “&lt;/code&gt;) became pivotal. Initially, RabbitMQ’s guest account didn’t require credentials. However, the shift to separate vhosts and vhost users made credentials indispensable, emphasizing the need for legible connection URL formats.&lt;/p&gt;
&lt;h3&gt;
  
  
  2. RabbitMQ Vhost Implementation
&lt;/h3&gt;

&lt;p&gt;The introduction of RabbitMQ vhosts added an additional task for our DevOps team. Managing vhost setup and credentials became an essential step. Despite the extra maintenance, the clarity it brought to connection URLs justified the effort.&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Reduced AWS Costs
&lt;/h3&gt;

&lt;p&gt;Consolidating from three instances to one yielded significant reductions in AWS costs. The average cost shrunk from 3x to 1x, offering tangible savings.&lt;/p&gt;

&lt;p&gt;Incorporating Connection URL in Code&lt;br&gt;
To enhance readability and maintain a secure connection, we implemented the following in our code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;
&lt;span class="c1"&gt;# Constructing Connection URL with Vhost Information 
&lt;/span&gt;&lt;span class="n"&gt;AMQP_URL_AND_PASSWORD&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;amqp://vhost_user:vhost_password@&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;RABBITMQ_IP&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;:5672/vhost_name&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This addition ensured a clear and secure connection URL, aligning with our strategy of effective RabbitMQ and Celery management.&lt;/p&gt;

&lt;p&gt;Adding Vhost and User via RabbitMQ Commands&lt;br&gt;
For readers looking to replicate our setup, the following commands can be used to add a vhost and user to RabbitMQ:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
# Adding a new vhost for the web app Celery instance 
sudo rabbitmqctl add_vhost &amp;lt;vhost_name&amp;gt;
# Creating a new user for the web app Celery instance with a secure password 
sudo rabbitmqctl add_user &amp;lt;vhost_user&amp;gt; &amp;lt;vhost_password&amp;gt;
# Setting permissions for the new user on the created vhost 
sudo rabbitmqctl set_permissions -p &amp;lt;vhost_name&amp;gt; &amp;lt;vhost_user&amp;gt; ".*" ".*" ".*"

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These commands help establish a segregated environment for the web app Celery instance, enhancing security and manageability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Our experience in merging three projects into a single instance wasn’t without challenges. The emergence of async task collision issues prompted a reevaluation of our approach. The adoption of RabbitMQ vhosts provided an effective solution, enhancing management, security with credentials, and driving substantial cost savings. This journey underscores the importance of addressing fundamental infrastructure concerns, even during rapid development sprints.&lt;/p&gt;

&lt;h2&gt;
  
  
  P.S:
&lt;/h2&gt;

&lt;p&gt;We specialize in procuring products and fostering application developments from overseas. Our robust team excels in mobile app development, encompassing Android, iOS, and Flutter platforms, as well as web app and dashboard development.&lt;/p&gt;

&lt;p&gt;Our track record includes successfully conceptualizing, developing, and delivering applications and infrastructure that have seamlessly scaled from initial stages to serving millions of users.&lt;/p&gt;

&lt;p&gt;For further inquiries and detailed discussions, please feel free to connect with us:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://pods.studio/"&gt;https://pods.studio/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>aws</category>
      <category>django</category>
      <category>rabbitmq</category>
    </item>
    <item>
      <title>Utilizing Root View Controller in iOS Development</title>
      <dc:creator>Jaleel Nazir</dc:creator>
      <pubDate>Wed, 11 Oct 2023 12:59:31 +0000</pubDate>
      <link>https://dev.to/jaleelnazir/utilizing-root-view-controller-in-ios-development-26bh</link>
      <guid>https://dev.to/jaleelnazir/utilizing-root-view-controller-in-ios-development-26bh</guid>
      <description>&lt;p&gt;In iOS development, the strategic use of root view controllers can significantly enhance the user experience and streamline your app's navigation flow. Root view controllers serve as pivotal points within the application, allowing you to control the display of content based on various scenarios.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Separating Application Flow&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Non-logged-in Users:&lt;/strong&gt; Before a user logs in, root view controllers can be employed to present essential screens such as splash screens, login screens, app introductions, or any other preliminary content that sets the stage for the user's journey.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Logged-in Users:&lt;/strong&gt; Once a user successfully logs in, root view controllers help transition to the core functionality of your app. This can include displaying the app's main home screen.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Other Custom Features:&lt;/strong&gt; In this context, root view controllers can handle scenarios like subscription expiration, enforcing updates, or guiding users through onboarding experiences.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Addressing Common Issues&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Performance Optimization:&lt;/strong&gt; By efficiently managing the presentation and dismissal of view controllers through root view controllers, you can minimize performance bottlenecks. This can help prevent issues like excessive memory usage, CPU overheating, and sluggish app performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Correct Screen Display:&lt;/strong&gt; Root view controllers provide a reliable way to track the current front-facing view controller. This ensures that the correct screen is displayed to the user, even when navigating back or undergoing changes in the navigation stack.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Helper Extensions&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Opening Controllers from Cells or Views:&lt;/strong&gt; Root view controllers allow you to open new controllers from within table view cells, collection view cells, or custom views, expanding your app's interactivity.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="kd"&gt;extension&lt;/span&gt; &lt;span class="kt"&gt;UIApplication&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="kd"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;topViewController&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;UIViewController&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;UIApplication&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;shared&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;keyWindow&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;rootViewController&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kt"&gt;UIViewController&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;navigationController&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;controller&lt;/span&gt; &lt;span class="k"&gt;as?&lt;/span&gt; &lt;span class="kt"&gt;UINavigationController&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;topViewController&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;navigationController&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;visibleViewController&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;tabController&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;controller&lt;/span&gt; &lt;span class="k"&gt;as?&lt;/span&gt; &lt;span class="kt"&gt;UITabBarController&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;selected&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tabController&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;selectedViewController&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;topViewController&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;selected&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;presented&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;?&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;presentedViewController&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;topViewController&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;presented&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;controller&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;// How to use&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="nv"&gt;vc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;UIApplication&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;topViewController&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;vc&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;openGuestLoginPrompt&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Handling Notifications:&lt;/strong&gt; You can use root view controllers to respond to notifications by presenting or opening relevant view controllers, ensuring a seamless user experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Diverse Navigation Techniques:&lt;/strong&gt; While presenting and dismissing view controllers and pushing and popping view controllers are common navigation techniques, root view controllers enable you to explore alternative methods to open screens, enhancing user engagement.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;In Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Mastering the use of root view controllers is a valuable skill for iOS developers. They act as gatekeepers, guiding users through your app's various states and scenarios. By leveraging root view controllers effectively, you can improve performance, maintain proper navigation, and offer a polished and responsive user experience.&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
    </item>
  </channel>
</rss>
