<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Nedim F</title>
    <description>The latest articles on Forem by Nedim F (@nedimf).</description>
    <link>https://forem.com/nedimf</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F360772%2F265be15e-acc0-43c1-9b02-792694dd0aec.png</url>
      <title>Forem: Nedim F</title>
      <link>https://forem.com/nedimf</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/nedimf"/>
    <language>en</language>
    <item>
      <title>How to contribute to Signal iOS code base</title>
      <dc:creator>Nedim F</dc:creator>
      <pubDate>Sat, 27 Mar 2021 14:58:30 +0000</pubDate>
      <link>https://forem.com/nedimf/how-to-contribute-to-signal-ios-code-base-39d8</link>
      <guid>https://forem.com/nedimf/how-to-contribute-to-signal-ios-code-base-39d8</guid>
      <description>&lt;h1&gt;
  
  
  What is Signal
&lt;/h1&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h1&gt;
  
  
  Let's build it
&lt;/h1&gt;

&lt;p&gt;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. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/Rm1p7xp3Odl2o/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/Rm1p7xp3Odl2o/giphy.gif" alt="building-gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To even start messing around with Signal you'll have to take care of few things.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fork &lt;a href="https://github.com/signalapp/Signal-iOS"&gt;Signal&lt;/a&gt; project&lt;/li&gt;
&lt;li&gt;git clone that project to your mac&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;First thing first, you have to install&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;cocapods-binary&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
.  You can do that by typing&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gem install cocoapods-binary&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;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. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/leavez/cocoapods-binary"&gt;Cocapods-Binary&lt;/a&gt; project:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;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.&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;After you have added this dependency, it's time to play around with&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;make files&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;I was positively surprised how good script was and that make was so effortlessly executed.&lt;/p&gt;

&lt;p&gt;Enter this into your terminal shell:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;make dependencies&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 this will build out all dependencies that are needed. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Apa4HgHy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1616851279764/4gr7_H7DU.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Apa4HgHy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1616851279764/4gr7_H7DU.png" alt="Screenshot 2021-03-27 at 14.21.16.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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. &lt;br&gt;
One way of solving this issue is to change permission to root folder of the project Signal in this case and Pods directory with same method. &lt;/p&gt;

&lt;p&gt;What worked for me was based on this &lt;a href="https://stackoverflow.com/a/53720710/11555781"&gt;stackoverflow thread&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you are done with this. Close Xcode and open .xcworkspace.&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Product -&amp;gt; Clean -&amp;gt; Build&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;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. &lt;br&gt;
If you really need to access internet, use Safari while this process is running. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/9J6TRr1EyWVCMAxV6w/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/9J6TRr1EyWVCMAxV6w/giphy.gif" alt="99 terry cheering"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After some time you will get this screen:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BJ6Md3Os--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1616851688689/Q1LJkAQbX.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BJ6Md3Os--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1616851688689/Q1LJkAQbX.png" alt="Screenshot 2021-03-26 at 23.12.55.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h1&gt;
  
  
  Add our own little feature
&lt;/h1&gt;

&lt;p&gt;Painful part has passed, now it's time to have some fun.  Signal is impressively clean. They follow simple yet efficient architecture. &lt;/p&gt;

&lt;p&gt;First thing to notice when looking at Signal src directory is that it is huge: &lt;br&gt;
Simple tree command shows us, it has&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;1038 directories, 5239 files&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Our luck we don't have to understand every part of it. &lt;/p&gt;

&lt;p&gt;Let's execute 'tree' command in 'Signal/src' directory:&lt;br&gt;
&lt;br&gt;
&lt;code&gt;54 directories, 452 files&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Signal loves to extend on it's own custom classes for example all &lt;strong&gt;UIViewControllers&lt;/strong&gt; in the app are extending from custom class &lt;strong&gt;OWSViewController&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;(OWS: &lt;strong&gt;Open Whisper Systems&lt;/strong&gt; organization responsible for Signal)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OWSViewController&lt;/strong&gt;is not only one custom class that you will find, there is also &lt;strong&gt;OWSTableViewController2&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Inside comments explains it in this way:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;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&lt;br&gt;
retain a view model for each cell in memory at all times&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Now we have figured simplest parts of the app, time to add some of our code. &lt;br&gt;
I have decided easiest thing for us to add, is another option in &lt;strong&gt;Profile&lt;/strong&gt; section.&lt;/p&gt;

&lt;p&gt;Time to locate&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;func updateTableContents()&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;Inside of it we find&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;mainSection = OWSTableSection()&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 . Let's add one more section.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight swift"&gt;&lt;code&gt;
&lt;span class="n"&gt;mainSection&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;disclosureItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="nv"&gt;icon&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;settingsLink&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"Something really cool"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nv"&gt;accessibilityIdentifier&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"Our new feature accessibility identifier"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;actionBlock&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Our new feature"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}))&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Put breakpoint under print and run the app. &lt;br&gt;
If we go to&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;Settings -&amp;gt; Profile&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 we will see UITableView updated with another section called "Something really cool".&lt;/p&gt;

&lt;p&gt;Clicking on our new section, rises breakpoint and prints in console our message.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H65rEbZw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1616853770616/7mb-gbUde.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H65rEbZw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1616853770616/7mb-gbUde.png" alt="Screenshot 2021-03-26 at 23.32.52.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even though this looks unworthy, it is just a start in complex world of the Signal source.&lt;/p&gt;

&lt;h1&gt;
  
  
  Closing words
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://i.giphy.com/media/PizLWrCCo2HK83jI0g/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/PizLWrCCo2HK83jI0g/giphy.gif" alt="cartoon"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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. &lt;/p&gt;

&lt;h1&gt;
  
  
  WHOAMI
&lt;/h1&gt;

&lt;p&gt;I'm Nedim, mobile and backend developer. Most of my time is spent by coding new features for my app &lt;a href="https://tweetly.cc"&gt;Tweetly&lt;/a&gt; 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 &lt;a href="https://threadreaderapp.com/thread/1374742486564880387.html"&gt;twitter thread&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can follow me on &lt;a href="https://twitter.com/nedimcodes"&gt;twitter&lt;/a&gt; to be up to date with all my endeavors. &lt;br&gt;
Github: &lt;a href="https://github.com/nedimf"&gt;nedimf&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>opensource</category>
      <category>signal</category>
    </item>
    <item>
      <title>Mobile application for tracking infections of COVID-19 -FAILURE STORY [DEVLOG pt.1]</title>
      <dc:creator>Nedim F</dc:creator>
      <pubDate>Sat, 04 Apr 2020 19:37:35 +0000</pubDate>
      <link>https://forem.com/nedimf/mobile-application-for-tracking-infections-of-covid-19-failure-story-devlog-pt-1-lm9</link>
      <guid>https://forem.com/nedimf/mobile-application-for-tracking-infections-of-covid-19-failure-story-devlog-pt-1-lm9</guid>
      <description>&lt;p&gt;On begging of this post, I would like to send my best regards to everyone who is doing their part and staying home in these hard times.&lt;/p&gt;

&lt;p&gt;Week ago, I was wondering what new project I can start. So, I have decided to build Bluetooth coronavirus tracker. In this post I'm writing about everything from getting contributors to making app that is not working. I believe that failing and retrying is most important on road to &lt;strong&gt;success&lt;/strong&gt;.&lt;br&gt;
These posts will be divided to parts. I have never written this kind of post and please have in mind that English is my second language. &lt;/p&gt;

&lt;h3&gt;
  
  
  Day 1
&lt;/h3&gt;

&lt;p&gt;Today I have posted my idea on &lt;a href="https://www.reddit.com/r/iOSProgramming/"&gt;r/iosprogramming&lt;/a&gt; and I have received contributor request. I talked to this developer and we have agreed on steps that we are going to take in building this project. Also, this was day where I put placeholder name 'TrackIT'. &lt;/p&gt;

&lt;p&gt;Our initial development plan was to build:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;iOS app&lt;/li&gt;
&lt;li&gt;server &lt;/li&gt;
&lt;li&gt;android app&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So we started working on this project. First few commits were on private git, and these were just playing around with BluetoothCore framework and going through documentation, building test apps and just bunch 'try &amp;amp; error' (if you are interested about BluetoothCore I'll be happy to share my view on that).&lt;/p&gt;

&lt;p&gt;By playing with BluetoothCore I have noticed strange UUID for first time, but being noob in Bluetooth world I just ignored it. App was scanning for all devices in the area. &lt;br&gt;
Next step was to create artificial advertisement device inside iPhone that will be in charge of advertising that iPhone UUID for other devices to scan.&lt;br&gt;
That part went without any problem, pretty straigh forward process.&lt;/p&gt;

&lt;p&gt;In this moment we have decided to proceed in building this project fully with clean architecture (MVC). We setup organization on Github called 'TechAvangers' and have created first repo. &lt;/p&gt;

&lt;p&gt;We had few rules that were going to follow. Because important thing for this tracker was to work without flaws. That alone was hard to achieve but we agreed on how many external libs (3) we will implement in the project, and most important rule was to use &lt;strong&gt;Swift Package Manger&lt;/strong&gt; instead of CocoaPods.&lt;/p&gt;

&lt;h3&gt;
  
  
  Day 2
&lt;/h3&gt;

&lt;p&gt;Whole day was building core of an app, and testing (a lot of testing). There is specific way you can test with Bluetooth peripherals. You have to have some BLE device or simulate BLE device somehow. I decided on simulating BLE device trough an android app called 'BLE simulator', and that worked .&lt;/p&gt;

&lt;p&gt;Till this day we have developed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;core of an app scanning and peripheral emitting service (I will write detailed write up about how this was achieved)&lt;/li&gt;
&lt;li&gt;ui of pulsing animation &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WonYtZwD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://i.ibb.co/NjSxYN0/trackit-1.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WonYtZwD--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://i.ibb.co/NjSxYN0/trackit-1.gif" width="200" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Day 3
&lt;/h3&gt;

&lt;p&gt;We figured we have to add some database to save data till it can get synced with server. Our choice was Realm database, so we started implementation of this library in to project (here I fell in love with Realm ❤️). This was pretty easy to implement, altough there were some tricks that had to be done for testing realm on real device to get real path for 'default.realm'.&lt;br&gt;
If you are having that issue &lt;a href="https://stackoverflow.com/a/28465803"&gt;Follow this Stack Overflow solution&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yqTsb4oz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://i.ibb.co/tzZWpWP/trackit-2.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yqTsb4oz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://i.ibb.co/tzZWpWP/trackit-2.gif" width="200" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm going to end this part right here, in next part coming (cringe alert): &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;building API with Node and Mongoose maps &lt;/li&gt;
&lt;li&gt;craziness with developing android app &lt;/li&gt;
&lt;li&gt;founding shocking security rule that makes this app FAILURE&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to read about scenario of using this app you can check it &lt;a href="https://github.com/TechAvangers/TrackIT-iOS#scenario"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have enjoyed this type of post leave a like.&lt;/p&gt;

&lt;p&gt;Till the next post, stay home. Take care.&lt;br&gt;
Nedim&lt;/p&gt;

</description>
      <category>android</category>
      <category>ios</category>
      <category>coronavirus</category>
      <category>devjournal</category>
    </item>
  </channel>
</rss>
