<?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: Saeid Rezaei</title>
    <description>The latest articles on DEV Community by Saeid Rezaei (@saeedrz).</description>
    <link>https://dev.to/saeedrz</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%2F660685%2F92bfca43-8d9e-408f-8ec0-98cf588faaa7.jpeg</url>
      <title>DEV Community: Saeid Rezaei</title>
      <link>https://dev.to/saeedrz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/saeedrz"/>
    <language>en</language>
    <item>
      <title>Setting Up GitHub Actions for Continuous Integration</title>
      <dc:creator>Saeid Rezaei</dc:creator>
      <pubDate>Sat, 21 Jun 2025 13:33:28 +0000</pubDate>
      <link>https://dev.to/saeedrz/setting-up-github-actions-for-continuous-integration-1m45</link>
      <guid>https://dev.to/saeedrz/setting-up-github-actions-for-continuous-integration-1m45</guid>
      <description>&lt;p&gt;When working on a project, keeping your builds clean and your tests passing is key to a smooth development process. In this post, I'll guide you through setting up a GitHub Action workflow that automates building and testing your app every time you push changes to your repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why GitHub Actions?
&lt;/h2&gt;

&lt;p&gt;Continuous Integration (CI) is an essential part of modern app development. By integrating GitHub Actions into your workflow, you can ensure that every pull request and commit is automatically built and tested - catching issues early and boosting confidence in your codebase.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/X2h-tCtnPRU"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;Before diving in, make sure you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A repository already set up on GitHub (in our case, &lt;a href="https://medium.com/r/?url=https%3A%2F%2Fgithub.com%2Fsaeed-rz%2FSwiftUIDeepLinking" rel="noopener noreferrer"&gt;SwiftUIDeepLinking&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Basic familiarity with GitHub Actions and YAML syntax.&lt;/li&gt;
&lt;li&gt;Xcode is installed locally to verify that your project builds correctly.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Creating the Workflow File
&lt;/h2&gt;

&lt;p&gt;GitHub Actions uses YAML files to define workflows. In your repository, create the following directory structure if it doesn't exist:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.github/
└── workflows/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside the &lt;strong&gt;workflows&lt;/strong&gt; folder, create a file named &lt;strong&gt;ci.yml&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Triggers&lt;/strong&gt;: The on key specifies the events that will trigger the execution of your workflow. For a typical Swift project, you might want to trigger the CI process whenever code is pushed to the main branch or when a pull request is opened or updated targeting specific branches.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: CI

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Job Environment:&lt;/strong&gt; This section defines one or more jobs that will be executed by the workflow. Each job has a unique identifier (e.g., build) and a more descriptive name that appears in the GitHub Actions UI (e.g., Build and Test). The runs-on key within a job definition specifies the type of virtual machine runner that will execute the job.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: CI

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:
    name: Build and Test
    runs-on: macos-latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Steps
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Checkout Code:&lt;/strong&gt; The workflow checks out your repository so that it can access your project files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Set Up Xcode:&lt;/strong&gt; Using the maxim-lobanov/setup-xcode action ensures that the correct version of Xcode is installed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Build:&lt;/strong&gt; This command cleans and builds your project. Adjust the -project and -scheme flags if your project structure differs.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: CI

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

jobs:
  build:
    name: Build and Test
    runs-on: macos-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Set up Xcode
        uses: maxim-lobanov/setup-xcode@v1
        with:
          xcode-version: '16.2'
      - name: Build
        run: |
          xcodebuild clean build \
          -project Deep_Linking_with_TCA/DeepLinkTCA.xcodeproj \
          -scheme DeepLinkTCA \
          -destination 'platform=iOS Simulator,name=iPhone 16,OS=latest'
          -skipPackagePluginValidation 
          -skipMacroValidation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Verifying Your Setup
&lt;/h2&gt;

&lt;p&gt;Once you've committed the ci.yml file, navigate to the Actions tab in your GitHub repository. You should see your workflow listed and running on your next push or pull request. Any build or test errors will be displayed there, making it easier to catch issues early. Here is the link to the final ci.yml file.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion: Taking Your Swift CI/CD to the Next Level
&lt;/h2&gt;

&lt;p&gt;Setting up a CI/CD pipeline for your Swift project using GitHub Actions offers numerous benefits, from improved code quality and reduced manual effort to faster feedback loops and accelerated development cycles. By automating the build and test processes, you can ensure that your codebase remains stable and reliable with every change.&lt;/p&gt;

</description>
      <category>githubactions</category>
      <category>cicd</category>
      <category>ios</category>
      <category>xcodebuild</category>
    </item>
    <item>
      <title>Custom Text in SwiftUI</title>
      <dc:creator>Saeid Rezaei</dc:creator>
      <pubDate>Mon, 12 Aug 2024 15:16:13 +0000</pubDate>
      <link>https://dev.to/saeedrz/custom-text-in-swiftui-2gpi</link>
      <guid>https://dev.to/saeedrz/custom-text-in-swiftui-2gpi</guid>
      <description>&lt;p&gt;In this post, I’m going to talk about how to create custom Text in SwiftUI with ViewModifier.&lt;/p&gt;

&lt;p&gt;The Text view in SwiftUI provides a convenient way to display and format text content in a clear and readable manner. But, as you develop more complex interfaces, you may find that you need to style your text in specific ways to meet the design requirements. In this case, you can use View Modifiers to add extra functionality and styling to the Text view.&lt;/p&gt;

&lt;p&gt;The ViewModifier protocol in SwiftUI is a powerful tool that allows developers to modify the view in a more structured way. It provides an easy way to apply multiple modifiers to a single view and allows the developer to define custom modifiers that can be used across multiple views. This helps simplify and streamline the process of creating and maintaining complex user interfaces. The ViewModifier protocol also helps to create a more consistent look and feel across the user interface, and it can be used to create a wide range of custom user interface elements.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdie9e31kdpr9b5pxrbie.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdie9e31kdpr9b5pxrbie.png" alt="Custom Text with Icon" width="720" height="524"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A View Modifier in SwiftUI is a type that conforms to the ViewModifier protocol. The protocol defines a single method named body that takes in a View and returns a modified version of that View. View Modifiers are applied to views by calling the modifier method on the view, passing in an instance of the View Modifier.&lt;/p&gt;

&lt;p&gt;Here’s an example of how to create a View Modifier that adds an icon to the Text view:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="kd"&gt;struct&lt;/span&gt; &lt;span class="kt"&gt;IconText&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;ViewModifier&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="nv"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Image&lt;/span&gt;

    &lt;span class="nf"&gt;init&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;icon&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;icon&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kd"&gt;func&lt;/span&gt; &lt;span class="nf"&gt;body&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="kd"&gt;some&lt;/span&gt; &lt;span class="kt"&gt;View&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;HStack&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;icon&lt;/span&gt;
            &lt;span class="n"&gt;content&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We define a struct called IconText that conforms to the ViewModifier protocol. The body method takes in a Content view and returns a new view with an image on the left.&lt;/p&gt;

&lt;p&gt;To use this View Modifier, you can simply call the modifier method on a Text view and pass in an instance of IconText:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;&lt;span class="kt"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Icon button"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;modifier&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;IconText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;Image&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;systemName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"play.fill"&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will result in a Text with the text “Icon button” and a play icon on the left.&lt;/p&gt;

&lt;p&gt;It’s worth noting that View Modifiers can be composed and applied to a view multiple times to achieve complex styling.&lt;/p&gt;

&lt;p&gt;In conclusion, View Modifiers provide an elegant and reusable way to add functionality and styling to your SwiftUI views. They are a great tool for keeping your code clean and readable and are especially useful when you need to apply the same styling to multiple views. So, next time you’re developing a complex interface in SwiftUI, consider using View Modifiers to help simplify your code.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/LOX67zYh6dU"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>swift</category>
      <category>swiftui</category>
      <category>viewmodifier</category>
      <category>iosdevelopment</category>
    </item>
    <item>
      <title>Reference Type and Value Type in Swift</title>
      <dc:creator>Saeid Rezaei</dc:creator>
      <pubDate>Tue, 02 Apr 2024 15:38:49 +0000</pubDate>
      <link>https://dev.to/saeedrz/reference-type-and-value-type-in-swift-863</link>
      <guid>https://dev.to/saeedrz/reference-type-and-value-type-in-swift-863</guid>
      <description>&lt;p&gt;In this post, I'm going to talk about one of the basic features of Swift, which exists in most programming languages.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Value type&lt;/li&gt;
&lt;li&gt;Reference type&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When working with variables in Swift, it's important to understand the difference between reference types and value types. In this story, we'll explore the key differences between the two and provide examples of when to use each type.&lt;/p&gt;

&lt;h3&gt;
  
  
  Reference types
&lt;/h3&gt;

&lt;p&gt;such as classes, are variables that store a reference to an object in memory. When one variable is assigned to another variable, they both point to the same object in memory. Any changes made to the object will be reflected in both variables.&lt;/p&gt;

&lt;h3&gt;
  
  
  Value Types
&lt;/h3&gt;

&lt;p&gt;on the other hand, are variables that store a copy of the object in memory. When one variable is assigned to another variable, they each get their own copy of the object. Any changes made to one variable will not affect the other variable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fte15l3lm2199cz5sedmt.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fte15l3lm2199cz5sedmt.jpeg" alt="Variable and Variable2 are Value type and Variable3 and Variable4 are Reference type" width="720" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's see an example for reference type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;final class User {
    var name: String
    init(name: String) {
        self.name = name
    }
}

var user1 = User(name: "Saeed")
var user2 = user1
user2.name = "David"

print(user1.name) // prints "David"
print(user2.name) // also prints "David"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In this example, we have a class called &lt;code&gt;User&lt;/code&gt; with a property called &lt;code&gt;name&lt;/code&gt;. We create two variables, &lt;code&gt;user1&lt;/code&gt; and &lt;code&gt;user2&lt;/code&gt;, and assign &lt;code&gt;user1&lt;/code&gt; to &lt;code&gt;user2&lt;/code&gt;. Since &lt;code&gt;User&lt;/code&gt; is a reference type, both variables point to the same object in memory. When we change the &lt;code&gt;name&lt;/code&gt; property of &lt;code&gt;user2&lt;/code&gt; to "David", the &lt;code&gt;name&lt;/code&gt; property of &lt;code&gt;user1&lt;/code&gt; is also changed to "David".&lt;br&gt;
Here's an example of a value type:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;struct Location {
    var x: Int
    var y: Int
}

var location1 = Point(x: 0, y: 0)
var location2 = location1
location2.x = 5

print(location1.x) // prints 0
print(location2.x) // prints 5
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In this example, we have a struct called &lt;code&gt;Location&lt;/code&gt; with properties &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt;. We create two variables, &lt;code&gt;location1&lt;/code&gt; and &lt;code&gt;location2&lt;/code&gt;, and assign &lt;code&gt;location1&lt;/code&gt; to &lt;code&gt;location2&lt;/code&gt;. Since &lt;code&gt;Location&lt;/code&gt; is a value type, both variables have their own copy of the struct. When we change the &lt;code&gt;x&lt;/code&gt; property of &lt;code&gt;location2&lt;/code&gt; to 5, the &lt;code&gt;x&lt;/code&gt; property of &lt;code&gt;location1&lt;/code&gt; is not affected and remains 0.&lt;/p&gt;

&lt;p&gt;In Swift, &lt;strong&gt;class&lt;/strong&gt; is a &lt;strong&gt;reference type&lt;/strong&gt; and &lt;strong&gt;struct&lt;/strong&gt; is a &lt;strong&gt;value type&lt;/strong&gt;.&lt;br&gt;
It's important to understand the difference between reference types and value types and choose the appropriate type for your needs. Reference types are useful when you want multiple variables to refer to the same object in memory, while value types are useful when you want to maintain a separate copy of the object for each variable.&lt;br&gt;
For example, If you ever programmed for UIKit you'll know that they use classes for views rather than structs. but SwiftUI uses struct, there are a couple of reasons for it which you can search and find out the benefits behind this decision.&lt;/p&gt;
&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;Reference and Value types in Swift are two important concepts that every developer should be familiar with, they are the fundamental building blocks of the language, and using them correctly will make your code more efficient, readable and maintainable.&lt;/p&gt;




&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
      &lt;div class="c-embed__cover"&gt;
        &lt;a href="https://towardsdev.com/reference-type-and-value-type-in-swift-5117e7051162" class="c-link s:max-w-50 align-middle" rel="noopener noreferrer"&gt;
          &lt;img alt="" src="https://res.cloudinary.com/practicaldev/image/fetch/s--Yph68ZPd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/v2/resize:fit:1200/1%2AYU5lK9Z394ZnJo_DPSmnXQ.png" height="456" class="m-0" width="800"&gt;
        &lt;/a&gt;
      &lt;/div&gt;
    &lt;div class="c-embed__body"&gt;
      &lt;h2 class="fs-xl lh-tight"&gt;
        &lt;a href="https://towardsdev.com/reference-type-and-value-type-in-swift-5117e7051162" rel="noopener noreferrer" class="c-link"&gt;
          Reference Type and Value Type in Swift | by Saeid Rezaeisadrabadi | Towards Dev
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;p class="truncate-at-3"&gt;
          When working with variables in Swift, it’s important to understand the difference between reference types and value types.
        &lt;/p&gt;
      &lt;div class="color-secondary fs-s flex items-center"&gt;
          &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://res.cloudinary.com/practicaldev/image/fetch/s--m4QPrN0P--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://miro.medium.com/v2/resize:fill:256:256/1%2Ac2OaLMtxURd1SJZOGHALWA.png" width="128" height="128"&gt;
        towardsdev.com
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;



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