<?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 Ekaterina Akchurina on Medium]]></title>
        <description><![CDATA[Stories by Ekaterina Akchurina on Medium]]></description>
        <link>https://medium.com/@akchurina.ekaterina?source=rss-2b231a78b097------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*QxA82t8A97M0UtmFBIhpmA.jpeg</url>
            <title>Stories by Ekaterina Akchurina on Medium</title>
            <link>https://medium.com/@akchurina.ekaterina?source=rss-2b231a78b097------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 20:20:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@akchurina.ekaterina/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[My ADA journey 2019/2020]]></title>
            <link>https://medium.com/@akchurina.ekaterina/my-ada-journey-2019-2020-85bc7cf30066?source=rss-2b231a78b097------2</link>
            <guid isPermaLink="false">https://medium.com/p/85bc7cf30066</guid>
            <category><![CDATA[apple-academy]]></category>
            <category><![CDATA[lockdown]]></category>
            <category><![CDATA[naples]]></category>
            <category><![CDATA[studying-abroad]]></category>
            <dc:creator><![CDATA[Ekaterina Akchurina]]></dc:creator>
            <pubDate>Thu, 27 Aug 2020 15:45:05 GMT</pubDate>
            <atom:updated>2020-08-27T15:45:05.236Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“Wherever you go, you take yourself with you. If you see what I mean.”</blockquote><blockquote>— Neil Gaiman, The Graveyard Book</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7eTApoV3fEuJepR4GdjGDA.jpeg" /></figure><p>This school year I will surely remember for the rest of my life. Can’t name it perfect though, but so much filled with events, emotions and memories already that it can’t be easily forgotten.</p><p>Everything started last June, by accidentally reading an article from previous year student of the Academy. At that moment, it seemed almost impossible — to quit a good job, leave family, friends and country for some time and try. But a little bit of courage and tons of support helped to make a first step ahead.</p><p>If you want to study traditionally — to get usual lessons, get the knowledge just explained to you, don’t go to the academy. It is more a place of self-study. We are provided with all needed equipment, accounts, and a lot of place with comfortable environment, fast internet and amazing atmosphere.</p><p>The basic challenge of studying is to dive into the whole app development process, see all the aspects, work intensively with fellow students from different countries and backgrounds, get answers and advice from mentors.</p><p>Academy teaches you a lot how to work in teams. That you being a brilliant specialist can be not enough and vice versa: synergy of common work actually exists. And by changing the team you learn to interact with different types of people (possibility you often lack in real job environment).</p><p>We had great experience not only in working on projects, but also interacting with each other, having some nice adventures together in the spare time. At some point I found myself in Rome in an absolutely international company (12 people from 9 different countries from all over the world!).</p><p>Sounds amazing, doesn’t it? It was so until end of February, when life in Italy changed dramatically.</p><p>Since then we are working remotely. Of course, it is also part of experience: learn how to make projects even when you can’t meet your teammates. Grow a discipline to make yourself study and work when you can’t even go anywhere except for the groceries. When you are stuck also in a foreign country far from your family, the challenge becomes even bigger and harder.</p><p>Everything ends. And on Monday we graduate (remotely, unfortunately) and start trying to go home. It was a long year, sometimes funny and amazing, sometimes hard and devastating. But it will stay in my heart, with all the beautiful people I met here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VEnN8qqzVcGYWSNJZ8kMwg.png" /></figure><p>Thank you, Apple, for this opportunity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85bc7cf30066" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multipeer Сonnectivity Framework in Swift: tutorial]]></title>
            <link>https://medium.com/apple-developer-academy-federico-ii/multipeer-%D1%81onnectivity-framework-in-swift-tutorial-c4af4b71034c?source=rss-2b231a78b097------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4af4b71034c</guid>
            <category><![CDATA[multipeerconnectivity]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[tutorial]]></category>
            <dc:creator><![CDATA[Ekaterina Akchurina]]></dc:creator>
            <pubDate>Thu, 09 Apr 2020 14:23:18 GMT</pubDate>
            <atom:updated>2020-04-09T14:23:18.014Z</atom:updated>
            <content:encoded><![CDATA[<p>This article is about Multipeer connectivity, Swift Framework developed by Apple. Basically it is a way to connect two or more devices nearby directly one to another, through Bluetooth or Wi-Fi (including Wi-Fi Direct). You can use this framework for building simple games or a chat, for example, so that you can be connected to people around you even when the centralised network is off.</p><p>We will try to present you a simple way to implement basic multipeer connectivity in your project and tell what problems we met while working with it. First of all, do not think of it as about something very complicated for developer; like many other Apple’s native frameworks, it works “out of the box”.</p><p><strong>Let’s start.</strong></p><p><em>If you don’t want to go through the whole tutorial, just read working code, go to gitlab project and download it — </em><a href="https://gitlab.com/kolotilinma/tictactoe.git"><em>https://gitlab.com/kolotilinma/tictactoe.git</em></a><em>.</em></p><p>First, you need to <strong>import MultipeerConnectivity; </strong>then make your <strong>ViewController</strong> class to adapt protocols, and declare some variables:</p><pre><strong>import</strong> MultipeerConnectivity</pre><pre><strong>class</strong> <strong>ViewController</strong>: UITableViewController, <strong>MCSessionDelegate</strong>, <strong>MCBrowserViewControllerDelegate</strong> {</pre><pre><strong>  var</strong> peerID: MCPeerID!<br>  <strong>var</strong> mcSession: MCSession!<br>  <strong>var</strong> mcAdvertiserAssistant: MCAdvertiserAssistant!</pre><pre>  ... <br>}</pre><p><strong>MCSession</strong> is the manager class that handles all multipeer connectivity for us. <strong>MCPeerID</strong> uniquely identifies a user within a session. <strong>MCAdvertiserAssistant</strong> is used for creating a session, telling others that we exist and handling invitations. <strong>MCBrowserViewController</strong> is used when looking for sessions, showing users who is nearby and letting them join.</p><p>Inside viewDidLoad method we assign the following values:</p><pre>override func viewDidLoad() {<br>  ...<br>  peerID = <strong>MCPeerID</strong>(displayName: UIDevice.current.name)<br>  mcSession = <strong>MCSession</strong>(peer: peerID, securityIdentity: nil,    encryptionPreference: .required)<br>  mcSession.delegate = self<strong><br></strong>}</pre><p>Now our device has an Id taken from Settings; and an instance of <strong>MCSession</strong> class is created to be able to use multipeer connectivity.</p><p>Adopted protocols require some methods — you can either insert them automatically or copy from the following:</p><pre><strong>func</strong> session(<strong>_</strong> session: MCSession, peer peerID: MCPeerID, didChange state: MCSessionState) {}</pre><pre><strong>func</strong> session(<strong>_</strong> session: MCSession, didReceive data: Data, fromPeer peerID: MCPeerID) {}</pre><pre><strong>func</strong> session(<strong>_</strong> session: MCSession, didReceive stream: InputStream, withName streamName: String, fromPeer peerID: MCPeerID) {}</pre><pre><strong>func</strong> session(<strong>_</strong> session: MCSession, didStartReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, with progress: Progress) {}</pre><pre><strong>func</strong> session(<strong>_</strong> session: MCSession, didFinishReceivingResourceWithName resourceName: String, fromPeer peerID: MCPeerID, at localURL: URL?, withError error: Error?) {}</pre><pre><strong>func</strong> browserViewControllerDidFinish(<strong>_</strong> browserViewController: MCBrowserViewController) {}</pre><pre><strong>func</strong> browserViewControllerWasCancelled(<strong>_</strong> browserViewController: MCBrowserViewController) {}</pre><p>For now, you can leave most of this methods empty. Just follow the tutorial further.</p><p><strong>MCSessionState</strong> allows you to see if the connection status has changed. It has several properties that you can check. The most common way would be to use switch statement</p><pre><strong>func</strong> session(<strong>_</strong> session: MCSession, peer peerID: MCPeerID, didChange state: MCSessionState) {<br>  <strong>switch</strong> state {<br>    <strong>case</strong> .connected: print (&quot;connected \(peerID)&quot;)<br>    <strong>case</strong> .connecting: print (&quot;connecting \(peerID)&quot;)<br>    <strong>case</strong> .notConnected: print (&quot;not connected \(peerID)&quot;)<br>    <strong>default</strong>: print(&quot;unknown status for \(peerID)&quot;)<br>  }<br>}</pre><p>For the <strong>MCBrowserViewController</strong> methods we need to add some code:</p><pre><strong>func</strong> browserViewControllerDidFinish(<strong>_</strong> browserViewController: MCBrowserViewController) {dismiss(animated: <strong>true)</strong>}</pre><pre><strong>func</strong> browserViewControllerWasCancelled(<strong>_</strong> browserViewController: MCBrowserViewController) {dismiss(animated: <strong>true)</strong>}</pre><p>Now, after implementing needed methods, we need to initiate the process of connectivity. In this tutorial we suppose you use buttons and alert controllers.</p><p><strong>Initiating the process</strong></p><p>The system works like this: one device starts hosting a session and becomes visible for others by its name. Another device can join the session, find the first one in the list and ask for confirmation from the host.</p><p>To start, we put a simple alert controller asking if we want to host or join a session. For example, you use a button, connect it to ViewController and create an UIAlertController for it:</p><pre>@IBAction func buttonPressed(_ sender: UIButton) {</pre><pre><strong>  let</strong> ac = UIAlertController(title: “Connect to others”, message: <strong>nil</strong>, preferredStyle: .alert)</pre><pre>  ac.addAction(UIAlertAction(title: “Host a session”, style: .default) {//here we will add a closure to host a session<br>})</pre><pre>  ac.addAction(UIAlertAction(title: “Join a session”, style: .default) {//here we will add a closure to join a session<br>})</pre><pre>  ac.addAction(UIAlertAction(title: “Cancel”, style: .cancel))</pre><pre>  present(ac, animated: <strong>true</strong>)</pre><pre>}</pre><p>Alert action to host a session may use following closure to start advertising itself as a host: here we create a advertiser assistant, that starts telling ios devices aroung about working session.</p><pre>{ (UIAlertAction) <strong>in <br> self</strong>.mcAdvertiserAssistant = <strong>MCAdvertiserAssistant</strong>(serviceType:  &quot;todo&quot;, discoveryInfo: <strong>nil</strong>, session: <strong>self</strong>.mcSession)<br> <strong>self</strong>.mcAdvertiserAssistant.start()<br>}</pre><p>Pay attention: serviceType parameter should be a <em>short</em> text string that describes the app’s networking protocol. According to Apple, it should be:</p><ul><li>Must be 1–15 characters long</li><li>Can contain only ASCII lowercase letters, numbers, and hyphens</li><li>Must contain at least one ASCII letter</li><li>Must not begin or end with a hyphen</li><li>Must not contain hyphens adjacent to other hyphens.</li></ul><p>This name should be easily distinguished from unrelated services. For example, a text chat app made by ABC company could use the service type abc-textchat.¹</p><p>While joining a session closure may look like this: we show a browser with a list of possible connections and make our view controller delegate to this object.</p><pre>{ (UIAlertAction) <strong>in<br> let</strong> mcBrowser = <strong>MCBrowserViewController</strong>(serviceType: “todo”, session: <strong>self</strong>.mcSession)<br> mcBrowser.delegate = <strong>self<br> self</strong>.present(mcBrowser, animated: <strong>true</strong>, completion: <strong>nil</strong>)<br>}</pre><p>Now you can try and start your app on two devices simultaneously (or on a simulator and a physical device).</p><p>You have followed the tutorial, but still can’t get alert to join a session from another device? Well, that is a common problem that appeared in XCode 11.2 and iOS 13 and still exists. We don’t know if Apple find the framework obsolete or will fix it later.</p><p>One of the solutions can be — downgrade from using <strong>SceneDelegate</strong> and <strong>AppDelegate</strong> to only one class: <strong>AppDelegate</strong> and leave using UIScene for future apps, not this one.</p><ul><li>first, completely remove the “Application Scene Manifest” entry from Info.plist;</li><li>remove the SceneDelegate class, and remove all scene related methods in your AppDelegate;</li><li>if missing, add the property var window: UIWindow? to your AppDelegate class.</li></ul><p>Your app should now only use the app delegate and under iOS 13 it will have the same life cycle as iOS 12. And Multipeer connectivity should work as it is originally designed.</p><p><strong>Sending and receiving information</strong></p><p>The only thing left — is how to send information itself from one device to another? For that we use the following method. You need to determine what data you need to share and when: after pressing some button or just after establishing the connection. In the required place add following code:</p><pre><strong>if</strong> mcSession.connectedPeers.count &gt; 0 {<br>  if let safeData =  // you data that needs to be sent<strong> <br> {do </strong>{<br>    <strong>try</strong> mcsession.send(safeData, toPeers: mcsession.connectedPeers, with: .reliable) <br>     }<strong> catch let </strong>error <strong>as </strong>NSError {<br>print(&quot;\(error.localizedDescription)&quot;)<br>    } <br>  <strong>}<br></strong>}</pre><p>Your data should be formatted to the type Data(). For images, for example, easy way to do it would be to use the .pngData() method.</p><p>Last thing that we need to do — give the receiving device understand what to do with received data and what to do next. In this situation it depends on what data you tried to transfer. In anyway, use following method (it is one of the methods added while adapting protocols):</p><pre><strong>func</strong> session(<strong>_</strong> session: MCSession, didReceive data: Data, fromPeer peerID: MCPeerID) { ... }</pre><p>Remember, that you receive the object of type Data(). And you may need to decode it back to needed type. Then update the UI. Don’t forget to execute it on the main thread. The example follows (also from the protocol methods):</p><pre><strong>func</strong> session(<strong>_</strong> session: MCSession, didReceive data: Data, fromPeer peerID: MCPeerID) {<br>  <strong>if</strong> <strong>let</strong> image = UIImage(data: data) {<br>    DispatchQueue.main.async { <br>      <strong>self</strong>.images.insert(image, at: 0)<br>      <strong>self</strong>.collectionView.reloadData()<br>      }<br>   }<br>}</pre><p>Hope you enjoyed reading our article and found it useful!</p><p>For any questions please get in touch or write a comment.</p><p>This article is collaborative work of Conjunctivity team from Apple Developer Academy in Naples, including:</p><ul><li><a href="https://medium.com/@julia.lisicina92">Julia Lisicina - Medium</a></li><li><a href="https://medium.com/@kolotilinma">Михаил Колотилин - Medium</a></li></ul><p>[1] Apple Developer Documentation <a href="https://developer.apple.com/documentation/multipeerconnectivity/mcadvertiserassistant/1406990-init">https://developer.apple.com/documentation/multipeerconnectivity/mcadvertiserassistant/1406990-init</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4af4b71034c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/apple-developer-academy-federico-ii/multipeer-%D1%81onnectivity-framework-in-swift-tutorial-c4af4b71034c">Multipeer Сonnectivity Framework in Swift: tutorial</a> was originally published in <a href="https://medium.com/apple-developer-academy-federico-ii">Apple Developer Academy | Federico II</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>