<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Pulkit Gulati on Medium]]></title>
        <description><![CDATA[Stories by Pulkit Gulati on Medium]]></description>
        <link>https://medium.com/@pulkitgulati?source=rss-a69365c7ee16------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*H6SdVYMGwKmAe_0i.</url>
            <title>Stories by Pulkit Gulati on Medium</title>
            <link>https://medium.com/@pulkitgulati?source=rss-a69365c7ee16------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 05:23:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pulkitgulati/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[When to present a ViewController programatically]]></title>
            <link>https://medium.com/@pulkitgulati/when-to-present-a-viewcontroller-programatically-f86d2ed8f5c8?source=rss-a69365c7ee16------2</link>
            <guid isPermaLink="false">https://medium.com/p/f86d2ed8f5c8</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ipad]]></category>
            <dc:creator><![CDATA[Pulkit Gulati]]></dc:creator>
            <pubDate>Wed, 17 Oct 2018 19:45:07 GMT</pubDate>
            <atom:updated>2018-10-17T19:45:07.777Z</atom:updated>
            <content:encoded><![CDATA[<p>While working on my app, I came across this scenario where I have a ViewController containing a UITableView. The UITableViewCell has a UIImage, tapping which opens another ViewController that presents a list of images to be selected. Phew…!!</p><p><strong>To segue or not to segue!</strong></p><p>Firstly, I tried adding a segue from the First VC to the Second VC. Calling a method when tapping UITapGestureRecognizer and then calling performSegue method:</p><p>performSegue(withIdentifier: &quot;chooseicon&quot;, sender: sender)</p><p>and then:</p><p>override func prepare(for segue: UIStoryboardSegue, sender: Any?) { ...}</p><p>But that opens the Second VC even if I tap anywhere on the UITableViewCell.</p><p>I wanted the Second VC to be opened only when tapping the image in the cell, so in this scenario, I did not use segue and instead use Present for the new VC inside the Tap gesture method as shown in the Safe Present method:</p><p>if let iconVC = UIStoryboard(name: &quot;Main&quot;, bundle: nil).instantiateViewController(withIdentifier: &quot;IconPickerVC&quot;) as? IconPickerVC<br>{<br>present(iconVC, animated: true, completion: {<br>iconVC.delegate = self<br>})<br>}</p><p>IconPickerVC is the second VC with the identity added in the Main.Storyboard as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/190/0*93rYG0EIxaglUg3P.png" /></figure><p>You need to use Push when you’re using NavigationController. If you do not use NavigationController, simply use the Present way.</p><p>If you need to know how I set the image from the Second VC to the UITableViewCell of the First VC, check my post <a href="https://inthetechpit.wordpress.com/2018/10/14/return-selected-image-to-previous-viewcontroller/">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f86d2ed8f5c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Return selected image to Previous ViewController]]></title>
            <link>https://medium.com/@pulkitgulati/return-selected-image-to-previous-viewcontroller-db850cead857?source=rss-a69365c7ee16------2</link>
            <guid isPermaLink="false">https://medium.com/p/db850cead857</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[apple]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Pulkit Gulati]]></dc:creator>
            <pubDate>Sat, 13 Oct 2018 20:40:15 GMT</pubDate>
            <atom:updated>2018-10-13T20:40:15.530Z</atom:updated>
            <content:encoded><![CDATA[<p>A very common scenario in an iOS App is to open another ViewController from one ViewController and return the value of the selected row to the previous ViewController and set the image e.g. setting an icon on the First ViewController.</p><p>You can perform the following steps to achieve this scenario:</p><p><strong>1.</strong> Add a delegatevariable on your second view controller. Please name it delegateand not Delegate as per naming convention.</p><p>weak var delegate: FirstVC?</p><p><strong>2.</strong> Add functions to the First ViewController or create a protocol that the FirstVC will adhere to and that you want your second view controller delegate variable to perform.</p><p>extension FirstVC {<br>func selectedImage(_ imageName : UIImage) {<br>iconName = imgName<br>//Implement the logic to set image.<br>}<br>}</p><p><strong>3.</strong> While pushing second view from first view controller, set your first view controller as delegate of second view controller. Something like this:</p><p>override func prepare(for segue: UIStoryboardSegue, sender: Any?) {<br>if segue.identifier == &quot;chooseicon&quot; {<br>if let iconVC = segue.destination as? SecondVC {<br>iconVC.delegate = self<br>}<br>}<br>}</p><p><strong>4.</strong> In your second view controller once image is selected call delegate of second view controller. e.g. use didSelectRowAt of UITableViewController as shown below:</p><p>let icons = [ &quot;img1&quot;, &quot;img2&quot;, &quot;img3&quot;]</p><p>override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {<br>self.delegate?.setSelectedImage(icons[indexPath.row])<br>self.dismiss(animated: true, completion: nil)<br>}</p><p><strong>5.</strong> Implement logic for selectedImagein your first view controller and use the passed image as per Step 2.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db850cead857" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create build definition with TFS 2015 or newer]]></title>
            <link>https://medium.com/@pulkitgulati/create-build-definition-with-tfs-2015-or-newer-3a47ef94177c?source=rss-a69365c7ee16------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a47ef94177c</guid>
            <category><![CDATA[tf]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[build]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Pulkit Gulati]]></dc:creator>
            <pubDate>Sat, 13 Oct 2018 18:53:47 GMT</pubDate>
            <atom:updated>2019-07-08T08:11:32.814Z</atom:updated>
            <content:encoded><![CDATA[<p>Read more at <a href="https://inthetechpit.com/">https://inthetechpit.com</a></p><h4>What is build definition?</h4><p>A build definition is a representation of the automation process that you want to run to build and test your application. The automation process is defined as a collection of tasks. VSTS and TFS have a number of tasks to build and test your application. A build definition describes the details of what your build is supposed to do, and when it’s supposed to do it.</p><p>Build and Release are two of the DevOps services in VSTS and TFS that help you manage continuous integration and delivery of your applications.</p><p>Read full article at:</p><p><a href="https://inthetechpit.com/2018/10/03/create-build-definition-with-tfs-2015-or-newer/">Create build definition with TFS 2015 or newer</a></p><p>All suggestions are welcome and your kind support!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a47ef94177c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Release Management with TFS]]></title>
            <link>https://medium.com/@pulkitgulati/release-management-with-tfs-d0a11cc8e6cb?source=rss-a69365c7ee16------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0a11cc8e6cb</guid>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aml]]></category>
            <category><![CDATA[release-management]]></category>
            <dc:creator><![CDATA[Pulkit Gulati]]></dc:creator>
            <pubDate>Wed, 10 Oct 2018 18:43:53 GMT</pubDate>
            <atom:updated>2018-10-10T18:43:53.549Z</atom:updated>
            <content:encoded><![CDATA[<p>Release Management is a service in VSTS Azure pipelines and TFS on-premise and an essential element of DevOps that helps you continuously deliver software. We can fully automate the testing and delivery of your software in multiple environments all the way to production, or set up semi-automated processes with approvals and on-demand deployments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*o6la1YOrwckYYhcA.jpg" /><figcaption>Microsoft (docs.microsoft.com)</figcaption></figure><p>Release definition defines the end-to-end release process for an application to be deployed across various environments.</p><p>You define the release process using <a href="https://docs.microsoft.com/en-us/vsts/build-release/concepts/definitions/release/environments?view=vsts">environments</a>, and restrict deployments into or out of an environment using <a href="https://docs.microsoft.com/en-us/vsts/build-release/concepts/definitions/release/approvals/index?view=vsts">approvals</a>. You define the automation in each environment using <a href="https://docs.microsoft.com/en-us/vsts/build-release/concepts/process/phases?view=vsts">phases</a> and <a href="https://docs.microsoft.com/en-us/vsts/build-release/concepts/process/tasks?view=vsts">tasks</a>. You use <a href="https://docs.microsoft.com/en-us/vsts/build-release/concepts/definitions/release/variables?view=vsts">variables</a> to generalize your automation and <a href="https://docs.microsoft.com/en-us/vsts/build-release/concepts/definitions/release/triggers?view=vsts">triggers</a> to control when the deployments should be kicked off automatically.</p><p>You can create a deployment model on the basis of how you manually deliver the builds using <a href="https://inthetechpit.wordpress.com/2018/10/03/create-build-definition-with-tfs-2015-or-newer/">build definition</a>for different environments.</p><p>The below Release Definition shows different steps using PowerShell scripts that are modeled basis the manual process created for deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-TcdobL18R2t-vLJ.jpg" /></figure><h4>Creating a Release definition</h4><p>Configure your environment:</p><ul><li>Give the environment a meaningful name by clicking into the <strong>Default Environment </strong>name provided and enter one of your own e.g. DEV, QA, PRODUCTION.</li><li>Click on the ellipsis next to the environment name and select <strong>Deployment conditions…</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HeQpzDyQl7XXTjNb.jpg" /></figure><p><strong>Deployment Conditions</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/872/0*9gh4aoqGhG0vy7K7.jpg" /></figure><p>This is where we set up how we want our deployment to be triggered. It is here that we define what triggers the deployment of our release.</p><ul><li><strong>No automated deployment</strong>- deployment of the build artifacts will need to be undertaken manually with no automation</li><li><strong>After release creation</strong>- this will deploy the build artifacts to the specified environment every time a new release is created i.e. <strong>Continuous Delivery</strong>.</li><li><strong>After successful deployment on another environment</strong>- this will deploy the build artefacts to an environment after they have been deployed to another environment e.g. after every successful deployment to the STAGING environment deploy the build artefacts immediately to the QA environment</li></ul><p>Use the first option if you are deploying to a production environment i.e. make the deployments to your production environment a manual exercise. Use the second option if you are deploying to a development testing environment as part of a <strong>Continuous Delivery</strong> pipeline. Use the last option if you want to push your deployments between different testing environments.</p><p><strong>Approvals</strong></p><p>You may setup Approvals before the deployment to a particular environment using the Approvals Tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/0*mgu8hTb4E58S5Cd9.jpg" /></figure><p><strong>Configure a Queue and set demands</strong></p><p>The demands may be System defined like “DotNetFramework” or you can set yourself like selecting <a href="https://inthetechpit.wordpress.com/2018/09/30/configure-tfs-2015-agent/">Agent</a>name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/871/0*E2boW0FeADDaFMYt.jpg" /></figure><p><strong>General Tab</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/0*NIdy1WLLolzXvdsu.jpg" /></figure><p>After configuring your environment, the next step would be to add task(s) which will be invoked when we want to deploy our build artifacts to the specified environment. The deployment task is the action that we want to happen when we invoke a deployment e.g. running a PowerShell script to start/stop App Pool, running database scripts, deploy the build on to a Virtual Machine or Azure instance.</p><p><strong>Create Release</strong></p><p>Create Release and select the build for which you would like to create a release in Dev environment and click on Create as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/0*oBy-8_spXOGojiMi.jpg" /></figure><p>The successful build selected above will trigger the Automated Deployments based on the selections made for each environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0a11cc8e6cb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup Unit Testing with TFS 2015]]></title>
            <link>https://medium.com/@pulkitgulati/setup-unit-testing-with-tfs-2015-e5aa5312a7eb?source=rss-a69365c7ee16------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5aa5312a7eb</guid>
            <category><![CDATA[unit-testing]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[build]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[aml]]></category>
            <dc:creator><![CDATA[Pulkit Gulati]]></dc:creator>
            <pubDate>Tue, 09 Oct 2018 19:24:14 GMT</pubDate>
            <atom:updated>2019-07-08T08:13:54.698Z</atom:updated>
            <content:encoded><![CDATA[<p>Read more at <a href="https://inthetechpit.com/">https://inthetechpit.com</a></p><p>This article is now available at:</p><h4><a href="https://inthetechpit.com/2018/09/29/setup-unit-testing-with-tfs-2015/">https://inthetechpit.com/2018/09/29/setup-unit-testing-with-tfs-2015/</a></h4><p>I welcome any suggestions and your kind support.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5aa5312a7eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configure TFS 2015 Agent]]></title>
            <link>https://medium.com/@pulkitgulati/configure-tfs-2015-agent-816deda445ee?source=rss-a69365c7ee16------2</link>
            <guid isPermaLink="false">https://medium.com/p/816deda445ee</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aml]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[build]]></category>
            <dc:creator><![CDATA[Pulkit Gulati]]></dc:creator>
            <pubDate>Tue, 09 Oct 2018 18:45:13 GMT</pubDate>
            <atom:updated>2018-10-09T18:45:13.525Z</atom:updated>
            <content:encoded><![CDATA[<h4>What is TFS Agent?</h4><p>An Agent is an installable software that runs one build or deployment job at a time. At least one Agent is required to build or deploy your code. More agents are required as people and code grows.</p><p>Agent types:</p><p>There are two types of Agent:</p><ul><li>Microsoft-hosted agents: These are run in Azure pipelines on Microsoft virtual machines which are discarded after one use.</li><li>Self-hosted agents: These can run in Azure pipelines or TFS on-premise.</li></ul><p>Agents can be installed on Windows, Linux or MacOS machines. Linux Docker containers can also be used.</p><p>Agent pools:</p><p>These are used to organise agents based on Project collections and Projects, so that agents don’t have to be managed individually.</p><p>Pre-requisites:</p><ul><li>An OS that supports VS 2013 or higher</li><li>VS 2013 or 2015 (For information on issues faced with VS latest versions. Check this <a href="https://inthetechpit.wordpress.com/2018/09/29/setup-unit-testing-with-tfs-2015/">article</a>)</li><li>PowerShell 3 or higher</li></ul><p>Capabilities:</p><p>This tells us what the agent can do. Capabilities are name-value pairs that are either automatically discovered by the agent software, in which case they are called <strong>system capabilities</strong>, or those that you define, in which case they are called <strong>user capabilities</strong>. While queueing a build these can be set as <strong>demands</strong>in the General tab to identify suitable agents.</p><p>These capabilities are recognised by the registry information which can be found under HKLM on Windows machines.</p><p>Some of the generally required capabilities are:</p><ul><li>msbuild</li><li>visualstudio</li><li>vstest</li><li>Microsoft SDKs</li><li>PowerShell</li></ul><p>Additional software can be installed on an Agent as required by the code to be built e.g. a software that packages your code after build in an MSI and can be invoked by a build task in your build definition through batch file or PowerShell command.</p><p>Additional Tip:</p><p>Restart the Agent service after installing additional software for the capability to show up.</p><h4>Download and configure the Agent:</h4><ol><li>Login as Agent Pool Administrator.</li><li>Navigate to the Agent Pool tab: <a href="http://{your_server}:8080/tfs/_admin/_AgentPool">http://{your_server}:8080/tfs/_admin/_AgentPool</a></li><li>Click on Download Agent. Unzip the package under C:\Agent.</li><li>Run “ConfigureAgent.cmd” as administrator and respond to the prompts.</li><li>Stick to the defaults initially to install the agent in the Default pool if you’re not really familiar with the environment.</li><li>Install the Agent as a service. Make sure the Agent is running under Services.msc with the provided domain credentials. The credentials should have required permissions e.g. on the Drop folder where the code will be Published using the Build definition.</li><li>The C:\Agent\Agent\VsoAgent.exe is found under Services snap-in as VSO Agent.</li></ol><p>If you need to change the credentials later the following command can be used:</p><p>C:\Agent\Agent\VsoAgent.exe /ChangeWindowsServiceAccount</p><p>The TFS on-premise agent cannot be upgraded unless the TFS version is upgraded. The Agent version which is used which is shipped along with TFS.</p><p>The list of configured Agents can be found under:</p><p><a href="http://{your_server}:8080/tfs/_admin/_AgentPool">http://{your_server}:8080/tfs/_admin/_AgentPool</a></p><h4>Unconfigure Agent:</h4><p>Start cmd as Administrator.</p><p>Go to the Agent folder C:\Agent\Agent and Run the command -</p><p><em>.\agent\vsoagent.exe /unconfigure</em></p><p>Comments are welcome for improvements!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=816deda445ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Change Password for TFS Build Service Account]]></title>
            <link>https://medium.com/@pulkitgulati/change-password-for-tfs-build-service-account-d2c831209b92?source=rss-a69365c7ee16------2</link>
            <guid isPermaLink="false">https://medium.com/p/d2c831209b92</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[team-foundation-server]]></category>
            <category><![CDATA[aml]]></category>
            <category><![CDATA[tf]]></category>
            <dc:creator><![CDATA[Pulkit Gulati]]></dc:creator>
            <pubDate>Tue, 09 Oct 2018 10:24:24 GMT</pubDate>
            <atom:updated>2018-10-09T10:24:24.960Z</atom:updated>
            <content:encoded><![CDATA[<p>The TFS Agent for 2015 or 2017 versions is a Windows Server machine that hosts the Service that allows to run Build and Release definitions for your code as part of the DevOps Process. It can run as a Windows Service and can be found by the name <strong>VSO Agent </strong>in the Services Snap-in. It uses a domain account to run the Windows Service which can be seen under the LogOn properties of the Service.</p><p>It runs VSOAgent.exe behind the scenes which is kept in the Agent folder configured for that TFS Agent e.g.</p><p><strong>C:\TFSAgent\agent\Agent\VSOAgent.exe</strong></p><p>If at any point you require to change the Windows Service account details that was configured earlier due to may be a password change, the following command may help you.</p><p>Please note that Password should not be changed from the Services Snap-in as it may cause the Agent Service to break.</p><ol><li>Open Command Prompt in Administrator mode.</li><li>CD to the directory e.g. as mentioned above <strong>C:\TFSAgent\agent\ . </strong>Make sure you’re one level above the folder where the VSOAgent.exe is placed else it’ll give error.</li><li>Run the following command: <strong>.\Agent\VSOAgent.exe /ChangePassword</strong></li><li>Fill in the new Credentials as Prompted.</li><li>Restart the Service VSO Agent from the Services Snap-in.</li></ol><p>The Agent should now be running with the new Service account.</p><p>For more related articles on Dev problems and DevOps, please visit: <a href="https://inthetechpit.wordpress.com/">https://inthetechpit.wordpress.com</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d2c831209b92" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>