<?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 Mohammed Abdelaty on Medium]]></title>
        <description><![CDATA[Stories by Mohammed Abdelaty on Medium]]></description>
        <link>https://medium.com/@MGamalAty?source=rss-480b03e500f6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*G7pz-AohitB0FjLNzpPViQ.jpeg</url>
            <title>Stories by Mohammed Abdelaty on Medium</title>
            <link>https://medium.com/@MGamalAty?source=rss-480b03e500f6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 12:56:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@MGamalAty/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[iOS framework documentation (DooC) made easy]]></title>
            <link>https://medium.com/@MGamalAty/ios-framework-documentation-dooc-made-easy-e3f46bd50387?source=rss-480b03e500f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3f46bd50387</guid>
            <category><![CDATA[ios-documentation]]></category>
            <category><![CDATA[dooc]]></category>
            <category><![CDATA[ios-framework]]></category>
            <dc:creator><![CDATA[Mohammed Abdelaty]]></dc:creator>
            <pubDate>Mon, 28 Feb 2022 17:25:47 GMT</pubDate>
            <atom:updated>2022-02-28T17:25:47.691Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Don’t panic it’s really easy with small steps</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hu0B_xYRWrKP_vimaLGsBQ.png" /></figure><p>We heard about symbol documentation in your source files.</p><p>The above result can be achieved with a small configuration to your framework when creating it inside your workspace or even with an existing created framework.</p><p>1- When creating a new framework make sure to check Include documentation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7tu5Jbx-o3zq5Mb-kYGFCA.png" /></figure><p>2- Make sure to Build documentation during the build key from the framework build setting:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kf7tC2PIoqmjla3TzixTEw.png" /></figure><p>3- Within any created object inside your framework sources go ahead and write the documentation and comments you are usually writing to help whoever using your framework.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I71OGTApfaM8ovxrXm_Htw.png" /></figure><p>4- Build your framework and run the documentation view by choosing Product -&gt; Build documentation</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*-n--C3KQrlqhhHHG-DKuGg.png" /></figure><p>Then you will see what we have just written in the test framework class:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hu0B_xYRWrKP_vimaLGsBQ.png" /></figure><blockquote>Note: For existing framework projects, the build setting appears only after you add a documentation catalog. You can’t use the build setting with a Swift package.</blockquote><p>Try that yourself and help make your frameworks more readable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3f46bd50387" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RxSwift VS ReactiveSwift (Error Handling)- Part 2]]></title>
            <link>https://medium.com/@MGamalAty/rxswift-vs-reactiveswift-error-handling-part-2-326f37c5790b?source=rss-480b03e500f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/326f37c5790b</guid>
            <category><![CDATA[rxswift]]></category>
            <category><![CDATA[error-handling]]></category>
            <category><![CDATA[reactiveswift]]></category>
            <dc:creator><![CDATA[Mohammed Abdelaty]]></dc:creator>
            <pubDate>Wed, 24 Jun 2020 17:58:31 GMT</pubDate>
            <atom:updated>2020-06-24T17:58:31.305Z</atom:updated>
            <content:encoded><![CDATA[<p>Control what you write, don’t obey any code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-c9yddO3e4v0hKo3" /><figcaption>Photo by <a href="https://unsplash.com/@patrykgradyscom?utm_source=medium&amp;utm_medium=referral">Patryk Grądys</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>We’ve talked about the main part of reactive and Rx in part one which initializes objects and how hot and cold signals work.</p><h4>In this part, we will talk about another important thing which is error handling.</h4><h3><strong>Error Handling :</strong></h3><p>You might have noticed in the section about hot and cold signals that ReactiveCocoa’s Signal&lt;T, E&gt; and SignalProducer&lt;T, E&gt; have two parameterized types, while RxSwift’s Observable&lt;T&gt; has one. The second type (E) refers to a type that complies with the ErrorType protocol. In RxSwift the type is omitted and instead treated internally as a type that complies with ErrorType protocol.</p><p>This means that errors can be emitted in different ways in RxSwift</p><pre>create { observer in<br>  observer.onError(NSError.init(domain: &quot;NetworkServer&quot;, code: 1, userInfo: nil))<br>}</pre><p>there is another alternative for this by using another protocol which conforms to ErrorType protocol.</p><pre>create { observer in<br>  observer.onError(MyDomainSpecificError.NetworkServer)<br>}</pre><pre>enum MyDomanSpecificError: ErrorType {<br>  case NetworkServer<br>  case Parser<br>  case Persistence<br>}<br><br>func handleError(error: MyDomanSpecificError) {<br>  // Show alert with the error<br>}<br><br>observable.subscribeError {[weak self] error in<br>  self?.handleError(error)<br> }</pre><p>But this won’t work as expected because the function handleError is expecting a MyDomainSpecificError instead of an ErrorType.</p><p>You are forced to do two things:</p><ol><li>Try to cast the error into a MyDomanSpecificError.</li><li>Handle the case where the error is not cast-able to a MyDomanSpecificError.</li></ol><p>The first point is easily fixed with an as?, but the second is harder to address. A potential solution is to introduce an Unknown case:</p><pre>enum MyDomanSpecificError: ErrorType {<br>  case NetworkServer<br>  case Parser<br>  case Persistence<br>  case Unknown<br>}<br><br>observable.subscribeError {[weak self] error in<br>  self?.handleError(error as? MyDomanSpecificError ?? .Unknown)<br>}</pre><p>In ReactiveCocoa, since you “fix” the type when you create a Signal&lt;T, E&gt; or a SignalProducer&lt;T, E&gt;, the compiler will complain if you try to send something else. Bottom line: in ReactiveCocoa, the compiler won’t allow you to send a different error than the one you are expecting.</p><h3>Another point for ReactiveCocoa!</h3><p><strong>See you at the next part will talk about UI binding.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=326f37c5790b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RxSwift VS ReactiveSwift (Hot vs. Cold Signals)- Part 1]]></title>
            <link>https://medium.com/@MGamalAty/rxswift-vs-reactiveswift-hot-vs-cold-signals-part-1-ea3ec3c098b?source=rss-480b03e500f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea3ec3c098b</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[rxswift]]></category>
            <category><![CDATA[reactivecocoa]]></category>
            <category><![CDATA[reactiveswift]]></category>
            <dc:creator><![CDATA[Mohammed Abdelaty]]></dc:creator>
            <pubDate>Tue, 23 Jun 2020 13:13:12 GMT</pubDate>
            <atom:updated>2020-06-23T13:13:12.382Z</atom:updated>
            <content:encoded><![CDATA[<p>learn the concept, not the library.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nCmFIZRjkEFUOZP5" /><figcaption>Photo by <a href="https://unsplash.com/@templecerulean?utm_source=medium&amp;utm_medium=referral">Temple Cerulean</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>I think it’s an important topic to discuss the difference between both Functional Reactive ways to implement in swift.</p><p>The most important requirements for recruiters and companies now are using RxSwift as a library itself not the understanding of reactive programming itself.</p><p>Understanding the concept is important and you decide which library would serve you better in your product.</p><p>1- Reactive Programming, which focuses on asynchronous data streams, which you can listen to and react accordingly.</p><p>2- Functional Programming, which emphasizes calculations via mathematical-style functions, immutability and expressiveness, and minimizes the use of variables and state.</p><p>These are the expressions which FRP comes from the combination of both.</p><h3>RxSwift vs. ReactiveCocoa</h3><p>It’s time to dig into the details. RxSwift and ReactiveCocoa handle several aspects of FRP differently, so let’s take a look at a few of them.</p><h3>Hot vs. Cold Signals</h3><pre>let requestFlow = networkRequest.flatMap(parseResponse)<br><br>requestFlow.startWithNext {[weak self] result in<br>  self?.showResult(result)<br>}</pre><pre>// Source : <a href="http://www.raywenderlich.com/">www.raywenderlich.com</a></pre><ul><li>A <strong>cold signal</strong> is a piece of work you start when you subscribe to it. Each new subscriber starts that work. Subscribing to the requestFlow three times means making three network requests.</li><li>A <strong>hot signal</strong> can already be sending events. New subscribers don’t start it. Normally UI interactions are hot signals.</li></ul><p>ReactiveCocoa provides types for both hot and cold signals: Signal&lt;T, E&gt; and SignalProducer&lt;T, E&gt;, respectively. RxSwift, however, has a single type called Observable&lt;T&gt; which caters to both.</p><p>Independently of having different types or not, knowing about hot and cold signals is extremely important. As <a href="https://twitter.com/andrestaltz">André Staltz</a> puts it:</p><p><em>“If you ignore this, it will come back and bite you brutally. You have been warned.”</em></p><p>If you assume you are dealing with a <strong>hot signal</strong> and it turns out to be a cold one, you will be starting side effects for each new subscriber. This can have tremendous effects on your application. A common example would be three or four entities in your app wanting to observe a network request and for each new subscription, a different request would be started.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea3ec3c098b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>