<?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"><channel><title><![CDATA[Nedim Fakic - Blog]]></title><description><![CDATA[I write about apps and tools I use, I'm always looking for something new to write about and to share with larger crowd. Let me know in comments what would you like me to write next.]]></description><link>https://hashnode.nedimfakic.com</link><generator>RSS for Node</generator><lastBuildDate>Sun, 10 May 2026 22:47:10 GMT</lastBuildDate><atom:link href="https://hashnode.nedimfakic.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How I compromised integrity of Twitter Fleets (iOS and Android)]]></title><description><![CDATA[Beginning
At the beginning of May I was learning how to reverse engineer mobile apps. My focus was on iOS at the moment and I was learning a lot about proxies and runtime manipulation. One morning I've got an idea to research how Twitter built Fleet ...]]></description><link>https://hashnode.nedimfakic.com/how-i-compromised-integrity-of-twitter-fleets-ios-and-android</link><guid isPermaLink="true">https://hashnode.nedimfakic.com/how-i-compromised-integrity-of-twitter-fleets-ios-and-android</guid><category><![CDATA[hacking]]></category><category><![CDATA[Android]]></category><category><![CDATA[iOS]]></category><category><![CDATA[writing]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[Nedim F]]></dc:creator><pubDate>Wed, 21 Jul 2021 13:26:09 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1626525231660/2SYDkgJvX.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="beginning">Beginning</h2>
<p>At the beginning of May I was learning how to reverse engineer mobile apps. My focus was on iOS at the moment and I was learning a lot about proxies and runtime manipulation. One morning I've got an idea to research how Twitter built Fleet functionality. I went in with idea to simple stop request trough MITM and modify it on the fly. It actually worked!</p>
<p><strong>Note:</strong> This isn't security threat per-say, this is issue with compromised show of content!</p>
<h2 id="writeup">Writeup</h2>
<h3 id="thinking-process">Thinking process</h3>
<p>I've never before researched or reported any bounty so I was brainstorming with my developer brain. What happens when I publish Fleet and how that can be modified?!
I researched how Twitter handles publishing of Fleets and figured whole process can be modify to actually compromise integrity of Fleet it self.</p>
<h3 id="writing-up-poc-proof-of-concept">Writing up POC (proof of concept)</h3>
<p>Twitter Fleets integrity can be compromised by sharing tweet using "Share in a Fleet" option. Malicious user has ability to change shared tweet id and trick user in thinking that tweet they are clicking on is legitimate but in reality user can be baited to view a totally different malicious tweet. This issue in Fleets can also result in unableness to "skip" fleet.</p>
<p>Twitter app has a feature to share tweet as Fleet by using built in "Share in a Fleet" option. Creating fleet sends a request to a server that creates an object. That object can be modified to change shared tweet completely, which compromises the integrity of the shared resource. Even more, attacker can "force" user in opening modified tweet by extending media_bounding_boxes width and height values , resulting in "full screen layer" that is completely clickable and can't be skipped.</p>
<p>From: </p>
<pre><code class="lang-json">{...
    <span class="hljs-attr">"media_bounding_boxes"</span>: [
        {
            <span class="hljs-attr">"anchor_point_x"</span>: <span class="hljs-number">0.5</span>,
            <span class="hljs-attr">"anchor_point_y"</span>: <span class="hljs-number">0.5</span>,
            <span class="hljs-attr">"entity"</span>: {
                <span class="hljs-attr">"type"</span>: <span class="hljs-string">"tweet"</span>,
                <span class="hljs-attr">"value"</span>: <span class="hljs-string">"1392985728271884288"</span>
            },
            <span class="hljs-attr">"height"</span>: <span class="hljs-number">0.423306</span>,
            <span class="hljs-attr">"rotation"</span>: <span class="hljs-number">0</span>,
            <span class="hljs-attr">"width"</span>: <span class="hljs-number">0.936</span>
        }
    ],
...
}
</code></pre>
<p>To: </p>
<pre><code class="lang-json">{...
    <span class="hljs-attr">"media_bounding_boxes"</span>: [
        {
            <span class="hljs-attr">"anchor_point_x"</span>: <span class="hljs-number">0.5</span>,
            <span class="hljs-attr">"anchor_point_y"</span>: <span class="hljs-number">0.5</span>,
            <span class="hljs-attr">"entity"</span>: {
                <span class="hljs-attr">"type"</span>: <span class="hljs-string">"tweet"</span>,
                <span class="hljs-attr">"value"</span>: <span class="hljs-string">"1392124243710779394"</span> <span class="hljs-comment">//pointing to totally different Tweet</span>
            },
            <span class="hljs-attr">"height"</span>: <span class="hljs-number">1000.423306</span>,   <span class="hljs-comment">//tweet can't be skipped because runtime drawn layer will be activated on click event</span>
            <span class="hljs-attr">"rotation"</span>: <span class="hljs-number">0</span>,
            <span class="hljs-attr">"width"</span>: <span class="hljs-number">1000.936</span>  <span class="hljs-comment">//tweet can't be skipped because runtime drawn layer will be activated on click event</span>
        }
    ],
...
}
</code></pre>
<h3 id="impact">Impact</h3>
<p>Every shared tweet is suppose to have an integrity . As user of the Twitter app I would expect that shown tweet, is one that gets open if I choose to interact with it. More for, as user of app I would like to have an option to "scroll" through fleets and not be forced to open one. This vulnerability compromises those already made "promises".
Malicious attacker can stage scam campaign based on this issue.</p>
<p>Example: Attacker claims to be an account that provides memes of cute dogs, and it create fleets that share a dog related content, but in background attacker is using this vulnerability to pass in different tweets to full fill its malicious agenda . Once users starts interacting with those fleets:
User can't skip Fleet
User is forced to open tweet, because runtime draw of views with modified width and height
User gets redirected to a tweet that is political ad, crypto scam, nsfw content etc.</p>
<h2 id="video-showcase">Video showcase</h2>
<p><a target="_blank" href="https://youtu.be/zqlAJBaoguQ">iOS Fleet showcase</a></p>
<p><a target="_blank" href="https://youtu.be/UlY5sYJ6F0Q">Android crash showcase</a></p>
<h2 id="bug-bounty-process">Bug bounty process</h2>
<ul>
<li>This "bug" was reported in May 15th, it went trough trough bug triage steps by May 20th. </li>
<li>Escalated to the point where change in values crashes Android app on opening "malicious fleet"</li>
<li>No response from Twitter for 2 months </li>
<li>Me publicly asking whats going on with ticket now that fleet feature will be discontinued</li>
<li>Twitter marking it as "informative" because they couldn't reproduce issue as valid threat!</li>
</ul>
]]></content:encoded></item><item><title><![CDATA[Stories/Fleets publishing system is flawed, and here is why it "can't be" fixed!]]></title><description><![CDATA[Flawed Logic
Let's first understand how these system actually works. I'll be using Twitters Fleets for example and Instagram Stories are not way behind on this approach!
From users point of view:

User choose image/tweet to share on their story/fleet...]]></description><link>https://hashnode.nedimfakic.com/storiesfleets-publishing-system-is-flawed-and-here-is-why-it-cant-be-fixed</link><guid isPermaLink="true">https://hashnode.nedimfakic.com/storiesfleets-publishing-system-is-flawed-and-here-is-why-it-cant-be-fixed</guid><category><![CDATA[Twitter]]></category><category><![CDATA[Story]]></category><category><![CDATA[hacking]]></category><category><![CDATA[iOS]]></category><category><![CDATA[Android]]></category><dc:creator><![CDATA[Nedim F]]></dc:creator><pubDate>Wed, 21 Jul 2021 13:23:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1626524198540/RjhBSuKLt.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="flawed-logic">Flawed Logic</h2>
<p>Let's first understand how these system actually works. I'll be using Twitters Fleets for example and Instagram Stories are not way behind on this approach!</p>
<p>From users point of view:</p>
<ol>
<li>User choose image/tweet to share on their story/fleet</li>
<li>User adds some graphic to composer view</li>
<li>Story/Fleet is published</li>
</ol>
<p>From developers point of view:</p>
<ol>
<li>User choose image/tweet to share on their story/fleet</li>
<li>User adds some graphic to composer view</li>
<li>App does screen grab of composed view and turns it into image/video</li>
<li><strong>App uploads that created image/video to server</strong></li>
<li><strong>App sends correspondent JSON to describe created story/fleet</strong></li>
<li>App gets network status code if everything went smoothly </li>
</ol>
<p>From developers point of view you can probably guess where flaw is?
Direct flaw here is in trusting integrity of uploaded image with correspondent description on server. Therefor steps 3 and 4 are perfect candidates for evil actor to change integrity of shared values. 
Servers can record different description that does not equal to sent media. That shows two separate truths and as that should be concerning!</p>
<h2 id="example">Example:</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1626523300383/2Fv12tq7d.png" alt="figma-01.png" /></p>
<p>On image above we can see two different JSON structures. First JSON structure is one before MITM modification, second one shows data after modification.
In this example we changed original <code>tweet_id</code> to totally different one (have in mind this can be any valid tweet id). We also modified width and height of view that will get redrawn once Fleet has been open. Adding width of 1000px and height of 1000px will result in end user unableness to skip that Fleet and force user to open it!</p>
<p>With further research I have also concluded that this can result in crash on Android app! If we modify width and height values to larger numbers we can effectively crash Android app when user gets to that Fleet in their timeline!</p>
<p>Show case video:</p>
<p><a target="_blank" href="https://youtu.be/zqlAJBaoguQ">Fleet flaw showcase</a></p>
<p><a target="_blank" href="https://youtu.be/UlY5sYJ6F0Q">Android crash showcase</a></p>
<p>Here I would argue that system is simply flawed because it's not checking for changes in media and if they directly correspond to description of data!
This flaw shows that server does not check for data validation on its side, so malicious values can be passed! </p>
<h2 id="why-it-cant-be-fixed">Why it "can't be" fixed?</h2>
<p>Good question! There is always possibilities someone else will find way to make this "spoofing/integrity compromising" attack more difficult but, reality is that client is vulnerable to runtime modifications. In story/fleets case, client is one creating media to be shared, researcher can find way to modify output of called method and we are back on square one! </p>
<p>But when you think about it, this is case in every issue in cyber security, we as developers frequently put various blockades to try and mitigate attacks, this is no different. One more more blockade can go long way! </p>
<p>I thought a bit, what that blockade can be in our case and I came up with this type of "fix"! There is probably plenty more and I would be happy to learn about them, just tag me on Twitter <a target="_blank" href="https://twitter.com/nedimcodes">@nedimcodes</a></p>
<h3 id="possible-added-step-to-mitigate-threat">Possible added step to mitigate threat</h3>
<p>First I would add some metadata to image describing most important values, if post/tweet is in question that should be post/tweet original ID. </p>
<p>On server I would check for post/tweet ID does it match with received metadata, if not then server returns error code! This would simply unable attacker from performing any spoofing on story/fleet. </p>
<p><strong>Issue with this mitigation:</strong> </p>
<p>Attacker can simply find what method on client side is responsible for handling appending metadata to image, and modify it on runtime!</p>
<p>I tested my theory on two apps Twitter and Instagram! On Twitter I have managed to modify all sorts of data from size of bounds that gets redrawn in each new fleet view to changing what tweet id is actually getting called! </p>
<blockquote>
<p>I've got written confirmation from Twitter to share my findings, after they have labeled my report as "informative". Read more about it here <a target="_blank" href="https://hashnode.nedimcodes.com/how-i-compromised-integrity-of-twitter-fleets-ios-and-android">How I compromised integrity of Twitter Fleets (iOS and Android)</a></p>
</blockquote>
<p><strong>Note:</strong>
Both Twitter and Instagram were notified about these issue trough their bug bounty programs, both platforms responded that they don't think about it as valid security threat!</p>
<h2 id="appreciation">Appreciation</h2>
<p>I would like to thank <a target="_blank" href="https://twitter.com/wongmjane">wongmjane</a> for inspiring me to try iOS security path! I would also love to thank <a target="_blank" href="https://twitter.com/CubicleApril">April King</a> from Twitter security for giving me green light to disclose this publicly!</p>
]]></content:encoded></item><item><title><![CDATA[Guide on how to contribute code to Signal]]></title><description><![CDATA[What is Signal
Signal is app that has skyrocketed in popularity with beginning of this year, with huge spikes in user migrating from Whatsapp because controversy new Privacy Policy that was introduced.
Let's build it
First thing to understand, Signal...]]></description><link>https://hashnode.nedimfakic.com/guide-on-how-to-contribute-code-to-signal</link><guid isPermaLink="true">https://hashnode.nedimfakic.com/guide-on-how-to-contribute-code-to-signal</guid><category><![CDATA[iOS]]></category><category><![CDATA[Swift]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[messaging]]></category><category><![CDATA[side project]]></category><dc:creator><![CDATA[Nedim F]]></dc:creator><pubDate>Sat, 27 Mar 2021 14:27:57 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1616854873324/41lv2Vb0S.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="what-is-signal">What is Signal</h1>
<p>Signal is app that has skyrocketed in popularity with beginning of this year, with huge spikes in user migrating from Whatsapp because controversy new Privacy Policy that was introduced.</p>
<h1 id="lets-build-it">Let's build it</h1>
<p>First thing to understand, Signal is huge project. It has a lot of code, it was written originally in Objective C but throughout the years new features were added in Swift, so it has healthy amount of both languages in it's codebase. </p>
<p><img src="https://media.giphy.com/media/Rm1p7xp3Odl2o/giphy.gif" alt="building-gif" /></p>
<p>To even start messing around with Signal you'll have to take care of few things.</p>
<ul>
<li>Fork <a target="_blank" href="https://github.com/signalapp/Signal-iOS">Signal</a> project</li>
<li>git clone that project to your mac</li>
</ul>
<p>You can't just open .xcworkspace and expect app to build and compile. Signal is very complex piece of software that has a lot of parts built into it, those parts have to be compiled before even attempting to do a build.</p>
<p>First thing first, you have to install <code>cocapods-binary</code>.  You can do that by typing </p>
<p><code>gem install cocoapods-binary</code></p>
<p>Think about cocapods-binary as standard cocapods but for really intensive projects, where build time is really important, and those libraries have to be turned into executable binaries. </p>
<p><a target="_blank" href="https://github.com/leavez/cocoapods-binary">Cocapods-Binary</a> project: </p>
<p><code>It will compile the source code of pods during the pod install process, and make CocoaPods use them. Which pod should be compiled is controlled by the flag in Podfile.</code></p>
<p>After you have added this dependency, it's time to play around with <code>make files</code>.
I was positively surprised how good script was and that make was so effortlessly executed.</p>
<p>Enter this into your terminal shell:  </p>
<p><code>make dependencies</code> this will build out all dependencies that are needed. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1616851279764/4gr7_H7DU.png" alt="Screenshot 2021-03-27 at 14.21.16.png" /></p>
<p>At this point Xcode will raise error that it wants to unlock certain files and if you click Yes, it will raise another error saying it can't perform that action. 
One way of solving this issue is to change permission to root folder of the project <code>Signal</code> in this case and Pods directory with same method. </p>
<p>What worked for me was based on this <a target="_blank" href="https://stackoverflow.com/a/53720710/11555781">stackoverflow thread</a></p>
<p>After you are done with this. Close Xcode and open .xcworkspace. 
<code>Product -&gt; Clean -&gt; Build</code></p>
<p>Now we wait till project is built, based on your mac performance this can be very lengthy process, also it can be very resource intensive so my advice is to close Chrome and every other resource intensive app. 
If you really need to access internet, use Safari while this process is running. </p>
<p><img src="https://media.giphy.com/media/9J6TRr1EyWVCMAxV6w/giphy.gif" alt="99 terry cheering" /></p>
<p>After some time you will get this screen:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1616851688689/Q1LJkAQbX.png" alt="Screenshot 2021-03-26 at 23.12.55.png" /></p>
<h1 id="add-our-own-little-feature">Add our own little feature</h1>
<p>Painful part has passed, now it's time to have some fun.  Signal is impressively clean. They follow simple yet efficient architecture. </p>
<p>First thing to notice when looking at Signal src directory is that it is huge: 
Simple tree command shows us, it has <code>1038 directories, 5239 files</code>.
Our luck we don't have to understand every part of it. </p>
<p>Let's execute <code>tree</code> command in <code>Signal/src</code> directory: <code>54 directories, 452 files</code>.</p>
<p>Signal loves to extend on it's own custom classes for example all <code>UIViewControllers</code> in the app are extending from custom class <code>OWSViewController</code>. </p>
<p>(OWS: <strong> Open Whisper Systems </strong> organization responsible for Signal)</p>
<p><code>OWSViewController</code> is not only one custom class that you will find, there is also <code>OWSTableViewController2</code></p>
<p>Inside comments explains it in this way: </p>
<p><code>This class offers a convenient way to build table views when performance is not critical, e.g. when the table only holds a screenful or two of cells and it's safe to
retain a view model for each cell in memory at all times.</code></p>
<p>Now we have figured simplest parts of the app, time to add some of our code. 
I have decided easiest thing for us to add, is another option in <code>Profile</code> section.</p>
<p>Time to locate <code>func updateTableContents()</code> method. 
Inside of it we find <code>mainSection = OWSTableSection()</code> . Let's add one more section.</p>
<pre><code class="lang-swift">mainSection.add(.disclosureItem(
      icon: .settingsLink, name: <span class="hljs-string">"Something really cool"</span>,
      accessibilityIdentifier: <span class="hljs-string">"Our new feature accessibility identifier"</span>, actionBlock: {
    <span class="hljs-built_in">print</span>(<span class="hljs-string">"Our new feature"</span>)
}))
</code></pre>
<p>Put breakpoint under print and run the app. 
If we go to <code>Settings -&gt; Profile</code> we will see UITableView updated with another section called <code>Something really cool</code>.</p>
<p>Clicking on our new section, rises breakpoint and prints in console our message.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1616853770616/7mb-gbUde.png" alt="Screenshot 2021-03-26 at 23.32.52.png" /></p>
<p>Even though this looks unworthy, it is just a start in complex world of the Signal source.</p>
<h1 id="closing-words">Closing words</h1>
<p><img src="https://media.giphy.com/media/PizLWrCCo2HK83jI0g/giphy.gif" alt="cartoon" /></p>
<p>Signal is huge project, you'll need to spend days familiarizing yourself with its complex codebase, but after initial few days of looking for methods and issues, you'll get used to it. Signal app is one of my favourite open source projects when it comes to iOS development, because you can learn a lot by just playing around with features that are already built in. </p>
<h1 id="whoami">WHOAMI</h1>
<p>I'm Nedim, mobile and backend developer. Most of my time is spent by coding new features for my app <a target="_blank" href="https://tweetly.cc">Tweetly</a> also I actively tweet about open source projects I try out, just days ago I tried Zoom's new Video SDK, that project I haven't turned into article like this, but it's worthy read as <a target="_blank" href="https://threadreaderapp.com/thread/1374742486564880387.html">twitter thread</a>.</p>
<p>You can follow me on <a target="_blank" href="https://twitter.com/nedimcodes">twitter</a> to be up to date with all my endeavors. 
Github: <a target="_blank" href="https://github.com/nedimf">nedimf</a></p>
]]></content:encoded></item><item><title><![CDATA[How to overcome the struggle of not being able to find a fix for a coding problem?]]></title><description><![CDATA[Let's face it, coding is hard. It's hard for a human brain to think like a computer. Unfortunately to understand the problem you have to think like a machine. 
One thing to have in mind from the very start, no one can teach you how to think. You have...]]></description><link>https://hashnode.nedimfakic.com/how-to-overcome-the-struggle-of-not-being-able-to-find-a-fix-for-a-coding-problem</link><guid isPermaLink="true">https://hashnode.nedimfakic.com/how-to-overcome-the-struggle-of-not-being-able-to-find-a-fix-for-a-coding-problem</guid><category><![CDATA[iOS]]></category><category><![CDATA[coding]]></category><category><![CDATA[newbie]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[problem solving skills]]></category><dc:creator><![CDATA[Nedim F]]></dc:creator><pubDate>Sat, 13 Feb 2021 14:44:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1613219747484/ckoQcx8Nt.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Let's face it, coding is hard. It's hard for a human brain to think like a computer. Unfortunately to understand the problem you have to think like a machine. 
One thing to have in mind from the very start, no one can teach you how to think. You have to do that all on your own.</p>
<p><img src="https://media.giphy.com/media/LmNwrBhejkK9EFP504/giphy.gif" alt /></p>
<p>You have to practice, more you practice more comfortable you are in your knowledge, by being more comfortable you are making a better foundation. Having a solid and good foundation is key. </p>
<h2 id="how-to-build-a-solid-foundation">How to build a solid foundation</h2>
<p>To build a solid foundation you'll need dedication. Lots and lots of dedication. You have to start small. Learn the absolute basics of the topic. If you are learning a new programming language, usually that it is language syntax. </p>
<p>How did you learn to ride a bike, or drive a car? You practiced, those are skills we have to practice every day so we don't forget. The same is with basic math, as a kid, you had to do all these small problems, as homework. Even tho most of us hated our homework, it helped us to understand how basic mathematics works.
Apply the same thing to coding as well, when you are teaching yourself basics, be sure to practice them.</p>
<p>Here is an example of what you can build, after you are comfortable enough in the syntax of the language:</p>
<blockquote>
<p>This applies only to OOP programming languages</p>
</blockquote>
<ul>
<li>Imagine you are having a bakery 🧁 . Create classes and methods to run your bakery, make it into a CLI app. Play around with language syntax as much as you can. If language has various patterns, try them out.</li>
</ul>
<p><img src="https://media.giphy.com/media/4SXULfEtV0O0DvijQy/giphy.gif" alt /></p>
<h2 id="i-think-i-have-a-solid-enough-foundation-what-now">I think I have a solid enough foundation, what now?</h2>
<p>If you think you have a solid enough foundation, you can start by researching your problem. Don't be afraid to use Stack Overflow or any internet resource, there is a good chance, someone already had the same issue and found a solution for it.
Especially if the error you are getting is not even your fault, many times it can be IDE just messing with your will to live. jk, ofc.</p>
<p>After you are positive that your problem fix is not a quick search away, then you have to start thinking logically. This part applies to most programming problems, it doesn’t matter if you are a Mobile, Web, or even AI developer. </p>
<h3 id="break-your-problem-into-smaller-pieces">Break your problem into smaller pieces</h3>
<p>To best show this, I'm going to use the example of one of the problems I have faced years ago. When I was just starting coding, I had this cool idea for an app, I can’t really remember what it did, but I know it had something to do with camera and saving photos to a phone storage. The issue was the path that I was looking for, wasn’t valid. </p>
<p>Let say you have the same problem path <code>data://mobile/storage/DCIM/pictures/myimage.jpg</code> isn't valid.
The only thing that you know at this point, this path isn't valid, You don’t know why, you just know that image taken does not show when you try to load it.</p>
<p>Let's break our issue into smaller bits:
First, we have to check the whole path of that problem. Let's call it our "route to hell".  So what does my code do before this issue occurs? </p>
<ul>
<li><code>takePhoto()</code> method is called. This method does this and that. Alright, let's see if an error occurs there</li>
<li><code>takePhoto()</code> returns object <code>TakenPhoto</code></li>
<li><code>TakenPhoto</code> contains few object properties, but most importantly it contains <code>path</code> property</li>
<li>Check if the property is alright and if we can access it. </li>
</ul>
<p>After checking all these little things, we have concluded that "route to hell" is working how it's supposed to.
<img src="https://media.giphy.com/media/IedrY2VP5IO5ivDQAD/giphy.gif" alt />
Now it's time to think logically. We start by searching documentation for object <code>TakenPhoto</code>. We came across the developer page for that object and we look for property <code>path</code>. We read documentation about that property. Property <code>path</code> of the object <code>TakenPhoto</code> returns <code>path</code> as <code>String</code> but have in mind that string has prefix <code>data://</code> in front.  Now we have to figure out why the prefix <code>data://</code> is added in the first place. We search for that answer as well, we find the answer being <code>data://</code> is added because property <code>path</code> returns place in device storage. Now we have even more information about our problem.</p>
<p>Let's review, we have broken our problem into smaller pieces, analysis of the "route to hell" has shown that all methods are indeed working <strong>correctly</strong>. Then we have an isolated issue, and we figured that <code>path</code> property is causing us all this trouble.
Now we just need to fix it. Easier said than done, right?</p>
<h3 id="fixing">Fixing</h3>
<p>Our investigation has confirmed that the issue is in <code>path</code> property. We then read documentation in loading images from device storage where we discovered that we have to convert our type <code>String</code> to type <code>URL</code>. 
We approached converting part </p>
<pre><code class="lang-swift"><span class="hljs-keyword">let</span> pathURL = <span class="hljs-type">URL</span>(string: path)
</code></pre>
<h3 id="final-test">Final Test</h3>
<p>After few hours of solving this problem, we have finally find a fix. <strong>Run it</strong> -&gt; Loading ... -&gt; Booom! -&gt; It's working!
<img src="https://media.giphy.com/media/VgOODy0U7ywWVd7wx0/giphy.gif" alt /></p>
<h2 id="final-thought">Final thought</h2>
<p>Being a developer is amazing, it gives you the ability to build whatever you put your mind to. But with power comes <code>issues</code>. Some are solvable in few minutes, some take days or even weeks, but most importantly it's to not quit. You can take few days break, even weeks of break, but solving the problem is the key. Don't quit on the problem, give your best to solve it, solving it even partially can have a huge impact on your career. </p>
<h3 id="about-me">About me</h3>
<p>I'm Nedim, backend, and mobile app developer, who enjoys working on new stuff every day. Currently, I'm developing this cool app called <a target="_blank" href="https://tweetly.cc">Tweetly</a>. You can find me on Twitter and be free to DM (<a target="_blank" href="https://twitter.com/nedimcodes">@nedimcodes</a>)!</p>
]]></content:encoded></item><item><title><![CDATA[iOS Development How & Where to Start]]></title><description><![CDATA[So you want to make iPhone and iPad apps, that's great. You have been using your phone for a good part of your life and you probably have some great ideas laying around. 

Note: This article is not walkthrough tutorial for making your first iOS app. ...]]></description><link>https://hashnode.nedimfakic.com/ios-development-how-and-where-to-start</link><guid isPermaLink="true">https://hashnode.nedimfakic.com/ios-development-how-and-where-to-start</guid><category><![CDATA[iOS]]></category><category><![CDATA[app development]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[#howtos]]></category><category><![CDATA[resources]]></category><dc:creator><![CDATA[Nedim F]]></dc:creator><pubDate>Fri, 04 Dec 2020 21:47:09 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1607121196710/XaSWqqE04.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>So you want to make iPhone and iPad apps, that's great. You have been using your phone for a good part of your life and you probably have some great ideas laying around. </p>
<p><img src="https://media.giphy.com/media/3oKIPnAiaMCws8nOsE/giphy.gif" alt /></p>
<p><strong>Note</strong>: This article is not walkthrough tutorial for making your first iOS app. This article focuses the most, what to expect when you start and how &amp; where to start.</p>
<p>To start with iOS development you will need few things: </p>
<ul>
<li>working Mac computer</li>
<li>XCode</li>
</ul>
<p>It's just a myth you need newest and greatest to start coding, any decent working macbook should be enough for learning iOS development, builds might take a while, but you can always use that time to reflect on your code, or even better get yourself some coffee.</p>
<h3 id="xcode">Xcode</h3>
<p><strong>Def.</strong>
The Xcode IDE is at the center of the Apple development experience. Tightly integrated with the Cocoa and Cocoa Touch frameworks, Xcode is an incredibly productive environment for building apps for Mac, iPhone, iPad, Apple Watch, and Apple TV.</p>
<p>So Xcode is IDE that iOS developers use on daily basis. It has everything you need built in. Do you need cool 3D view hierarchy of your view, or cool debugger to track really annoying crash, everything is already built in Xcode for you to utilise free of charge.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1607116872045/PEy-DvYiv.png" alt="xcode" /></p>
<h3 id="programming-language">Programming language</h3>
<p><img src="https://media.giphy.com/media/bEVKYB487Lqxy/giphy.gif" alt /></p>
<p>There are two types of beginners in iOS. Once who are just starting coding and once who are already fluent in some other programming environments.
But both of them have few things in common and they both need to start by learning one of two languages for iOS development. </p>
<p>Wait two? I thought there was only Swift?!
Indeed there is Swift but there is also its predecessor which is Objective-C.
If you are just starting the easiest way is to learn Swift which is a lot easier to wrap your mind around. Let's see why on an example of creating a function that calculates two numbers.</p>
<h3 id="swift">Swift</h3>
<pre><code class="lang-swift"><span class="hljs-keyword">import</span> Foundation

<span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">addTwoNumbers</span><span class="hljs-params">(a: Int, b: Int)</span></span> -&gt; <span class="hljs-type">Int</span>{
     <span class="hljs-keyword">return</span> a+b 
}

<span class="hljs-built_in">print</span>(addTwoNumbers(a: <span class="hljs-number">3</span>, b: <span class="hljs-number">3</span>))
</code></pre>
<h4 id="walkthrough">Walkthrough:</h4>
<ol>
<li><code>import Foundation</code><blockquote>
<p>Imports module named <a target="_blank" href="https://developer.apple.com/documentation/foundation">Foundation</a> from iOS standard library</p>
</blockquote>
</li>
<li><code>func addTwoNumbers(a: Int, b: Int) -&gt; Int{</code> <blockquote>
<p>This is how we declare function in Swift. You have to use <code>func</code> keyword and then the name you want to call your function such as in our case <code>addTwoNumbers</code>. Our function has some arguments and we can state them as <code>(a: Int, b: Int)</code>. <code>Int</code> represents the data type of our argument specific for this example. <code>-&gt; Int</code> means that our function will return data type Int when called </p>
</blockquote>
</li>
<li><code>return a+b</code> is just an addition operator </li>
<li><code>print(addTwoNumbers(a: 3, b: 3))</code> prints out to console result of our function. </li>
</ol>
<p>The result will be <code>6</code></p>
<h3 id="objective-c">Objective-C</h3>
<pre><code class="lang-objc"><span class="hljs-meta">#import <span class="hljs-meta-string">&lt;Foundation/Foundation.h&gt;</span></span>
<span class="hljs-keyword">int</span> addTwoNumbers(<span class="hljs-keyword">int</span> a, <span class="hljs-keyword">int</span> b) 
{
    <span class="hljs-keyword">return</span> a+b;
}
<span class="hljs-keyword">int</span> main (<span class="hljs-keyword">int</span> argc, <span class="hljs-keyword">const</span> <span class="hljs-keyword">char</span> * argv[])
{
   <span class="hljs-built_in">NSLog</span>(<span class="hljs-string">@"%d"</span>,addTwoNumbers(<span class="hljs-number">1</span>,<span class="hljs-number">2</span>));
   <span class="hljs-keyword">return</span> <span class="hljs-number">0</span>;
}
</code></pre>
<p>Try directly from your browser <a target="_blank" href="https://www.tutorialspoint.com/compile_objective-c_online.php">online compiler</a></p>
<h4 id="walkthrough">Walkthrough:</h4>
<ol>
<li><code>#import &lt;Foundation/Foundation.h&gt;</code><blockquote>
<p>Imports module named <a target="_blank" href="https://developer.apple.com/documentation/foundation">Foundation</a> from iOS standard library.</p>
</blockquote>
</li>
<li><code>int addTwoNumbers(int a, int b)</code> <blockquote>
<p>This is how we declare function in Objective-C. You have to use the type that you want to return<code>int</code> (in our case) and then the name you want to call your function such as in our case <code>addTwoNumbers</code>. Our function has some arguments and we can state them as <code>(int a, int b)</code>. <code>int</code> represents data type of our argument specific for this example. </p>
</blockquote>
</li>
<li><code>return a+b;</code> is just an addition operator </li>
<li><code>int main (int argc, const char * argv[]) {...}</code> scope where our code will be executed.</li>
<li><code>NSLog(@"%d",addTwoNumbers(1,2)); return 0;</code> prints out to console result of our function.  </li>
</ol>
<p>The result will be <code>3</code></p>
<p>As you can see both of them are quite different syntax-wise. It's totally up to you what you want to use. Just have in mind that Apple has been investing time and money in Swift programming language for years now.</p>
<p>You may wonder why even bother learning Objective-C. When you start coding for iOS you will see that a lot of code in iOS SDK is written in Objective C, and really powerful third party libraries, such as <a target="_blank" href="https://github.com/SDWebImage/SDWebImage">SDWebImage</a> or <a target="_blank" href="https://github.com/robbiehanson/CocoaAsyncSocket">CocoaAsyncSocket</a> are in whole written in Objective-C. Understanding code that goes to such libraries could really save your time in future. </p>
<h3 id="resources-where-you-can-learn-swift-or-objective-c">Resources where you can learn Swift or Objective-C:</h3>
<ul>
<li><a target="_blank" href="https://www.raywenderlich.com/ios/videos">Raywenderlich</a></li>
<li><a target="_blank" href="https://www.youtube.com/watch?v=71pyOB4TPRE">Youtube - Stanford course</a></li>
<li><a target="_blank" href="https://www.hackingwithswift.com/">Hacking with Swift</a></li>
<li><a target="_blank" href="https://www.devslopes.com/">Devslopes</a></li>
<li><a target="_blank" href="https://books.apple.com/us/book-series/swift-programming-series/id888896989">Free Swift Book from Apple</a></li>
</ul>
<p>You will have more luck learning Objective C from books, so here is one I recommend </p>
<ul>
<li><a target="_blank" href="https://www.oreilly.com/library/view/programming-in-objective-c/9780133756937/">Programming in Objective-C</a></li>
</ul>
<h2 id="building-your-app-looks-and-feels">Building your app looks and feels</h2>
<p>iOS isn't only about logic, it's also about design. Apple was kind enough to give us developers more than one way of creating views for our apps.
You can use:</p>
<ul>
<li>Storyboards</li>
<li>Programmatic layout</li>
<li>SwiftUI (newest and latest 🤩)</li>
</ul>
<p>If you are a total beginner start with Storyboards, to get a feel of Auto Layout and how it works, what is trailing and leading and how to align elements to your liking.
After you feel comfortable enough in Storyboards, then challenge yourself and write the same views using only code. At first, it will take forever, but later in your projects, it will feel more natural to type a view, then add it through Storyboard. </p>
<blockquote>
<p>Note: Don't skip Storyboards, you'll have to learn how to get a visual representation of the app views as a real iOS developer.  </p>
</blockquote>
<p>I would suggest to read this cool article from <a target="_blank" href="https://www.avanderlee.com/swift/auto-layout-programmatically/">SwiftLee Auto-Layout Programmatically</a></p>
<h3 id="roadmap">Roadmap</h3>
<p>I like this <a target="_blank" href="https://github.com/BohdanOrlov/iOS-Developer-Roadmap">roadmap</a>. It is made for someone who is planning to have iOS as their new career. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1607114477508/KWEjEtnHU.png" alt="image.png" /></p>
<h3 id="where-to-start">Where to start?</h3>
<p>I enjoyed taking this <strong>FREE</strong> <a target="_blank" href="https://github.com/nedimf/udacity-iOS-nanodegrees">Udacity iOS Nanodegree</a> which contains a link for every available iOS course on Udacity. Go at your own pace.</p>
<ol>
<li><a target="_blank" href="https://www.udacity.com/course/swift-for-beginners--ud1022">Swift for Beginners: The First Step in Building Apps</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/swift-for-developers--ud1025">Swift for Developers: Your Next Programming Language</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/learn-swift-programming-syntax--ud902">Learn Swift Programming Syntax</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/intro-to-ios-app-development-with-swift--ud585">iOS App Development with Swift</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/uikit-fundamentals--ud788">UIKit Fundamentals: Learn the iOS User Interface Library </a></li>
<li><a target="_blank" href="https://www.udacity.com/course/ios-networking-with-swift--ud421">iOS Networking with Swift: Web Services, APIs, and JSON </a></li>
<li><a target="_blank" href="https://www.udacity.com/course/ios-persistence-and-core-data--ud325">iOS Persistence and Core Data</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/how-to-make-an-ios-app--ud607">How to Make an iOS App</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/grand-central-dispatch-gcd--ud576">Grand Central Dispatch (GCD)</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/auto-layout--ud1026">AutoLayout: Using Constraint-Based Design</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/building-ios-interfaces--ud1027">Building iOS Interfaces: Designing for Mobile</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/mobile-design-and-usability-for-ios--ud1034">Mobile Design and Usability for iOS</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/ios-design-patterns--ud1029">iOS Design Patterns: Common Problems, Common Solutions</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/data-structures-and-algorithms-in-swift--ud1011">Data Structures &amp; Algorithms in Swift</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/xcode-debugging--ud774">Xcode Debugging</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/passwordless-login-solutions-for-ios--ud1028">Passwordless Login Solutions for iOS</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/firebase-in-a-weekend-by-google-ios--ud0351">Firebase in a Weekend: iOS</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/continuous-integration-and-deployment--ud1030">Continuous Integration and Deployment: Seamless Mobile Development</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/core-ml--ud1038">Core ML: Machine Learning for iOS</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/learn-arkit-using-swift--ud116">Learn ARKit using Swift</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/firebase-analytics-ios--ud353">Firebase Analytics: iOS</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/ios-interview-prep--ud240">iOS Interview Prep</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/server-side-swift--ud1031">Server-Side Swift</a></li>
<li><a target="_blank" href="https://www.udacity.com/course/objective-c-for-swift-developers--ud1009">Objective-C for Swift Developers</a></li>
</ol>
<h2 id="to-summarise">To summarise:</h2>
<ul>
<li><p>Learn programming language </p>
<blockquote>
<p>as much as you can, go over the theory of it, and learn by doing examples, practice it to get a real feeling of how it works. You have to get comfortable seeing code and understanding what it does. </p>
</blockquote>
</li>
<li><p>Learn how to solve problems</p>
<blockquote>
<p>after you are comfortable enough coding something new, and following tutorial to 'just to have that reassuring feeling' then you can start by solving problems. Programming is all about solving one problem after another, if you learn how to correctly approach a problem you can use that knowledge outside of iOS scope and branch out even more.</p>
</blockquote>
</li>
<li><p>Learn how to approach bugs</p>
<blockquote>
<p>making errors is the most human thing you can do. Having that error fixed is where the fun comes in, you have to put yourself in 'computers shoes'. Computers think differently, and to understand how they do is crucial to solving a problem. Never hesitate to Google your problems, because there is a huge chance someone already had that same question as you did, days, months, even years ago.</p>
</blockquote>
</li>
</ul>
<h3 id="about-me">About me</h3>
<p>I'm Nedim, backend, and mobile app developer, who enjoys working on new stuff every day.  Currently, I'm developing this cool app called <a target="_blank" href="https://tweetly.cc">Tweetly</a>. You can find me on Twitter and be free to DM (<a target="_blank" href="https://twitter.com/nedimcodes">@nedimcodes</a>)!</p>
]]></content:encoded></item></channel></rss>