Skip to main content

Posts

Custom Loader (Activity Indicator) in Swift

Creating a custom activity indicator in Swift allows you to tailor the appearance and behavior of your loading spinner to fit the style of your app. Here's a step-by-step guide to creating a simple custom activity indicator using UIView Step 1: Create a New Swift File for the Custom Activity Indicator Create a new Swift file and name it  RotatingCirclesView.swift . Add the following code to define a custom UIView subclass for your activity indicator: // //   RotatingCirclesView.swift //   Welcome In // //   Created by Praveen Kumar on 05/09/24. // import UIKit class RotatingCirclesView : UIView {          let circle1 = UIView ( frame : CGRect ( x : 20 , y : 20 , width : 60 , height : 60 ))     let circle2 = UIView ( frame : CGRect ( x : 120 , y : 20 , width : 60 , height : 60 ))          let position : [ CGRect ] = [ CGRect ( x : 30 , y : 20 , width : 60 , height : 60 ), CGRect ( x : 60 , y : 15 , width : 70 , height : 70 ), CGRect ( x : 110 , y : 20 , width : 60 , heigh
Recent posts

Ios Algorithm Interview Questions and Answers

  1. What is Big O Notation, What Time and Space Complexity  Answer:- Big O Notation is a mathematical notation describe the limiting behavior of a function when the argument tends towards a particular value or infinity. बिग ओ नोटेशन एक गणितीय संकेतन है जो किसी फ़ंक्शन के सीमित व्यवहार का वर्णन करता है जब तर्क किसी विशेष मान या अनंत की ओर जाता है। "Big O Notation is key in Algorithms and Data Structure,  Big O Notation describe the complexity of your code using algebraic terms." "बिग ओ नोटेशन एल्गोरिदम और डेटा संरचना में महत्वपूर्ण है, बिग ओ नोटेशन बीजगणितीय शब्दों का उपयोग करके आपके कोड की जटिलता का वर्णन करता है।" Big O Notation describe the worst-case scenarios   with the complexity 1. O(1) :-  Constant Complexity -> Execution time does not depend on data size. For Example -  0(1) operations let array = [1, 2, 3, 4, 5, 6] Accessing an element in an array by index. print(array[0]) print(array[2]) Here is an example of an O(1) constant time complexity function i

Software Developer we understand the Client-Server Communication.🤔

  🌟 Polling and long-polling vs WebSockets vs Server-Sent Events (SSE)🌟 🔶WebSockets: Provides a persistent, full-duplex connection between the client and server. 🔶Server-Sent Events (SSE): Allows servers to push updates to the client over a single HTTP connection. 🔶Polling: Polling is a technique where the client regularly sends requests to the server to check for updates or new data. 🔶Long-Polling: Long-polling is an enhanced version of polling designed to reduce latency and resource usage. It keeps a connection open until the server has new information to send. Client-server communication is a fundamental aspect of networked applications where two main entities are involved: the client and the server. Understanding client-server communication is important for designing and implementing effective and efficient network applications like flight booking applications EaseMyTrip.com , Booking.com and stock market applications 5paisa , Upstox ). 🌟 Here's an overview of how