<?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 Medet Dönmez on Medium]]></title>
        <description><![CDATA[Stories by Medet Dönmez on Medium]]></description>
        <link>https://medium.com/@medetdonmez97?source=rss-cd6e9539b896------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7vYO5gVyw9Vwnp1iOmtkpQ.jpeg</url>
            <title>Stories by Medet Dönmez on Medium</title>
            <link>https://medium.com/@medetdonmez97?source=rss-cd6e9539b896------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 03:33:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@medetdonmez97/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[Socket Programming in iOS: A Step-by-Step Guide with SignalR]]></title>
            <link>https://medium.com/@medetdonmez97/socket-programming-in-ios-a-step-by-step-guide-with-signalr-26202c1d8821?source=rss-cd6e9539b896------2</link>
            <guid isPermaLink="false">https://medium.com/p/26202c1d8821</guid>
            <category><![CDATA[sockets]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios-development]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <dc:creator><![CDATA[Medet Dönmez]]></dc:creator>
            <pubDate>Sun, 12 Nov 2023 11:45:38 GMT</pubDate>
            <atom:updated>2023-11-12T11:45:38.722Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-tgWT1XG33GSVIMh" /></figure><p>Welcome to the world of socket programming in iOS with SignalR. In this article, we’ll explore how to seamlessly integrate real-time data communication into your iOS applications. Whether you’re new to iOS development or an experienced programmer, this step-by-step guide will provide you with the tools and insights needed to enhance your apps with efficient, real-time functionality using SignalR. Let’s get started on this journey to elevate your iOS development skills.</p><h4>Step 1: Integrating SignalR-Client-Swift into Your Project</h4><p>To begin, the first crucial step is integrating the SignalR-Client-Swift library into your iOS project. This library, available on GitHub, provides the necessary tools to establish and manage socket connections in Swift. Here’s how to add it to your project:</p><ol><li><strong>Visit the GitHub Repository</strong>: Navigate to <a href="https://github.com/moozzyk/SignalR-Client-Swift"><strong>SignalR-Client-Swift on GitHub</strong></a> to access the latest version of the library.</li><li><strong>Clone or Download:</strong> You can either clone the repository to your local machine or download the source code directly from GitHub.Integrate into Your Project:</li></ol><ul><li>If you prefer Swift Package Manager, you can add the package dependency via Xcode by selecting File &gt; Swift Packages &gt; Add Package Dependency and entering the repository URL.</li><li>If using CocoaPods, add pod &#39;SignalR-Client-Swift&#39; to your Podfile and run pod install.</li></ul><p>By completing this step, you’ll have successfully integrated the SignalR client library into your iOS project, setting the stage for real-time communication capabilities.</p><h4>Step 2: Setting Up the HubConnection with Custom Socket URL</h4><p>Once you have the SignalR-Client-Swift library integrated, the next crucial step involves setting up the HubConnection in your Swift class. This connection is key to establishing communication with your server. Here&#39;s how to properly configure it:</p><ol><li><strong>Import the Library</strong>: Start by adding the SignalR-Client-Swift library to your class.</li></ol><pre>import SignalRClient</pre><p>2. <strong>Declare the HubConnection Variable</strong>: Introduce a variable to hold your HubConnection.</p><pre>var chatHubConnection: HubConnection?</pre><p><strong>3. Configure the HubConnection: </strong>Now, initialize and set up the chatHubConnection. The livechatURL should be replaced with the URL of the socket you intend to connect to. Customize the settings based on your specific requirements:</p><pre>if let livechatURL = URL(string: &quot;Your Socket URL here&quot;) {<br>    self.chatHubConnection = HubConnectionBuilder(url: livechatURL)<br>        .withLogging(minLogLevel: .debug)<br>        .withPermittedTransportTypes(.webSockets)<br>        .withJSONHubProtocol()<br>        .withHttpConnectionOptions(configureHttpOptions: { httpConnectionOptions in<br>            if #available(iOS 13.0, *) {<br>                httpConnectionOptions.skipNegotiation = true<br>            } else {<br>                // Fallback on earlier versions<br>            }<br>        })<br>        .build()<br>}</pre><p>Note: Replace &quot;Your Socket URL here&quot; with the actual URL of the socket you&#39;re connecting to. This setup allows you to tailor the logging level, transport types, and other connection options according to your needs. The skipNegotiation is an important setting for optimizing connections on iOS 13 and later.</p><p>By following these steps, you’ll have a HubConnection configured in your class, ready to handle real-time communication in your iOS app, connected to your specified socket server.</p><h4>Step 3: Initiating Connection and Handling Communication</h4><p>After setting up your HubConnection, the next steps involve initiating the connection and handling the communication flow. This involves starting the connection, invoking methods on the server, and handling incoming messages.</p><ol><li>S<strong>tart the Connection: </strong>Begin by starting the connection with the server.</li></ol><pre>self.chatHubConnection?.start()</pre><p>2.<strong> Invoke Methods on the Server</strong>: To interact with the server, you use the invoke method. This can vary based on your server&#39;s implementation. For example:</p><pre>self.chatHubConnection?.invoke(method: &quot;StartConversation&quot;, &quot;Your_token&quot;, &quot;start&quot;, invocationDidComplete: { error in<br>    if let error = error {<br>        print(&quot;\(error)&quot;)<br>    }<br>})</pre><p><strong>Remember,</strong> the method name (“StartConversation” in this case) and its parameters are specific to your server’s implementation and should be adjusted accordingly.</p><p><strong>3. Handling Incoming Messages: </strong>Listening and responding to messages from the server is crucial. Here’s an example of handling a “ReceiveMessage” event:</p><pre>self.chatHubConnection?.on(method: &quot;ReceiveMessage&quot;, callback: {(_: String, message: String) in<br>    // Handle the received message<br>    // Example: Decoding the message and updating the UI<br>})</pre><p><strong>Remember</strong>, the method name (“ReceiveMessage” in this case) and its parameters are specific to your server’s implementation and should be adjusted accordingly.</p><p>In this example, messages are decoded and then used to update the UI. The exact handling will depend on the structure of your data and the requirements of your application.</p><p>By following these steps, you establish a robust flow of communication between your iOS app and the server. This includes initiating the connection, sending commands or requests to the server, and handling the responses or messages you receive, all tailored to the specific protocols and data formats of your server.</p><h4>Step 4: Properly Closing the Connection</h4><p>The final step in managing your socket connection with SignalR in iOS involves properly closing the connection. This is a critical aspect to ensure resource efficiency and maintain the integrity of the communication channel. Here’s how to gracefully handle this:</p><ol><li><strong>Stopping the HubConnection:</strong>To terminate the connection, use the stop method:</li></ol><pre>self.chatHubConnection?.stop()</pre><p>This method ensures that the socket connection is closed cleanly, preventing any potential resource leaks or other issues related to improper disconnection.</p><p><strong>Notifying the Server of Disconnection (Optional): </strong>Depending on your server setup, you might need to inform the server explicitly that the client is disconnecting. This is typically done by invoking a specific method. For example:</p><pre>self.chatHubConnection?.invoke(method: &quot;EndOfChat&quot;, &quot;endOfChat&quot; invocationDidComplete: { error in<br>    if let error = error {<br>        print(&quot;\(error)&quot;)<br>    }<br>})</pre><p><strong>Note: </strong>The method name and parameters (“EndOfChat” and its arguments in this case) are examples and should be replaced with those relevant to your server’s API. Not all implementations will require this step, but it can be crucial for some server configurations to manage client connections effectively.</p><p>By following these steps, you ensure that your iOS app’s socket connection is terminated properly and cleanly. This not only maintains good server-client communication practices but also optimizes resource utilization in your application.</p><p>In summary, we’ve explored the essentials of using SignalR with Swift for socket programming in iOS. This guide covered everything from integrating the library and establishing connections to handling messages and closing connections. Keep in mind, the techniques discussed here can be tailored to fit the specific needs of your iOS applications. As you apply these concepts, you’ll unlock new possibilities in creating interactive and real-time features for your users.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26202c1d8821" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Submit Your App to the App Store]]></title>
            <link>https://medium.com/@medetdonmez97/how-to-submit-your-app-to-the-app-store-af6a52f125d9?source=rss-cd6e9539b896------2</link>
            <guid isPermaLink="false">https://medium.com/p/af6a52f125d9</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[xcode]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[app-store]]></category>
            <dc:creator><![CDATA[Medet Dönmez]]></dc:creator>
            <pubDate>Sun, 01 Jan 2023 10:02:51 GMT</pubDate>
            <atom:updated>2023-01-01T10:02:51.265Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*YbKD7tbIa_SZPRlY.png" /></figure><p>Hello beautiful people, in this article I am going to mention how to submit your app to App Store. To do this, there are several prerequisites. These are:</p><ul><li><strong>Apple Developer Account: </strong>To submit your app to App Store, first you have to subscribe to Apple Developer Program. Easiest way to this downloading A<a href="https://apps.apple.com/us/app/apple-developer/id640199958">pple Developer</a> app and purchase annually subscription.</li><li><strong>Your code on Xcode</strong></li></ul><p>Once you have these, we can start working on submitting our app to the App Store.</p><h4><strong>1- Logging into App Store Connect</strong></h4><p>Firstly go to the website <a href="https://appstoreconnect.apple.com/">App Store Connect</a> and login with your developer account. Click My Apps.</p><figure><img alt="Click on My Apps" src="https://cdn-images-1.medium.com/max/977/1*eoBLXsl4oOF3C8fsekIYuw.png" /></figure><p>Adding new app:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/226/1*gFNNuj5Vl73cBe0DOcTSdA.png" /></figure><p>Fill the areas platforms, name and languages as you wish.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/584/1*IxAnoYyGtCHVtDtng2E96Q.png" /></figure><ul><li><strong>Bundle ID: </strong>You can find your bundle ID on Xcode under the Signing &amp; Capabilities part of your app.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*uyC1-irW-S8eKJ6ECl955w.png" /></figure><ul><li><strong>SKU (Stock Keeping Unit): </strong>It<strong> </strong>is a numbering system used to identify and track products in inventory. A SKU is a unique number that describes a product’s characteristics, design, and other special details, and it can be changed if a product’s characteristics change. In example, if your app is about social media, you can basically write “SOCIAL_NETWORK_APP”.</li></ul><p>After filling these areas lets hit <strong>Create</strong>.</p><h4>2-Adding Screenshots</h4><p>Open Xcode, run your projects on desired devices, and take screenshots. Then upload it like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yWSMnXOGiSMCxj-U43eJPw.png" /></figure><p>Fill the other areas as you wish. An example at below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r8f_e_qdTz1c7OLoeDQhXw.png" /></figure><h4>3-Adding Build</h4><p>Adding build part is where we upload our app code to App Store Connect. To add build there are few steps that we have to do on Xcode.</p><p>First analyze your app by simply click <strong>Product -&gt; Analyze.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*S9fhwdgDDVJCyVmlyMUXYg.png" /></figure><p>Then build your app by choosing <strong>“Any Ios Device” </strong>as device.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/245/1*wUM2JJ4YQvXnWg6WwqcuSA.png" /></figure><p>After successful build, click <strong>Product -&gt; Archive.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/261/1*srzgM_ZH8cfaHY25LKARrQ.png" /></figure><p>Choose your build, firstly click <strong>Validate App</strong> then <strong>Distribute App</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*ljuJXo15utQ70ytpci91fg.png" /></figure><p>After successful upload, go back to <strong>App Store Connect</strong> and click plus button next to <strong>Build </strong>and select the one we have just uploaded.</p><blockquote>Before living this section do not forgot to <strong>press Save</strong> at top right of page.</blockquote><h4>4-App Privacy and Other Stuff</h4><p>Since we saved our app information, let’s jump on <strong>App Privacy, </strong>select it at right of the page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zq1BH1HFgpE0Apch2UiHYw.png" /></figure><p>Fill these blanks as you wish, if you are new as developer, you can simply fill the <strong>Privacy Policy URL part </strong>with google drive link that have your privacy policy.</p><p>After filling this page click <strong>Publish </strong>at<strong> </strong>top right of the page.</p><p>Until here we have completed all the parts that mandatory to publish our app. You can manage the other parts as you wish , like if your apps includes In-App purchases or subscriptions.</p><p>At the end you can click <strong>App Information</strong> at left and hit <strong>Add for Review</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UYMB0eaTvUmBoWWQb4cGOg.png" /></figure><p>Happy end! Now we send it our app for review!! After review by Apple, our app will be published at app store!</p><p>Thanks for reading!</p><p>Contact me via: <a href="https://www.linkedin.com/in/medetdonmez/">https://www.linkedin.com/in/medetdonmez/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=af6a52f125d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a CocoaPods Library to Share Code]]></title>
            <link>https://medium.com/@medetdonmez97/creating-a-cocoapods-library-to-share-code-19d752db95c2?source=rss-cd6e9539b896------2</link>
            <guid isPermaLink="false">https://medium.com/p/19d752db95c2</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[cocoapods]]></category>
            <category><![CDATA[xcode]]></category>
            <dc:creator><![CDATA[Medet Dönmez]]></dc:creator>
            <pubDate>Thu, 08 Dec 2022 08:23:31 GMT</pubDate>
            <atom:updated>2022-12-08T08:23:31.040Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e2mhS2RfyIU_h8M9Gliy4w.jpeg" /></figure><p>Hello beautiful people, in this article I am going to show you how to create your own cocoapod file to share or reuse your code. To do this, you need to follow 5 easy steps. Let’s get started!</p><p><strong>1- INSTALLING COCOAPODS TO YOUR COMPUTER</strong></p><p>To install CocoaPods, you need to open your terminal then write <em>‘sudo gem install cocoapods’</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SeDGglYaH90f7DG3OEHbwQ.png" /></figure><p>After installation, you will see success message just like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tYdrdwtUMb9YvGk3djQ1vA.png" /></figure><p>Since we successfully downloaded CocoaPods to our computer we can move on the next step!</p><p><strong>2-CREATING POD FILE</strong></p><p>To create the pod file, simply right click the folder you want to include your pod, then click ‘<em>New Terminal at Folder’.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*8rPYg4Vuoz8w_qBR0BO0kQ.png" /></figure><p>In the terminal write <em>‘pod lib create your_podname’ </em>then press return<em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/924/1*J5wCPYh7zfnpVNsV-96r3w.png" /></figure><p>After that terminal is going to ask several questions, you can answer these as your desired way. An example at below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kdGujpLfNDHWDk0fe67saQ.png" /></figure><p>When you answered all the questions hit return and wait for process. In several seconds your pod will be created in desired file.</p><p><strong>3-ADDING CLASSES AND OTHER FILES</strong></p><p>To add your classes to your pod, simply drag and copy them to the classes folder inside your custom pod project. You can also create new files in casual way inside the project Pods.xcodeproj.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3L1fKogOntn9bS5VjRf0_w.png" /></figure><p>Files with extensions like <strong><em>png, jpeg, storyboard, xib, xcassets etc.</em></strong> we have to declare them in podspec file. To do this let’s open Pods.xcodeproj. (It is our pod project)</p><p>In project, click podspec file under Podspec Metadata file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/540/1*JTR2ZK1obB0dxpNVhd3_Kg.png" /></figure><p>In this file uncomment the section <strong><em>s.resource_bundles</em></strong> as below. This is the section that we say the pod what we have added with extensions to the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xjU_hXrJbxBh8KDvbBpuHA.png" /></figure><p>Now I want to show some examples here, by adding several files to assets folder. I just simply added <strong><em>PhoneViewController.xib</em></strong> and <strong><em>screenshot.png</em></strong> to Assets folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vkgxvO6DUw6jqKEpYvh4_A.png" /></figure><p>The next step is declaring them inside podspec file as we mentioned before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4zY6dNs2zXsmZUwkKdbQKw.png" /></figure><p>Done! We have added all the files that our pod file would include. Now only little adjustments left. Move to the top of .podspec file and change the ‘s.summary’. Don’t forgot it is mandatory to change this!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*06ryXEfk0dRUTB2vvnBHYg.png" /></figure><p>Then just above s.ios.deployment_target declare our swift version as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*i1kElPbmPLk3Rx_pMkIg3w.png" /></figure><p><strong>4-TESTING</strong></p><p>To test everything is okay with our pod, open terminal like before from our CustomPod folder. Then write ‘<strong><em>pod lib lint’.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rGWPbU9SwtzzpXTmoDCXdQ.png" /></figure><p>This is going to validate our pod. If you followed previous steps wisely, the success message is going to shown like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H6I1QpLNT_aau5cbWAi2Dg.png" /></figure><p>DONE!! We have created our special custom podfile. Lets push our baby to Github in next step.</p><p><strong>5-PUSHING TO GITHUB</strong></p><p>Open your github create a repository named like <a href="https://github.com/MedetDonmez/CustomPod">https://github.com/MedetDonmez/CustomPod</a> then go back to the our pod project. Under source control right click to <strong>Remotes</strong> and press <strong>Add Existing Remote</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*leVHXkl7RKbeI-3fLK3M5g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*qzN1mti6Xa_p7tbai5Vg-Q.png" /></figure><p>After we created our remote, commit and push your project to Github.</p><p>Our readme file on github autocreated and include a part as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zEBy2aW7YGLjWhG3rzeahg.png" /></figure><p>Since our pod name is not unique we must update this part like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S8tFoCTn-uAlXJXZNsRZIw.png" /></figure><p>Happy end! Now our beautiful pod is ready to use!! Thanks for reading!</p><p>Contact me via: <a href="https://www.linkedin.com/in/medetdonmez/">https://www.linkedin.com/in/medetdonmez/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19d752db95c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>