<?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>Forem: AJITHKUMAR K</title>
    <description>The latest articles on Forem by AJITHKUMAR K (@ajith_karuna).</description>
    <link>https://forem.com/ajith_karuna</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%2F984565%2F33fdeeb8-1f59-44f2-9a5e-907040c11c7c.jpg</url>
      <title>Forem: AJITHKUMAR K</title>
      <link>https://forem.com/ajith_karuna</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ajith_karuna"/>
    <language>en</language>
    <item>
      <title>CollectionView</title>
      <dc:creator>AJITHKUMAR K</dc:creator>
      <pubDate>Wed, 04 Jan 2023 09:56:14 +0000</pubDate>
      <link>https://forem.com/ajith_karuna/collectionview-4mg4</link>
      <guid>https://forem.com/ajith_karuna/collectionview-4mg4</guid>
      <description>&lt;p&gt;CollectionView is an object that presents the ordered collection of data items in the customizable layouts. It shows the data in the form of a grid layout. A collectionview is an instance of the UICollectionView class, which inherits the UIScrollView&lt;br&gt;
The data associated with the collection view is treated as the individual items which can be grouped into the sections to be represented into a grid layout on the iPhone screen. The UICollectionView is used in most of the iOS applications&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Methods:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;dequeueReusableCell(withReuseIdentifier:for:)&lt;/strong&gt;&lt;br&gt;
    is used to dequeue a reusable cell for a given index path. This method will either create a new cell or reuse an existing cell that is no longer visible, depending on whether or not a cell is already available for reuse.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;register(_:forCellWithReuseIdentifier:)&lt;/strong&gt;&lt;br&gt;
    is used to register a class or nib file for use in creating new cells.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;reloadData()&lt;/strong&gt;&lt;br&gt;
    is used to reload all of the data in the collection view, which causes the collection view to discard any existing cells and create new ones based on the current data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layouts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;UICollectionViewFlowLayout is the default layout for a collection view, it arranges the items in a grid with optional header and footer views&lt;br&gt;
UICollectionViewCompositionalLayout: Introduced in iOS13, it allow to create complex layouts using smaller composition layout units&lt;br&gt;
UICollectionViewLayout is an abstract base class that you can subclass to create your own custom layouts.&lt;br&gt;
It is necessary to set the layout for the collection view by assigning an instance of a UICollectionViewLayout subclass to the collection view's collectionViewLayout property.&lt;/p&gt;

&lt;p&gt;You can customize the layout using properties such as itemSize, minimumLineSpacing, minimumInteritemSpacing, etc..&lt;/p&gt;

&lt;p&gt;There is also the possibility to apply different layouts using setCollectionViewLayout(_:animated:), this allow to apply different layouts without reload the entire data.&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>linux</category>
      <category>qemu</category>
    </item>
    <item>
      <title>Navigation Controller</title>
      <dc:creator>AJITHKUMAR K</dc:creator>
      <pubDate>Mon, 02 Jan 2023 06:52:52 +0000</pubDate>
      <link>https://forem.com/ajith_karuna/navigation-controller-53f4</link>
      <guid>https://forem.com/ajith_karuna/navigation-controller-53f4</guid>
      <description>&lt;p&gt;The Navigation Controller manages one or more child view controllers in the navigation interface. Navigation Controllers are being used in almost every iOS application. Even though one or more child view controllers are managed into navigation stack, only one view controller appears on-screen at an instance. Selecting an item in the view controller pushes a new view controller on the screen. This process is animated and therefore hides the previous view controller. Let's look at the navigation interface used in the settings app on iOS.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--k_LI3nsA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v91z0jdtd826ywl8jpui.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--k_LI3nsA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v91z0jdtd826ywl8jpui.png" alt="Image description" width="391" height="321"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Navigation Controller Methods&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;init(rootViewController: UIViewController)&lt;/strong&gt;&lt;br&gt;
    It returns a newly created navigation controller with the specified root view controller.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;init(navigationBarClass: AnyClass?, toolbarClass: AnyClass?)&lt;/strong&gt;&lt;br&gt;
   initializes and returns a newly created navigation controller having the specified class for the navigation bar.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;pushViewController(UIViewController, animated: Bool)&lt;/strong&gt;&lt;br&gt;
    This method is used to push the specified view controller onto the receiver's stack and update the display.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;popViewController(animated: Bool) -&amp;gt; UIViewController?&lt;/strong&gt;&lt;br&gt;
   It returns a view controller that is popped (removed) from the navigation controller. This method is automatically triggered when the user taps the back button in the navigation bar.&lt;/p&gt;
&lt;h2&gt;
  
  
  Navigation Bar
&lt;/h2&gt;

&lt;p&gt;The navigation bar is used in the association with the navigation controller that is displayed along the top of the screen. It is the instance of the UINavigationBar class that inherits UIView.&lt;/p&gt;

&lt;p&gt;The UINavigationBar object is a bar that is displayed along the top of the View Controller window that is embedded in the Navigation Controller. A Navigation Bar contains the navigation items typically bar button items that are used to navigate within the hierarchy of screens. A typical Navigation Bar contains a back button displayed at the left of the bar, a center View Controller title, and the optional right bar buttons.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Left Item&lt;/strong&gt;&lt;br&gt;
   The Left item in the navigation bar provides the backward navigation to the previous view controller in the navigation stack. However, if the current topmost view controller contains a custom left bar button item, then it will be displayed. The leftBarButtonItem property of the View Controller's navigation item is used to set the custom left bar button item.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let back=UIBarButtonItem(title: "&amp;lt; Back", style: .plain, target: self, action: #selector(backAction))
        navigationItem.leftBarButtonItem=back
        navigationController?.navigationBar.backgroundColor = .white


@objc func backAction(){
        dismiss(animated: true, completion: nil)
    }

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Right Item&lt;/strong&gt;&lt;br&gt;
    To specify the custom Right bar button item, we use the rightBarButtonItem property.we can add System default System icosButtons like( save,add,action,camera)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let add=UIBarButtonItem(systemItem: .add)
        add.target=self
        add.action=#selector(addClickd)
        navigationItem.rightBarButtonItem=add
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;we can add arrayOfBarButtons&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let rightButton1= UIBarButtonItem(barButtonSystemItem: .camera, target: self, action: #selector(clickedCamera))  
let rightButton2 = UIBarButtonItem(barButtonSystemItem: .add, target: self, action: #selector(clickedAdd))  

 navigationItem.rightBarButtonItems = [rightButton1,rightButton2]  
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;sample App with navigationControl&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eJPODM5K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7zylum4z6ik5vshvod3q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eJPODM5K--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7zylum4z6ik5vshvod3q.png" alt="Image description" width="880" height="572"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;when click the row secondView is displayed by navigationControler then click back button previous View will be displayed secondView is pop from the navigationStack&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xGwyj3TN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wlnavokw9guzeuzorcw1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xGwyj3TN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wlnavokw9guzeuzorcw1.png" alt="Image description" width="880" height="572"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>ImageView</title>
      <dc:creator>AJITHKUMAR K</dc:creator>
      <pubDate>Sun, 01 Jan 2023 13:29:59 +0000</pubDate>
      <link>https://forem.com/ajith_karuna/imageview-521g</link>
      <guid>https://forem.com/ajith_karuna/imageview-521g</guid>
      <description>&lt;p&gt;ImageView can be defined as an object that can display the images on the interface of the iOS applications. It is the instance of the UIImageView class, which inherits UIView.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create UIImage&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  UIImage(named:"a-lion.jpeg")!, Name:"Lion")
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;create UIImageView&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DisplayView=UIImageView(image: modelList[indexPath.row].image)
        DisplayView.frame=CGRect(x: 100, y: 300, width: 200, height: 200)
        DisplayView.backgroundColor = .red
        DisplayView.clipsToBounds=true
        DisplayView.layer.borderWidth = 5
        DisplayView.layer.cornerRadius = 100
        view.addSubview(DisplayView)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhfiim31dxfr6y4dwsn6z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhfiim31dxfr6y4dwsn6z.png" alt="Image description" width="800" height="519"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>TableView</title>
      <dc:creator>AJITHKUMAR K</dc:creator>
      <pubDate>Wed, 28 Dec 2022 12:55:28 +0000</pubDate>
      <link>https://forem.com/ajith_karuna/tableview-3eid</link>
      <guid>https://forem.com/ajith_karuna/tableview-3eid</guid>
      <description>&lt;p&gt;&lt;strong&gt;TableView&lt;/strong&gt;&lt;br&gt;
  A table view is a user interface element that presents a scrollable list of items. It is a key component of iOS applications and is used to display and manage a collection of data in a vertically scrollable format. Table views are commonly used to display lists of items, such as contacts, settings, or emails.&lt;/p&gt;

&lt;p&gt;In iOS, table views are implemented using the UITableView class, which is a subclass of UIScrollView. The UITableView class provides a number of features for displaying and managing data, including support for custom cells, reordering, and variable row heights. Table views can be populated with data from a variety of sources, such as arrays or database queries, and can be customized to suit the needs of your application.&lt;/p&gt;

&lt;p&gt;To use a table view in an iOS application, you will typically create a subclass of UITableViewController and implement the necessary delegate and data source methods to manage the data displayed in the table. You can also use a UITableView as a standalone view by adding it to your view hierarchy and setting a data source and delegate.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TableView Delegate:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We can create the custom headers and footers for the sections in the tableview.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We can specify the custom heights for rows, headers, and footers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Provide height estimates for the rows, headers, and footers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We can define the method which can handle the row selections.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  TableView Delegate Methods
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;tableView(UITableView, willDisplay: UITableViewCell, forRowAt: IndexPath)&lt;/strong&gt;&lt;br&gt;
The tableview notifies this delegate when it is about to draw a cell for a particular row.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;tableView(UITableView, willSelectRowAt: IndexPath) -&amp;gt; IndexPath?&lt;/strong&gt;&lt;br&gt;
The tableview notifies this delegate method when the specified row is about to be selected.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;tableView(UITableView, didSelectRowAt: IndexPath)&lt;/strong&gt;&lt;br&gt;
This delegate is notified when the specified row of the tableview is selected.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;tableView(UITableView, willDeselectRowAt: IndexPath) -&amp;gt; IndexPath?&lt;/strong&gt;&lt;br&gt;
This delegate is notified when the particular cell is about to be deselected.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;tableView(UITableView, didDeselectRowAt: IndexPath)&lt;/strong&gt;&lt;br&gt;
This delegate is notified when the particular row is deselected.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;tableView(UITableView, heightForRowAt: IndexPath) -&amp;gt; CGFloat&lt;/strong&gt;&lt;br&gt;
This delegate method returns the height for the row.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;TableView DataSource:&lt;/strong&gt;&lt;br&gt;
 To maintain the data to be displayed by the tableview, we need to maintain a DataSource object that implements the UITableViewDataSource protocol. The datasource object manages the tableview data.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;It reports the number of rows and sections to be displayed in the tableview.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It allocates the reusable cells for each row in the tableview.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It provides the titles for headers and footers in the tableview sections.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To perform the above-mentioned tasks, there are some functions defined in the UITableviewDataSource protocol.&lt;/p&gt;

&lt;h2&gt;
  
  
  TableViewDatasource Methods
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -&amp;gt; Int&lt;/strong&gt;&lt;br&gt;
This method returns the number of rows to be displayed in the section of the tableview.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -&amp;gt; UITableViewCell&lt;/strong&gt;&lt;br&gt;
This method returns the number of sections to be displayed in the tableview.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;tableView(UITableView, cellForRowAt: IndexPath) -&amp;gt; UITableViewCell&lt;/strong&gt;&lt;br&gt;
This method returns the object of a UITableViewCell, which shows the actual content of a particular row in the tableview. This method inserts the cell for a particular row in the tableview.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;tableView(UITableView, titleForHeaderInSection: Int) -&amp;gt; String?&lt;/strong&gt;&lt;br&gt;
This method returns a string representing the title of the header in the section of the tableview.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;tableView(UITableView, titleForFooterInSection: Int) -&amp;gt; String?&lt;/strong&gt;&lt;br&gt;
This method returns a string representing the title of the footer in the section of the tableview.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;numberOfSections(in: UITableView) -&amp;gt; Int&lt;/strong&gt;&lt;br&gt;
This method returns the number of sections to be displayed in the tableview.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;sectionIndexTitles(for: UITableView) -&amp;gt; [String]?&lt;/strong&gt;&lt;br&gt;
It returns the array of the string containing the titles for the sections in the tableview.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sample App
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ahtmtgzujpste0m3le3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ahtmtgzujpste0m3le3.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvorh4s5htqqfm5ql28nj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvorh4s5htqqfm5ql28nj.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  sample app in tableView with sections
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzotxsa459uody97g9l97.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzotxsa459uody97g9l97.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Customize TableView cell&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To customize a table view cell in Swift, you'll need to do the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create a new subclass of UITableViewCell.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add any desired subviews to the cell's content view.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Override the setSelected() method of the cell and use it to position and configure the subviews.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Register the cell subclass with the table view using register(_:forCellReuseIdentifier:)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Dequeue and configure cells in the tableView(_:cellForRowAt:) data source method.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq4arpo7thairosswpzma.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq4arpo7thairosswpzma.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SwipAndAction in TableViewRow&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -&amp;gt; UITableViewCell.EditingStyle&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath)&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath) -&amp;gt; UITableViewCell.EditingStyle {
        return .delete
    }

 func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
        if editingStyle == .delete{
            tableView.beginUpdates()
            ContactList[indexPath.section].value.remove(at: indexPath.row)
            tableView.deleteRows(at:[indexPath], with: .right)
            tableView.endUpdates()
        }
    }

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

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm1it0hnivzqnpxx2t99d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm1it0hnivzqnpxx2t99d.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>UI View</title>
      <dc:creator>AJITHKUMAR K</dc:creator>
      <pubDate>Wed, 28 Dec 2022 05:33:49 +0000</pubDate>
      <link>https://forem.com/ajith_karuna/ui-view-hie</link>
      <guid>https://forem.com/ajith_karuna/ui-view-hie</guid>
      <description>&lt;p&gt;UIView can be defined as an object by using which we can create and manage the rectangular area on the screen. We can have any number of views inside a view to create a hierarchical structure of the UIViews.&lt;br&gt;
The UIView is managed by using the methods and properties defined in the UIView class that inherits UIKit.&lt;br&gt;
Views are the fundamentals of iOS application development, and that's why UIView is one of the most used object in the object library. The views are the basic building block of the iOS application, which renders the content within its bounds rectangle and also handles any interaction with the content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Layout and Sub view management&lt;/strong&gt;&lt;br&gt;
We can embed one or more subviews into the UIView. The appearance of the subviews can be managed by managing the appearance of the super view.&lt;br&gt;
We can define the auto-layout rules to govern the size and positioning of the view hierarchy on different iOS devices.&lt;br&gt;
&lt;strong&gt;Event Handling&lt;/strong&gt;&lt;br&gt;
A view can respond to the touch and another kind of event since it is the subclass of UIResponder.&lt;br&gt;
We can add the gesture recognizers for the uiview, such as UITapGestureRecognizer.&lt;/p&gt;
&lt;h2&gt;
  
  
  GestureRecognizer
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Tap gestures&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tap gestures detect one or more fingers touching the screen briefly. The fingers involved in these gestures must not move significantly from the initial touch points, and you can configure the number of times the fingers must touch the screen.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   let tapped=UITapGestureRecognizer(target: self, action: #selector(IsTapped))
        tapped.numberOfTapsRequired=2
        AppHeader.addGestureRecognizer(tapped)

 @objc func IsTapped(){
        AppHeader.backgroundColor = .green
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;long-press gestures&lt;/strong&gt;
Long-press (also known as press-and-hold) gestures detect one or more fingers (or a stylus) touching the screen for an extended period of time.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; let tapped=UILongPressGestureRecognizer(target: self, action: #selector(IsTapped))
        AppHeader.addGestureRecognizer(tapped)

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;swipe gestures&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A swipe gesture occurs when a person moves one or more fingers across the screen in a specific horizontal or vertical direction. Use the UISwipeGestureRecognizer class to detect swipe gestures.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;        let swipe=UISwipeGestureRecognizer(target: self, action: #selector(IsTapped))
        swipe.direction = .left
        AppBody.addGestureRecognizer(swipe)

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

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>View Controller Life Cycle</title>
      <dc:creator>AJITHKUMAR K</dc:creator>
      <pubDate>Wed, 28 Dec 2022 05:09:59 +0000</pubDate>
      <link>https://forem.com/ajith_karuna/view-controller-life-cycle-1476</link>
      <guid>https://forem.com/ajith_karuna/view-controller-life-cycle-1476</guid>
      <description>&lt;h2&gt;
  
  
  View controller Life Cycle :
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;loadView:&lt;/strong&gt;&lt;br&gt;
loadView( ) is a method managed by the viewController. The viewController calls it when its current view is nil. loadView( ) basically takes a view (that you create) and sets it to the viewController’s view (superview).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;viewDidLoad:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This Method is loaded once in view controller life cycle .Its Called When all the view are loaded .You Can do Some common task in this method :&lt;/p&gt;

&lt;p&gt;1.Network call which need Once.&lt;/p&gt;

&lt;p&gt;2.User Interface&lt;/p&gt;

&lt;p&gt;3.Others Task Those are Need to do Once&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;viewWillAppear:&lt;/strong&gt;&lt;br&gt;
This method is called every time before the view is visible to and before any animation is configured. In this method view has bound but orientation is not set yet. You can override this method to perform custom tasks associated with displaying the view such as hiding fields or disabling actions before the view becomes visible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;viewWillLayoutSubviews:&lt;/strong&gt;&lt;br&gt;
It doesn’t do Anything by default. When a view’s bounds change, the view adjusts the position of its subviews. The view controller can override this method to make changes before the view lays out its subviews.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;viewDidLayoutSubviews:&lt;/strong&gt;&lt;br&gt;
This method is called after the viewController has been adjusting to its subview following a change on its bound. Add code here if you want to make changes to subviews after they have been set.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;viewDidAppear:&lt;/strong&gt;&lt;br&gt;
This method is called after the view present on the screen. Usually, save data to core data or start animation or start playing a video or a sound, or to start collecting data from the network This type of task good for this method.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;viewWillDisappear:&lt;/strong&gt;&lt;br&gt;
This method is called before the view is removed from the view hierarchy. The View is Still on the view hierarchy but not removed yet. any unload animations haven’t been configured yet. Add code here to handle timers, hide the keyboard, canceling network requests, revert any changes to the parent UI. Also, this is an ideal place to save the state.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;viewDidDisappear:&lt;/strong&gt;&lt;br&gt;
This method is called after the VC’s view has been removed from the view hierarchy. Use this method to stop listening for notifications or device sensors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;didReceiveMemoryWarning()&lt;/strong&gt;&lt;br&gt;
When the memory starts to fill up, iOS does not automatically move data from memory to its limited hard disk space. It does, however, issue this warning and YOU (I mean YOU) are responsible for clearing some objects out of memory. Be aware that if the memory of your app goes over a certain threshold, iOS will shut down your app. Unfortunately, this will look like a crash to the end-user.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;viewWillTransition(to:with:)&lt;/strong&gt;&lt;br&gt;
When the interface orientation changes, UIKit calls this method on the window’s root view controller before the size changes are about to be made. The root view controller then notifies its child view controllers, propagating the message throughout the view controller hierarchy. The parameter to contains the new CGSize size of the container’s view and the parameter with contains a UIViewControllerTransitionCoordinator coordinator, an enum that describes the new orientation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;deinit:&lt;/strong&gt;&lt;br&gt;
Before a view controller is removed from memory, it gets deinitialized. You usually override deinit() to clean resources that the view controller has allocated that are not freed by ARC. Keep in mind that just because a VC is no longer visible, doesn’t mean that it has been deallocated. Container view controllers such as NavigationController can keep their VCs available in memory. Keep in mind that even though a VC is off-screen, if it is still in memory, it still works normally and can receive notifications.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>AppDelegate &amp; SceneDelegate</title>
      <dc:creator>AJITHKUMAR K</dc:creator>
      <pubDate>Wed, 28 Dec 2022 04:35:16 +0000</pubDate>
      <link>https://forem.com/ajith_karuna/appdelegate-scenedelegate-3in6</link>
      <guid>https://forem.com/ajith_karuna/appdelegate-scenedelegate-3in6</guid>
      <description>&lt;h2&gt;
  
  
  AppDelegate
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;This is still main entry point for iOS 13+ application. System calls appdelegate methods for application level life cycle events.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In apple’s default templet, you can find below three methods&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;func application(_:didFinishLaunchingWithOptions:) -&amp;gt; Bool&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
This method is used to perform application setup.&lt;/li&gt;
&lt;li&gt;
In iOS 12 or earlier, you might have used this method to create and configure a UIWindow object and assigned a UIViewController instance to the window to make it appear.Now appdelegate is no longer responsible for this&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;func application(_:configurationForConnecting:options:) -&amp;gt; UISceneConfiguration&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
This method is called whenever your application is expected to supply a new scene, or window for iOS to display.&lt;/li&gt;
&lt;li&gt;
This method is not called when your app launches initially, it’s only called to obtain and create new scenes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;func application(_:didDiscardSceneSessions:)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;This method is called whenever a user discards a scene.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can use this function to dispose of resources that these scenes used, because they’re not needed anymore.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  SceneDelegate
&lt;/h2&gt;

&lt;p&gt;There are several methods in the SceneDelegate.swift file by default:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;sceneDidDisconnect(_:)&lt;/strong&gt; &lt;br&gt;
is called when a scene has been disconnected from the app (Note that it can reconnect later on.)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;sceneDidBecomeActive(_:)&lt;/strong&gt;&lt;br&gt;
is called when the user starts interacting with a scene, such as selecting it from the app switcher&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;sceneWillResignActive(_:)&lt;/strong&gt;&lt;br&gt;
is called when the user stops interacting with a scene, for example by switching to another scene&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;sceneWillEnterForeground(_:)&lt;/strong&gt;&lt;br&gt;
is called when a scene enters the foreground, i.e. starts or resumes from a background state&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;sceneDidEnterBackground(_:)&lt;/strong&gt;&lt;br&gt;
is called when a scene enters the background, i.e. the app is minimised but still present in the background.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;sample&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ftJN3q0B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vryif1uka1x7akidde0t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ftJN3q0B--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vryif1uka1x7akidde0t.png" alt="Image description" width="880" height="572"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--OLp4ZEGu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rs0x2pi5j84ztdwx7p62.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--OLp4ZEGu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rs0x2pi5j84ztdwx7p62.png" alt="Image description" width="880" height="572"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>iOS Application Lifecycle</title>
      <dc:creator>AJITHKUMAR K</dc:creator>
      <pubDate>Mon, 26 Dec 2022 11:03:19 +0000</pubDate>
      <link>https://forem.com/ajith_karuna/ios-application-lifecycle-kfa</link>
      <guid>https://forem.com/ajith_karuna/ios-application-lifecycle-kfa</guid>
      <description>&lt;p&gt;&lt;strong&gt;Why do we need to know&lt;/strong&gt;&lt;br&gt;
Firstly, we should respond properly to the launch of the app. Some third-party libraries need set up in different states of the app. Also, we should prepare the app to work in the foreground. We might need to provide a different user experience. For instance, our app can require a password whenever it goes to the foreground. On the other hand, our app can upload images while the app is in the background like Dropbox does. Even we might want to reopen from where the user left after the termination of the app. So, each feature requires different implementations in different app states. So, it can be critical to know the states and the transitions while providing a different and better user experience.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Application lifecycle&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx39n3p1lo07txhixf2a9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx39n3p1lo07txhixf2a9.png" alt="Image description" width="336" height="562"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Not Running:&lt;/strong&gt; &lt;br&gt;
The app is not launched or terminated by the system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Background:&lt;/strong&gt; &lt;br&gt;
App is in the background and still able to run code. But the duration of this state is determined by the OS and code execution can be interrupted at any time. If the developer requests extra time to execute some code, the period can be longer. There are some situations in which the app can be launched directly into the background mode. For example, the app can start in background mode if the app starts downloading some content when the remote push notification is received.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Foreground&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Inactive:&lt;/strong&gt; &lt;br&gt;
It’s generally a transition state between active and background state to launch of the app. For example, if we receive a phone call when the app is in the foreground, it goes into an inactive state.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Active:&lt;/strong&gt;&lt;br&gt;
 The app is in the active state when it is in the foreground and it’s able to receive events.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Suspended:&lt;/strong&gt;&lt;br&gt;
 When the app is in the background state, the system suspends it and the app cannot execute any code. There isn’t any notification for the suspending event. The system automatically suspends the app.&lt;/p&gt;

</description>
      <category>gratitude</category>
    </item>
    <item>
      <title>UI Controls</title>
      <dc:creator>AJITHKUMAR K</dc:creator>
      <pubDate>Mon, 26 Dec 2022 10:02:03 +0000</pubDate>
      <link>https://forem.com/ajith_karuna/ui-controls-4122</link>
      <guid>https://forem.com/ajith_karuna/ui-controls-4122</guid>
      <description>&lt;h2&gt;
  
  
  Label
&lt;/h2&gt;

&lt;p&gt;a label is a visual element that displays text. It is an instance of the UILabel class, which is a subclass of UIView. Labels are commonly used to display static text, such as labels for form fields or titles for sections of content.&lt;br&gt;
A label has a number of properties that you can use to customise its appearance, such as its font, text colour, and alignment and more.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let label=UILabel()
        label.text="Welcome to zoho!"
        label.textAlignment = .center
        label.textColor = .blue
        label.frame=CGRect(x: 5, y: 60, width: 150, height: 20)
        view.addSubview(label)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Button
&lt;/h2&gt;

&lt;p&gt;It is a control that enables the user to interact with the application. It is used to trigger the events performed by the user. It executes the custom code in response to user interactions.&lt;/p&gt;

&lt;p&gt;The buttons are one of the most important parts of iOS applications. Buttons are associated with the actions that are performed when the user interacts with the button. We can add the button to the iOS application programmatically or by using interface builder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private let Button:UIButton={
            let btn=UIButton()
            btn.setTitle("Login", for: .normal)
            btn.setTitleColor(UIColor.black, for: .normal)
            btn.frame = CGRect(x: 5, y: 200, width: 50, height: 25)
            btn.backgroundColor = .systemMint
            btn.addTarget(target, action: #selector(call),for: .touchUpInside)
            return btn
        }()

 @objc func call(){
            print("button clicked")
            Button.backgroundColor = .red
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  TextField
&lt;/h2&gt;

&lt;p&gt;It can be defined as an object which is used to display an editable text area in the interface. Textfields are used to get the text-based input from the user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private let userNameText:UITextField={
        let text=UITextField()
        text.placeholder="Username"
        text.borderStyle = .roundedRect
        text.textColor = .black
        text.frame = CGRect(x: 5, y:100 , width: 200, height: 40)
        return text
    }()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  DatePicker
&lt;/h2&gt;

&lt;p&gt;DatePicker is a control used in IOS applications to get the date and time values from the user. We can allow the user to either enter the time in point or time interval.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private let DatePicker:UIDatePicker={
            let picker=UIDatePicker()
            picker.frame=CGRect(x: 5, y: 300, width: 300, height: 30)
            picker.backgroundColor = .lightGray
            return picker
        }()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Slider
&lt;/h2&gt;

&lt;p&gt;A slider can be defined as a UIControl, which provides the contiguous range of values on a single scale to the user, out of which the user is prompted to select a single value.&lt;br&gt;
The slider is connected with the action method, which is notified every time the user moves the thumb onto a slider. The value of the slider can be retrieved each time the action method is called.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private let Slider:UISlider={
        let slider=UISlider()
        slider.frame=CGRect(x: 5, y: 400, width: 200, height: 50)
        slider.minimumValue=0
        slider.maximumValue=100
        slider.thumbTintColor = .green
        return slider
    }()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Stepper
&lt;/h2&gt;

&lt;p&gt;It is a type of UIControl which is used to increase and decrease value. The stepper consists of two buttons. It is associated with a value which gets repeatedly increased or decreased on holding down two of the buttons once at a time. The rate of the change depends on the duration the user presses the control.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private let Stepper={
        var steper=UIStepper()
        steper.frame=CGRect(x: 5, y: 480, width: 30, height: 60)
        steper.backgroundColor = .white
        steper.value=0
        steper.minimumValue = -10
        steper.maximumValue = 10

        steper.addTarget(self, action: #selector(stepperValueChanged(_:)), for: .valueChanged)
        return steper
    }()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Switch
&lt;/h2&gt;

&lt;p&gt;The switch can be defined as the UIControl, which provides binary choices to the user either on or off. The state of a switch is managed by properties and methods defined in the UISwitch class, which is the subclass of UIControl.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private let Switch:UISwitch={
        let Switch=UISwitch()
        Switch.frame=CGRect(x: 5, y: 250, width: 50, height: 30)
        Switch.isOn=true
        Switch.setOn(true, animated: false)
        return Switch
    }()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Segment
&lt;/h2&gt;

&lt;p&gt;Segment control can be defined as the horizontal control, which controls multiple segments where a discrete button controls each segment. A segment control can be used to display multiple views within a single view controller, where each view can be displayed by using a discrete button.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private let segmant:UISegmentedControl={
        let segmentItems = ["First", "Second"]
        let seg=UISegmentedControl(items: segmentItems)
        seg.frame=CGRect(x: 5, y: 550, width: 150, height: 50)
        seg.backgroundColor = .white
        seg.addTarget(self, action: #selector(segmentControl(_:)), for: .valueChanged)
        seg.selectedSegmentIndex=0
        seg.selectedSegmentTintColor = .lightGray
        seg.tintColor = .blue
        return seg
    }()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Sample App&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgzrxr4un3c22x50up3ea.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgzrxr4un3c22x50up3ea.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>View and View Controller</title>
      <dc:creator>AJITHKUMAR K</dc:creator>
      <pubDate>Mon, 26 Dec 2022 09:33:49 +0000</pubDate>
      <link>https://forem.com/ajith_karuna/view-and-view-controller-2hj6</link>
      <guid>https://forem.com/ajith_karuna/view-and-view-controller-2hj6</guid>
      <description>&lt;p&gt;&lt;strong&gt;View&lt;/strong&gt;&lt;br&gt;
  In iOS, a view is a rectangular area that displays content and can be placed within the hierarchy of an app's user interface. It is an instance of the UIView class, which is a subclass of UIResponder.&lt;/p&gt;

&lt;p&gt;It provides the infrastructure for displaying visual content on the screen and for handling user interactions. UIView has a number of properties that you can use to customise its appearance, such as its background colour, frame, and alpha value (which determines its transparency).&lt;br&gt;
You can also add subviews to a view, which allows you to create complex layouts by nesting views within one another. For example, you might have a view that contains an image view and a label view, which are both subviews of the main view.&lt;/p&gt;

&lt;p&gt;Views are typically created programmatically or in a storyboard using Interface Builder. They are then added to the view hierarchy of an app and positioned on the screen using layout constraints. Layout constraints are a set of rules that describe how a view should be positioned relative to its parent view or to other views in the layout.&lt;/p&gt;

&lt;h2&gt;
  
  
  View Controller
&lt;/h2&gt;

&lt;p&gt;a view controller is a class that manages a view and its associated data. It is responsible for the presentation of the view on the screen and for handling user interactions with the view.&lt;br&gt;
It is an instance of the UIViewController class, which is a subclass of UIResponder. It has a view property, which is an instance of UIView, and it is responsible for creating and configuring the view and for adding it to the view hierarchy.&lt;/p&gt;

&lt;p&gt;A view controller can also manage the data displayed in its view, such as by fetching data from a network or a database and updating the view when the data changes. It can also respond to user interactions with the view, such as by handling button taps or gesture recognition.&lt;/p&gt;

&lt;h2&gt;
  
  
  Content ViewController
&lt;/h2&gt;

&lt;p&gt;Content ViewControllers are the main type of View Controllers that we create. The Content View Controllers holds the content of the Application screen. In other words, we can say that the Content View Controller manages the discrete piece of the application content. The Content ViewController manages all the Views itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Container ViewController
&lt;/h2&gt;

&lt;p&gt;Container ViewController is different from content ViewController in the sense that it acts as a parent View Controller, which collects information from the child view controllers. The task of the container view controller is to present the collected information to facilitate the navigation to the child view controllers. The container ViewController only manages the RootView, which incorporates one or more Child ViewControllers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ViewManagement&lt;/strong&gt;&lt;br&gt;
  ViewController manages the hierarchy of views. As shown in the below image, each ViewController contains a RootView which contains all the content of the view controller. All the custom views needed to maintain an iOS application is added to the root view to display the content.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7wboslp4f6x3x94ob2um.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7wboslp4f6x3x94ob2um.png" alt="Image description" width="423" height="414"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>devops</category>
    </item>
    <item>
      <title>UserInterface</title>
      <dc:creator>AJITHKUMAR K</dc:creator>
      <pubDate>Mon, 26 Dec 2022 07:08:37 +0000</pubDate>
      <link>https://forem.com/ajith_karuna/userinterface-2lce</link>
      <guid>https://forem.com/ajith_karuna/userinterface-2lce</guid>
      <description>&lt;p&gt;&lt;strong&gt;UserInterface (UI)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;(UI) refers to the way that an app looks and how it presents itself to the user. It includes all of the visual elements of the app, such as buttons, labels, text fields, and other controls, as well as the layout and arrangement of those elements on the screen.&lt;/p&gt;

&lt;p&gt;The UI of an iOS app is created using UIKit, a framework provided by Apple that includes a wide range of pre-built UI elements and layout tools. Developers can use UIKit to create a wide variety of user interfaces, from simple, static layouts to more complex, interactive interfaces.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;UIKit provides a number of tools for creating and managing the UI of an iOS app&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;View &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;View controllers&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;UI Controles&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Auto Layout&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Animations&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;there are two ways can create UI components in Xcode&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;StoryBoard&lt;/strong&gt;&lt;br&gt;
 Storyboards are a visual tool for designing the user interface of an iOS app. They allow you to see the layout and flow of your app's screens in a single place, and create connections between them using segues. Storyboards are a good choice for prototyping and quickly iterating on the design of an app, as they provide a fast and intuitive way to see the changes you make.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code&lt;/strong&gt;&lt;br&gt;
  you can create complex layouts and animations that may be difficult to achieve with a storyboard. It also allows you to reuse components of your user interface in different parts of your app, by creating custom views and view controllers. However, manual code can be more time-consuming to write and maintain, as you'll need to manually manage the layout and behaviour of your user interface elements.&lt;/p&gt;

&lt;p&gt;the choice between using a storyboard and manual code will depend on the specific needs of your app and your personal development style. Some developers prefer the visual and rapid prototyping capabilities of storyboards, while others prefer the flexibility and control of manual code. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Xcode</title>
      <dc:creator>AJITHKUMAR K</dc:creator>
      <pubDate>Mon, 26 Dec 2022 05:46:34 +0000</pubDate>
      <link>https://forem.com/ajith_karuna/xcode-e9i</link>
      <guid>https://forem.com/ajith_karuna/xcode-e9i</guid>
      <description>&lt;p&gt;&lt;strong&gt;Xcode&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Xcode is a integrated development environment (IDE) for macOS containing a suite of software development tools developed by Apple for developing software for macOS, iOS, iPadOS, watchOS, and tvOS. &lt;br&gt;
Xcode provides everything developers need to create great applications for Apple's various platforms. It includes a source code editor, a debugger, and other tools for designing, building, and debugging applications. It also includes a variety of pre-built user interface (UI) elements, such as buttons and text fields, that developers can use in their applications. Xcode is free to download and use from the Mac App Store.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;PlayGround&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;IOS Project&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  PlayGround
&lt;/h2&gt;

&lt;p&gt;Playgrounds are a great way to try out new ideas and test code snippets without having to create a full Xcode project.&lt;br&gt;
In a playground, you can write Swift code and see the results immediately, as the code is executed as you type.You can then start writing code in the editor on the left side of the window, and see the results in the live view on the right side.&lt;br&gt;
Inline code execution is a feature of Xcode playgrounds that allows developers to execute code snippets directly within a playground, without having to write a full function or statement. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
A playground does not go through a build process, as the code is executed directly within the playground environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  IOS Project
&lt;/h2&gt;

&lt;p&gt;iOS project is a full-fledged application that can be built, compiled, and run on an iOS device or simulator. An iOS project includes all of the files, resources, and code needed to create a functional app, including a user interface, business logic, and other functionality.&lt;br&gt;
it is a more complete and fully-featured development environment&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;iOS project goes through a build process when it is compiled, in which the source code is transformed into a binary executable that can be run on an iOS device or simulator.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;An iOS project can be deployed to an iOS device or simulator, or submitted to the App Store for distribution to users.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
  </channel>
</rss>
