<?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:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Yuraware]]></title><description><![CDATA[AI & software development blog of Yuri Kobets]]></description><link>https://yuraware.com/</link><image><url>https://yuraware.com/favicon.png</url><title>Yuraware</title><link>https://yuraware.com/</link></image><generator>Ghost 3.13</generator><lastBuildDate>Mon, 04 May 2026 21:21:53 GMT</lastBuildDate><atom:link href="https://yuraware.com/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Dynamic colors on iOS]]></title><description><![CDATA[Visual Design on iOS: dynamic colors]]></description><link>https://yuraware.com/dynamic-colors-ios/</link><guid isPermaLink="false">5e97378ef4692d0833c19725</guid><category><![CDATA[iOS]]></category><category><![CDATA[iOS 13]]></category><category><![CDATA[UI]]></category><dc:creator><![CDATA[Yurii Kobets]]></dc:creator><pubDate>Tue, 05 Nov 2019 21:29:00 GMT</pubDate><content:encoded><![CDATA[<h3 id="dynamic-colors">Dynamic colors</h3><p>Dynamic colors are changing its content depending on the application appearance mode (Any (unspecified), Light or Dark). The API is available from iOS 13.</p><p>Apple provides colors out-of-the-box that are handy to use with default UI elements.</p><!--kg-card-begin: markdown--><table>
<thead>
<tr>
<th>Color</th>
<th>Area of usability</th>
<th>color API</th>
</tr>
</thead>
<tbody>
<tr>
<td>Label</td>
<td>text with a primary content</td>
<td>label</td>
</tr>
<tr>
<td>Secondary label</td>
<td>text with a secondary content</td>
<td>secondaryLabel</td>
</tr>
<tr>
<td>Link</td>
<td>link colors</td>
<td>link</td>
</tr>
</tbody>
</table>
<!--kg-card-end: markdown--><p>There are many colors with own system coding for labels, background, separators covering all basic UI needs but sometimes a developer needs to define a custom one. It can be done via Xcode assets:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://yuraware.com/content/images/2019/11/Assets.xcassets-2019-11-05-22-10-50.png" class="kg-image"><figcaption>Set image appearance&nbsp;</figcaption></figure><p>Or with <a href="https://developer.apple.com/documentation/uikit/uicolor/3238041-init">UIColor dynamic provider</a>:</p><!--kg-card-begin: markdown--><pre><code class="language-swift">var dynamicColor = UIColor.init { (traitCollection) -&gt; UIColor in
            return traitCollection.userInterfaceStyle == .dark ? .white : .black
        }
</code></pre>
<!--kg-card-end: markdown--><p>We can derive <code>userInterfaceStyle: UIUserInterfaceStyle</code> (any, light, dark) from <code>traitCollection: UITraitCollection</code> .</p><p><code><a href="https://developer.apple.com/documentation/uikit/uitraitcollection">UITraitCollection</a></code> describes the interface environment with a collection of traits (size classes, display scale, user interface style, user interface idiom, preferred content size etc). </p><p>From iOS 13 the trait collection has a <code>UITraitCollection.current</code> class member which defines a current UI environment. It's a thread-local variable so it's safe and fast-enough to use on any thread.</p><p>The dynamic color can be resolved with a specific trait collection.</p><!--kg-card-begin: markdown--><pre><code class="language-swift">dynamicColor.resolvedColor(with: UITraitCollection.current)
</code></pre>
<!--kg-card-end: markdown--><p>It's important to note that Core Animation objects: CALayer , CATextLayer , CAGradientLayer etc, NSAttributedText and <code>drawRect:</code> would not reflect change of the current trait collection and it's needed to be updated explicitly. </p><p>Each layer in a view hierarchy has adopted protocol <code>UITraitEnvironment</code> that presents UITraitCollection for: UIScreen, UIWindow, UIViewController, UIPresentationController, UIView.</p><p>Each layer can have overwritten property <code>preferredUserInterfaceStyle: UIUserInterfaceStyle</code> and a listener of UITraitEnvironment updates:</p><!--kg-card-begin: markdown--><pre><code class="language-swift">    override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
        if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) {
            // Resolve dynamic colors
            // Apply colors for Core Animation objects
        }
    }
</code></pre>
<!--kg-card-end: markdown--><p>It listens for a change of collection and gives a previous trait collection value to compare with and filter out only changes related to colors because there can be any trait change.</p>]]></content:encoded></item><item><title><![CDATA[Dark mode and visual system on iOS]]></title><description><![CDATA[Enable dark mode on iOS 13. How to use new visual design, interface modes, SF symbols, and dynamic colors]]></description><link>https://yuraware.com/dark-mode-ios/</link><guid isPermaLink="false">5e97378ef4692d0833c19721</guid><category><![CDATA[iOS]]></category><category><![CDATA[Xcode]]></category><category><![CDATA[iOS 13]]></category><dc:creator><![CDATA[Yurii Kobets]]></dc:creator><pubDate>Sun, 06 Oct 2019 13:57:00 GMT</pubDate><content:encoded><![CDATA[<p>With iOS 13 Apple updated Human Interface Guidelines by <a href="https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/dark-mode/">enhancing Visual design</a>. Apple added breakthrough changes: dark mode, more design tools, and styling options.<br> <br>Designers and developers have vast possibilities for creating rich user interface with different modes or themes (dark / light) along with the updated visual system. Apple introduces interface modes, system colors, dynamic system colors, images that support modes and much more. </p><p>Apple is always following own way in UI design. They provide a consistent approach for building interfaces while limiting modes or themes to two and giving they own tools: SF Symbols and system colors. All styles are defined in a consistent way with as least as possible ways to override the default behavior.</p><h2 id="dark-mode">Dark Mode</h2><p><br>iOS 13 enabled interface modes <code>dark</code> and <code>light</code> on the apps. The application should have implemented modes for all UI elements as <a href="https://developer.apple.com/documentation/appkit/supporting_dark_mode_in_your_interface/">Apple declares</a>. UI elements can alter its appearance based on system colors and settings.</p><p>You can still <strong>opt out</strong> the application interface mode by defining a property in the <code>Info.plist</code> file: <code>UIUserInterfaceStyle</code> which can have any of those values: </p><p>Table 1. Info.plist values for a user interface style</p><!--kg-card-begin: markdown--><table>
<thead>
<tr>
<th>Property value</th>
<th>UI trait</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Automatic</td>
<td>UIUserInterfaceStyle.unspecified</td>
<td>The app follows the system's interface style</td>
</tr>
<tr>
<td>Light</td>
<td>UIUserInterfaceStyle.light</td>
<td>The app is forced using light appearance</td>
</tr>
<tr>
<td>Dark</td>
<td>UIUserInterfaceStyle.dark</td>
<td>The app is forced using dark appearance</td>
</tr>
</tbody>
</table>
<!--kg-card-end: markdown--><p>You can find keys for <code>Info.plist</code> file here: <a href="https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW44">Information Property List Key Reference</a>.</p><p>In the settings of iOS 13, a user can define three appearance modes: <code>Light</code> , <code>Dark</code> , <code>Automatic</code> (with options Sunset to Sunrise - dark, else light).</p><figure class="kg-card kg-image-card"><img src="https://yuraware.com/content/images/2019/10/Untitled.png" class="kg-image"></figure><h2 id="override-a-window-view-or-view-controller">Override a window, view or view controller </h2><p>The separate view or view controller can have overridden a property <code><a href="https://developer.apple.com/documentation/uikit/uiview/3238086-overrideuserinterfacestyle">overrideUserInterfaceStyle</a></code> with a value from Table. 1</p><!--kg-card-begin: markdown--><pre><code class="language-swift">override func viewDidLoad() {
    super.viewDidLoad()

    overrideUserInterfaceStyle = .light
}
</code></pre>
<!--kg-card-end: markdown--><p>However, it is possible to set using one defined mode, Apple encourages using <code>Automatic</code> mode where appearance is the system one:</p><blockquote>Supporting Dark Mode is strongly encouraged. Use the UIUserInterfaceStyle key to opt out only temporarily while you work on improvements to your app's Dark Mode support.</blockquote><h2 id="system-colors">System Colors</h2><p>Apple introduces <a href="https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/color/">System Color</a> with iOS 13. </p><p>You can inspect it here <a href="https://developer.apple.com/documentation/uikit/uicolor/standard_colors">https://developer.apple.com/documentation/uikit/uicolor/standard_colors</a> </p><p>Colors  (<code>systemBlue</code>, <code>systemGreen</code>, <code>systemGray</code> etc) adapt to the mode changes (dark/light), vibrancy, accessibility settings (contrast, reduce transparency). Using system colors benefit your app in looking the same as iOS because these colors can slightly change in new iOS releases.</p><p>One example of using system colors on a <code>UITableView</code> with a custom cell.<br>To cover most colors with system styling you need simply choose default, system or custom colors. The simplest way is to use <code>Default</code> settings.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://yuraware.com/content/images/2019/10/Main.storyboard---Edited-2019-10-12-00-12-58.png" class="kg-image"><figcaption>Default color support, Xcode 11</figcaption></figure><p>You can define a color with 3 appearances: <br>Any - for systems without modes support<br>Dark and Light</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://yuraware.com/content/images/2019/10/Assets.xcassets-2019-10-12-00-30-36.png" class="kg-image"><figcaption>Define color appearances, Xcode 11</figcaption></figure><p>The same applies for images with modes and different image scales</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://yuraware.com/content/images/2019/10/Assets.xcassets---Edited-2019-10-12-00-33-52.png" class="kg-image"><figcaption>Define image appearances, Xcode 11</figcaption></figure><p>System colors got support of <a href="https://developer.apple.com/design/human-interface-guidelines/accessibility/overview/color-and-contrast/">high contrast</a>  (from iOS setting - Increase Contrast) and each system color adjusts with accessibility changes with four variants:</p><ul><li>Light</li><li>Light High Contrast</li><li>Dark</li><li>Dark High Contrast</li></ul><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://yuraware.com/content/images/2019/10/1-Color---Visual-Design---iOS---Human-Interface-Guidelines---Apple-Developer-2019-10-23-20-09-32.png" class="kg-image"><figcaption>Light / Dark, No increased contrast</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://yuraware.com/content/images/2019/10/Color---Visual-Design---iOS---Human-Interface-Guidelines---Apple-Developer-2019-10-23-20-16-07.png" class="kg-image"><figcaption>High contrast used</figcaption></figure><h2 id="dynamic-system-colors">Dynamic System Colors</h2><p>Another feature is Dynamic System Colors that provides semantically defined colors for different content types: labels, separators and fills.</p><p>Table 2. System color properties</p><!--kg-card-begin: markdown--><table>
<thead>
<tr>
<th>UIColor, class property</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>systemFill</td>
<td>An overlay fill color for thin and small shapes.</td>
</tr>
<tr>
<td>secondarySystemFill</td>
<td>An overlay fill color for medium-size shapes.</td>
</tr>
<tr>
<td>tertiarySystemFill</td>
<td>An overlay fill color for large shapes.</td>
</tr>
<tr>
<td>quaternarySystemFill</td>
<td>An overlay fill color for large areas that contain complex content.</td>
</tr>
</tbody>
</table>
<!--kg-card-end: markdown--><p>The similar for labels, fills (color filling different shapes), background colors, grouped content background, separators, link and text. Apple covered all standard UI elements.</p><h2 id="sf-symbols">SF Symbols</h2><p>The new thing in UI, a build-in library - <strong>SF Symbols</strong>. It is a set of icons available for iOS 13+, watchOS 6+ and tvOS 13+.</p><p>Symbols support font weights <code>UIFont.Weight</code> : <code>black</code>, <code>bold</code>, <code>heavy</code>, <code>light</code>, <code>medium</code>, <code>regular</code>, <code>semibold</code>, <code>thin</code>, <code>ultrathin</code> with scales: small, medium, and large.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://yuraware.com/content/images/2019/10/sf-symbols-scales-weights_2x.png" class="kg-image"><figcaption>Source: developer.apple.com</figcaption></figure><p>The symbols are <code>SVG</code> files which are vector and renders perfectly under any resolution. And using symbols as simple as images:<br><code>let image = UIImage(systemName: "multiply.circle.fill")</code><br>Additionally, you can configure symbol with a iOS 13 object <code><a href="https://developer.apple.com/documentation/uikit/uiimage/configuration">UIImage.Configuration</a></code> and <code><a href="https://developer.apple.com/documentation/uikit/uiimage/symbolconfiguration">UIImage.SymbolConfiguration</a></code></p><!--kg-card-begin: markdown--><pre><code class="language-swift">let configuration = UIImage.SymbolConfiguration(pointSize: 18, weight: .regular, scale: .medium)
let image = UIImage(systemName: &quot;multiply.circle.fill&quot;,
    withConfiguration: configuration)

</code></pre>
<!--kg-card-end: markdown--><p>The visual system and modes provide flexible and straightforward way to develop UI and application. iOS 13 brought the biggest design update for app developers. </p><p></p><h2 id="useful-links">Useful links</h2><p><a href="https://developer.apple.com/documentation/uikit/uiimage/creating_custom_symbol_images_for_your_app">Creating Custom Symbol Images for Your  App - SF symbols</a></p><p><a href="https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/dark-mode">Visual Design, Dark Mode</a></p><p><a href="https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/color/">Visual Design, Color</a></p><p><a href="https://developer.apple.com/documentation/appkit/supporting_dark_mode_in_your_interface/">Supporting Dark Mode in Your Interface</a></p><p><a href="https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW44">Information Property List Key Reference, UIUserInterfaceStyle</a></p><p><a href="https://developer.apple.com/documentation/uikit/uicolor/standard_colors ">UIColor, Standard Colors</a></p>]]></content:encoded></item><item><title><![CDATA[Protect mobile ads with app-ads.txt]]></title><description><![CDATA[The new technology for protecting mobile ads with app-ads.txt. Overview and setup in your apps and ad platforms]]></description><link>https://yuraware.com/mobile-ads-with-app-ads-txt/</link><guid isPermaLink="false">5e97378ef4692d0833c1971f</guid><category><![CDATA[ads]]></category><category><![CDATA[app development]]></category><dc:creator><![CDATA[Yurii Kobets]]></dc:creator><pubDate>Wed, 21 Aug 2019 22:14:03 GMT</pubDate><content:encoded><![CDATA[<p>Mobile app advertisement publishers now claim authorized rights and protect applications selling ads with a new format <code>app-ads.txt</code> . </p><p>It is a new specification available <a href="https://iabtechlab.com/wp-content/uploads/2019/03/app-ads.txt-v1.0-final-.pdf">here</a> and it was created by The IAB Technology Laboratory (a non-profit R&amp;D consortium)</p><p>It states a new concept of ads verification:</p><!--kg-card-begin: markdown--><blockquote>
<p>Authorized Sellers for Apps (app-ads.txt) is an extension to the Authorized Digital Sellers(ads.txt) standard, originally designed for protecting web ad inventory. It extends compatibility to support apps distributed through online app stores, linking app store listings to app developer websites.</p>
</blockquote>
<!--kg-card-end: markdown--><p>The apps selling ads (banners, video, interstitials etc) link their app identifiers with publishers (AdMob, MoPub) by providing <code>app-ads.txt</code> files available on the developer's domain.</p><p>The main goal is protecting app publishers from inventory spoofing, or serving ads in unauthorized copies of applications.</p><h3 id="how-it-works">How it works?</h3><p>An app publisher includes ads from ad provider (AdMob) with a publisher identifier. The Authorized seller verifier (in this case, it is ad platform - AdMob itself) is looking for the verification of legal source of the app install ( <code>bundle_id</code>- app identifier, <code>store_id</code> - App Store, Google Play, <code>storeurl</code> - url of the app store).<br><br>The verifier (AdMob or Google) crawls the page of the app in the application store<br>it finds the developer website (<a href="https://example.com/">https://example.com</a>) and searches for the <code>app-ads.txt</code> file with associated data -&gt; <a href="https://example.com/app-ads.txt">https://example.com/app-ads.txt</a><br></p><h3 id="the-guide-for-the-admob-users-">The guide for the AdMob users:</h3><ol><li>Go to <a href="https://apps.admob.com/v2/apps/appadstxt">https://apps.admob.com/v2/apps/appadstxt</a></li><li>How to set up APP-ADS.TXT</li></ol><figure class="kg-card kg-image-card"><img src="https://yuraware.com/content/images/2019/08/Google-AdMob-2019-08-22-00-50-16.png" class="kg-image"></figure><p>3. Copy your app-ads.txt file content</p><!--kg-card-begin: markdown--><p><code>google.com, pub-1234567891284567, DIRECT, f567c47fec123bb</code></p>
<!--kg-card-end: markdown--><p>It follows OpenRTB format (by IAB Tech Lab  <a href="https://iabtechlab.com/wp-content/uploads/2019/03/IAB-OpenRTB-Ads.txt-Public-Spec-1.0.2.pdf">source here</a>) with next fields:</p><p>Field #1 Domain name of the advertising system</p><p>Field #2 Publisher’s Account ID</p><p>Field #3 Type of Account/ Relationship</p><p>Field #4 Certification Authority ID</p><p>4. Save this file and put it to your developer's website listed on  App Store or Google Play.</p><p>On <a href="https://appstoreconnect.apple.com ">App Store Connect</a> it is Marketing URL on the app's page:</p><figure class="kg-card kg-image-card"><img src="https://yuraware.com/content/images/2019/08/app-marketing.png" class="kg-image"></figure><p>5. Get confirmation from the platform of reading your <code>app-ads.txt</code> file.</p><p>Note that you need to wait at least 24 hours while ad platform (AdMob, Google) would crawl your developer website.</p><figure class="kg-card kg-image-card"><img src="https://yuraware.com/content/images/2019/08/Google-AdMob-2019-08-22-01-06-14.png" class="kg-image"></figure><p>Now you have your ads up and running. The app publishers and seller verifiers (ad platform)  are in the deal. This is a guide of setup in AdMob because it is mostly used mobile ads platform and you can apply this format with any other providers.</p><p>You can read more on the IAB Tech Lab <a href="https://iabtechlab.com/ads-txt/">official website</a>.</p><h3 id="additional-data-">Additional data:</h3><p><a href="https://iabtechlab.com/wp-content/uploads/2019/03/app-ads.txt-v1.0-final-.pdf">IAB Tech Lab Authorized Sellers for Apps (app-ads.txt)</a><br><a href="https://iabtechlab.com/wp-content/uploads/2016/07/ADSTXT_OpenRTB_Transparency.pptx.pdf">OpenRTB – Addressing Counterfeit Inventory</a></p><p><a href="https://iabtechlab.com/wp-content/uploads/2019/03/IAB-OpenRTB-Ads.txt-Public-Spec-1.0.2.pdf">IAB Tech Lab ads.txt Specification Version 1.0.2</a></p>]]></content:encoded></item><item><title><![CDATA[Installing Flutter on macOS]]></title><description><![CDATA[Installation guide for Flutter and Dart language on macOS.]]></description><link>https://yuraware.com/flutter-installation/</link><guid isPermaLink="false">5e97378ef4692d0833c1971b</guid><category><![CDATA[flutter]]></category><category><![CDATA[macos]]></category><category><![CDATA[dart]]></category><dc:creator><![CDATA[Yurii Kobets]]></dc:creator><pubDate>Wed, 27 Mar 2019 16:10:00 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1471644778460-220908b75485?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1471644778460-220908b75485?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzczfQ" alt="Installing Flutter on macOS"><p><a href="https://flutter.dev/">Flutter</a> is the cross-platform framework for iOS and Android development.  It uses the <a href="https://www.dartlang.org/">Dart language</a>. The installation process involves few steps to run flutter on macOS. If you want install only the Dart you can go to the <strong>Installing Dart language </strong>part.</p><figure class="kg-card kg-image-card"><img src="https://yuraware.com/content/images/2019/03/Google-flutter-logo-1.png" class="kg-image" alt="Installing Flutter on macOS"></figure><h3 id="installing-flutter-on-macos">Installing Flutter on macOS</h3><p>Before installation make sure you have download Xcode or Android Studio. It depends what you want to use for the development. The official guide of installation macOS is <a href="https://flutter.dev/docs/get-started/install/macos">here</a>.</p><p>Here are several steps to install the Flutter:</p><p>1. Download the stable version of <a href="https://flutter.dev/docs/get-started/install/macos">Flutter</a></p><p>2. Make the folder where binaries would be located. You can use <code>development</code> folder</p><p><code>mkdir ~/development &amp;&amp; cd ~/development</code></p><p>3. Unzip folder:</p><p><code>unzip ~/Downloads/flutter_macos_v1.2.1-stable.zip</code></p><p>4. Update the path to enable <code>flutter</code> in the Terminal</p><p><code>export PATH="$PATH:pwd/flutter/bin"</code></p><p>To add this Flutter permanently to the path, go next:</p><p>4.1 For Bash</p><!--kg-card-begin: markdown--><p>Open or create <code>.bash_profile</code>:</p>
<pre><code class="language-bash">vi .bash_profile
</code></pre>
<!--kg-card-end: markdown--><p></p><!--kg-card-begin: markdown--><p>And change [PATH_TO_FLUTTER_GIT_DIRECTORY]to the path you've chosen, e.g. development folder:</p>
<pre><code class="language-bash">export PATH=&quot;$PATH:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin&quot;
</code></pre>
<!--kg-card-end: markdown--><p></p><!--kg-card-begin: markdown--><p>Example path:</p>
<pre><code class="language-bash">export PATH=&quot;$PATH:/Users/yuri/development/flutter/bin&quot;
</code></pre>
<!--kg-card-end: markdown--><p></p><!--kg-card-begin: markdown--><p>Refresh bash profile:</p>
<pre><code class="language-bash">source $HOME/.bash_profile
</code></pre>
<!--kg-card-end: markdown--><p></p><p>and finally, check it out with Terminal command <code>flutter</code></p><p>5. Run <code>flutter doctor</code> in the terminal to get the current installation status</p><p>It shows now the current situation with installation. You just need to follow the instructions.</p><figure class="kg-card kg-image-card"><img src="https://yuraware.com/content/images/2019/03/1._bash_flutter_data.png" class="kg-image" alt="Installing Flutter on macOS"></figure><p>The <code>brew</code> is needed to install the tools for simulator. You can download it <a href="https://brew.sh/">here</a>.</p><p>The <a href="https://visualstudio.microsoft.com/">Visual Studio Code</a> is the main IDE for Flutter along with the <a href="https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter">Dart extension</a>for enabling all cool features such as hot reload.</p><!--kg-card-begin: markdown--><p>After sorting out the iOS, Android, VS code setup you can check it again with:</p>
<pre><code class="language-bash">flutter doctor
</code></pre>
<!--kg-card-end: markdown--><p></p><p>So far the installation process involves quite few steps. But the good thing that the setup can be easily checked and Flutter itself produces code for many platform. So it is worth its installation time.</p><h3 id="installing-dart-language">Installing Dart language</h3><p>Flutter itself contains Dart environment so this is a part where you want install only Dart. So let's install and play with it. </p><!--kg-card-begin: markdown--><p>Installing the Dart language:</p>
<pre><code class="language-bash">brew tap dart-lang/dart
brew install dart
</code></pre>
<!--kg-card-end: markdown--><p></p><p>Then you can start access the Dart SDK via command line.</p><!--kg-card-begin: markdown--><p>Create a simple dart script using script.dart extension:</p>
<pre><code class="language-dart">void main() {
  for (int i = 0; i &lt; 5; i++) {
    print('hello, world ${i + 1}');
  }
}
</code></pre>
<!--kg-card-end: markdown--><p>Though Dart is not classical scripting language as Python, it can be used via the <a href="https://www.dartlang.org/tutorials/server/cmdline#running-an-app-with-the-standalone-dart-vm">command line</a>.</p><p>For accessing the arguments a programmer would need a <a href="https://pub.dartlang.org/packages/args">library</a> so it is not that handy.</p><figure class="kg-card kg-image-card"><img src="https://yuraware.com/content/images/2019/03/1._yuriikobetsadmins-mbp_Documentsdart_-zsh-_2019-03-19_13-15-18.png" class="kg-image" alt="Installing Flutter on macOS"></figure><p>The better approach to play with the language is <a href="https://dartpad.dartlang.org/">DartPad</a> . Where you can REPL read-eval-print loop over the code. It is a similar to Playgrounds on Xcode.</p>]]></content:encoded></item><item><title><![CDATA[React Native vs iOS and Android native development]]></title><description><![CDATA[Find out the benefits of using React Native over the native development. Comparison of frameworks with arguments.]]></description><link>https://yuraware.com/react-native-vs-native/</link><guid isPermaLink="false">5e97378ef4692d0833c19714</guid><category><![CDATA[react]]></category><category><![CDATA[react-native]]></category><dc:creator><![CDATA[Yurii Kobets]]></dc:creator><pubDate>Wed, 06 Mar 2019 19:49:59 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1527295110-5145f6b148d0?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=1080&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1527295110-5145f6b148d0?ixlib=rb-1.2.1&q=80&fm=jpg&crop=entropy&cs=tinysrgb&w=1080&fit=max&ixid=eyJhcHBfaWQiOjExNzczfQ" alt="React Native vs iOS and Android native development"><p>Cross-platform application development is one of the biggest issues when it comes to the creation and support of mobile applications. The cost of development is investment along with a support of the product. If iOS and Android applications share the code the business can cut the costs significantly. That's why there are many cross-platform frameworks. One of them is <a href="https://facebook.github.io/react-native/">React Native</a> (RN) open-sourced and developed by Facebook. At the moment it is one of the most performant, stable and developed tool.</p><p>In some cases, React Native is a reasonable investment in a technology and a product basis. The further analysis will reveal the pros and cons of the framework.</p><p><strong><em>Pros: Native and Cross-platform</em></strong></p><p>The first advantage is the cross-platform approach out-of-the-box. "Write once, run everywhere" (on iOS and Android and possibly Web). The web developers can quickly learn the framework especially with the knowledge of JavaScript and React. The contribution to the mobile project can increase significantly.</p><p>One layout system for iOS and Android - <a href="https://reactjs.org/docs/jsx-in-depth.html">JSX</a> and Flexbox (<a href="https://facebook.github.io/react-native/docs/flexbox">link</a>, <a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/">link</a>) let you develop a unified user interface for both platforms. It is much easy to read and maintain than native code. It supports styling straight-away and validates the JSX layout schema on the fly.</p><p><strong><em>Pros: Quick prototyping and a velocity of development</em></strong></p><p>You might be an iOS, Android dev or Web developer and know your platform and frameworks on the highest level. But this limits you only to the one platform.</p><p>The React Native provides one experience with the layout system and routing between screens or components. Doing the development in one unified layout system such as JSX increases velocity and add a coherent approach to support the app.</p><p>Any change developer makes rendered instantly with a help of <a href="https://facebook.github.io/react-native/docs/debugging.html">Hot reloading</a> (<a href="https://facebook.github.io/react-native/blog/2016/03/24/introducing-hot-reloading.html">another link</a>). In contrast with native development, you don't need to rebuild the project to see the changes to the styling or the business logic of the app. Though Android has Instant Run feature, it is limited to the one platform and should be maintained and setup but the React Native works just from the start.</p><p><strong><em>Pros: React Native has high performance</em></strong></p><p>Using RN allows you to create any kind of application with fully native experience. The cross-platform code is written on JavaScript or TypeScrint and platform specific parts can be done with Native Modules. A developer can call any iOS and Android API or create a custom UI with simple class creation.</p><p><a href="https://facebook.github.io/react-native/docs/native-modules-ios">Native Modules iOS</a>, <a href="https://facebook.github.io/react-native/docs/native-components-ios">Native UI components iOS</a>,</p><p><a href="https://facebook.github.io/react-native/docs/native-modules-android">Native Modules Android</a>, <a href="https://facebook.github.io/react-native/docs/native-components-android">Native UI Components Android</a>.</p><p>The React Native is a real native framework. It uses JavaScriptCore framework which is <a href="https://developer.apple.com/documentation/javascriptcore/jsvirtualmachine">thread-safe and</a> leverages the speed of execution by providing the multi-threaded environment. In contrast with WebView based frameworks such as Ionic or PhoneGap where all elements are rendered in the web view and blocking the main thread of the application.</p><p>And all developers know that nothing should block the main thread except UI rendering. The RN can provide the <a href="https://facebook.github.io/react-native/docs/performance">ideal rate of 60 FPM </a>(frames per second). Which is unbeatable by WebView rendering.</p><figure class="kg-card kg-image-card"><img src="https://yuraware.com/content/images/2019/03/React-Native-Architecture.png" class="kg-image" alt="React Native vs iOS and Android native development"></figure><p>The React Native internal architecture uses the JavaScriptCore and Native Modules. So the code written on JavaScript or TypeScript is translated to the native code with existing React Native components or <a href="https://facebook.github.io/react-native/docs/native-modules-ios">Native Modules.</a></p><p>As JavaScriptCore can execute code on the background threads this gives a boost to the performance and the application is almost the same performant as the native one.</p><p><strong>Pros/Cons: The learning curve is short and high in different cases.</strong></p><p>I would say React is a quite easy-to-learn framework with JSX, Flexbox if you are familiar with React web development in contrary with iOS SDK and Android where there a lot of different implementation cases and layout systems on iOS (e.g. XIB, Storyboard, and coded UI).</p><p>On the other hand, a developer would need to know the iOS and Android basics like an Xcode project structure or Gradle and Groovy for Android. This skill will be useful from time to time to setup the project, and a web developer can get a side help from a mobile developer or learn it with tutorials.</p><p><strong>Pros: the ease of development</strong></p><p>Since we have one entry point to the iOS and Android project and <a href="https://reactjs.org/docs/introducing-jsx.html">JSX</a> as the JavaScript syntax for UI layout it simplifies a developers job a lot. One tool for everything. And in some cases, the shared code can be more than 90 percent.</p><p>For example, the creation of the project is a quite simple process using NPM tooling. Assume that we want to create an app named ReactBasicApp.</p><p>First, install <a href="https://github.com/react-community/create-react-native-app">create-react-native-app</a> tool:</p><p><code>sudo npm install -g create-react-native-app</code></p><p>Then create a project:</p><p><code>create-react-native-app ReactBasicApp</code><br><code>cd ReactBasicApp</code><br><code>npm start</code></p><p>These commands have created two applications iOS and Android and the React app itself.</p><p>The first running  application is basically in one file App.js:</p><pre><code>
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';

export default class App extends React.Component {
  render() {
    return (
      	&lt;View&gt;
            &lt;Text&gt;
        	The react basic application
	        Hello, world!
            &lt;/Text&gt;
        &lt;/View&gt;
      
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});
</code></pre><p>The styles are created with <strong>StyleSheet</strong> and the whole screen is rendered in the <strong>render</strong> function. It is a most simplistic variant of the app but it shows that concept can be perceived with one look at the code.</p><p><strong>Pros: open-source by default</strong></p><p>The RN is fully open-sourced and supports the MIT license (<a href="https://github.com/facebook/react-native/blob/master/LICENSE">link</a>). It is supported by Facebook and implies a lot of factors for further development. The community can pick up the development of the framework. Being open-source from the start is the main reason for the good adoption. I personally using mostly open-source tools and if there are a couple of products the open-source is better because of open code and possible support of projects.</p><p><strong>Cons: too many configurations and dependencies</strong></p><p>Adding a library to the React Native project can be painful because it requires the support of both iOS, Android and React Native projects. It is three projects to setup and maintain.</p><p>For example iOS, the app will support Cocoapods for dependency management. These commands will install a library NPM library, iOS, and Android library and link it to the project:<br><code>npm install</code><br><code>react-native link</code></p><p>Most of the libraries have cross-dependancy and sometimes a developer needs to fix build issues linking additional dependent frameworks or fixing headers path.</p><p>This is a trade-off of shipping the app into the many platforms and once you setup a project with libraries you have everything running.</p><p><strong>Cons: too many tools.</strong></p><p>The cross-platform imply using native frameworks. So you need to know basics of iOS and/or Android development along with tooling such as Xcode and/or Android Studio, the build process, Google Store and Apple App Store submission, the Cocoapods for iOS and Gradle for Android. Too many things you can say. Yes, you're right. Whether you acquire the knowledge in process of development or you are already a mobile developer.</p><p><strong>Cons: Young community</strong></p><p>Te Facebook confirms its commitment towards React Native (<a href="https://facebook.github.io/react-native/blog/2018/06/14/state-of-react-native-2018">an article</a>). The RN is the quite a new technology. It requires time to answer, resolve issues on Github, follow the roadmap.<br>Some code and integration with native API would need to be written from the scratch in contrast with native development where most of the components are already written.</p><p>The growing pains are natural and it is already addressed by the community.</p><p><strong>Cons: unexpected issues</strong></p><p>When using React Native a developer would integrate a numerous number of JavaScript and native libraries. Some libraries are well sustained and some are new, there even fraudulent software which is not audited yet.<br>So awareness is a key to user React Native libraries. A developer can check the source code and the dependencies it brings. This practice can be applied to any other software platforms.</p><p><strong>Conclusion</strong></p><p>The implication of using young technologies would need additional time debugging or research on Github or StackOverflow community but it comes with a growth and maturing of the tool.</p><p>The React Native is a robust framework to build cross-platform applications. It can reduce development time and people resources. Basically, one developer does 2 applications and this is a real investment because a development process and support are very consuming expenses of businesses.]]&gt;&lt;/content:encoded&gt;</p>]]></content:encoded></item><item><title><![CDATA[Scalability and maintainability of applications]]></title><description><![CDATA[What is mobile scalability and maintainability?]]></description><link>https://yuraware.com/scalability-and-maintainability-of-applications/</link><guid isPermaLink="false">5e97378ef4692d0833c19723</guid><category><![CDATA[architecture]]></category><dc:creator><![CDATA[Yurii Kobets]]></dc:creator><pubDate>Sat, 23 Dec 2017 21:23:00 GMT</pubDate><media:content url="https://yuraware.com/content/images/2019/10/1_pAGVB0R6fqLfCRLAyN2T1w-1.png" medium="image"/><content:encoded><![CDATA[<img src="https://yuraware.com/content/images/2019/10/1_pAGVB0R6fqLfCRLAyN2T1w-1.png" alt="Scalability and maintainability of applications"><p>Applications are ubiquitous. People use mobile applications every day, even they are not installing it on the phone. The development of any piece of software requires a lot of resources, man-hours, coffee, and meetings.</p><p>Reliability, scalability, and maintainability are ways to secure your investments into the development counting each dollar spent. But how the architecture of the application and well-designed code differs from conversion, marketing or any product development? These factors influence a speed of development, fast iterations, and validations of features and prototypes and thus, directly improve conversion and e-commerce metrics.</p><p>In case of the app development, there can be a situation when stakeholders think about the app working on a handheld device as a small thing. And sometimes the support of application or maintainability is not considered as an aspect of requirements and implementation.</p><figure class="kg-card kg-image-card"><img src="https://yuraware.com/content/images/2019/10/1_pAGVB0R6fqLfCRLAyN2T1w.png" class="kg-image" alt="Scalability and maintainability of applications"></figure><p><strong><strong>What is mobile</strong> applications<strong> scalability and maintainability? </strong></strong>I see it in two dimensions: a <em><em>scale of the app usage</em></em> by handling any possible number of users, events, client-backend services, and scale <em><em>in the development (maintainability) </em></em>by allowing developer deliver fast and robust features with minimum interaction with the legacy code.</p><p>The scalability of the app refers to handling any number of connections from user side, backend API interaction, error-handling. The maintainability is a way to iterate on software product by adding a new feature of fixing bugs in an efficient way.</p><p>One of the definitions of legacy as the code is any code which was written in the past even a minute ago. The scalable approach or architecture ideally allows adding a new feature and changing existing ones with minimum efforts.</p><p>In my experience, all projects where maintainability and architecture were first-class citizens the changes to the codebase and adding a feature were the seamless process because the legacy was a minimum part and extensibility was a goal.</p><p>Note: there are many types of architectures, the present ones are working, the new ones will be better but every approach is suitable as long as it gives a room for scaling and maintainability.</p><p>The point of architecture is the definition of scalability in all stages of development whether it is a kickstart or support.</p><p><em><em>The code is an investment</em></em> and it is supposed to make a profit or be useful for non-profits needs. So knowledge of architectures is beneficial from the Return on investment side and the ability to extend, support, and modify is the key for successful software product.</p><p>The ability to iterate quickly on the product development is key part of the return of investments. By making an extensible architecture gives a way to produce product and receive feedback instantly.</p><p>So how we<em><em> invest in architecture</em></em>? Is there any way to secure our code for extensibility?</p><p>The first step is architecture becoming a contract between developers. No matter what architecture VIPER, MVC, MVVM since most developers of a project are working in the same coding architecture.</p><p>The example of maintainability lies in the basics of software architecture. One of the <a href="https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)" rel="noopener">SOLID rules</a> is <a href="https://en.wikipedia.org/wiki/SOLID_(object-oriented_design)" rel="noopener">Open/Close principle</a> states:</p><blockquote><em><em>Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification.</em></em></blockquote><p>One example is the <strong><strong><a href="https://github.com/android10/Android-CleanArchitecture">CLEAN architecture</a></strong></strong> for Android which gives basic rules of separation of responsibilities and boundaries for each level. Having boundaries and clear responsibilities among classes is always beneficial for scaling. It is widely used in Android development although I believe it is highly applicable to any other platform such iOS.</p><p>The example of CLEAN architecture:</p><p><em><em>Presentation layer: model view, presenters, controllers</em></em></p><p><em><em>UI layer: views</em></em></p><p><em><em>DB layer: repository or data access objects</em></em></p><p><em><em>Domain layer: use cases, business logic</em></em></p><p>An example of “clean” architecture is <a href="https://www.objc.io/issues/13-architecture/viper/">VIPER for iOS application</a>. As stated from the acronym:</p><blockquote><em><em>V: View layers that defines a user interface.</em></em><br><em><em>I: Interactor or Domain layer: use cases, business logic.</em></em><br><em><em>P: Presenter prepares views and processes user input or events. The analog: presentation layer or ModelView.</em></em><br><em><em>E: Entity. The same as CLEAN, it is the data layer</em></em><br><em><em>R: Routing manages navigation logic in the app.</em></em></blockquote><p>The reader can notice the very similar structure in layers of iOS and Android modules. They come from using the same <a href="https://www.amazon.com/Clean-Architecture-Craftsmans-Software-Structure/dp/0134494164">Clean architecture patterns</a>.</p><p>The architectures or the app modular structure can evolve as well with ongoing changes as changing DB layer from one pattern to another. And it is a natural way of iteration for refactoring. The persistence layer can have <a href="https://github.com/iluwatar/java-design-patterns/tree/master/dao" rel="noopener">Data Access Object</a> pattern changed to the <a href="https://github.com/iluwatar/java-design-patterns/tree/master/repository" rel="noopener">Repository</a>. In my opinion, it would be beneficial to the project when a product owner would participate in this type of change, no matter if it is technical or commercial one. The architecture is still a part of a product.</p><p>The key issue is opinions of roles and neglect of the maintainability from the management and product side. In some situations, the management wants a quick minimum viable product then realizing that extension takes a place. And some development fails but not being able to iterate fast.</p><p>The agile development starts with iteration and adapting to requirements and feedback from a customer or users from one hand, and being able to iterate with a given codebase from another.</p><p>Here comes some math. We can define a feature of the product as <em><em>b - </em></em>time needed for feature development, the sprint as a set of features <em><em>Σ b, where a ( a ≥ 1) </em></em>is a complexity factor, <em><em>t ( t ≥ 0 ) </em></em>is time for adjusting feature to the architecture<em><em>, </em></em>with next formulae:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://yuraware.com/content/images/2019/10/1_ogTDZTK8KC0JW-Zf6eqCBw.png" class="kg-image" alt="Scalability and maintainability of applications"><figcaption>Sprint planning, duration, time.</figcaption></figure><p></p><p>Using defined architecture with defined module structure helps to reduce a time for adjusting architecture to zero and set the complexity to the minimum. If we consider the most optimal variant where the architecture is well defined we have the next simplified definition:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://yuraware.com/content/images/2019/10/1_xQZ54Q8gWShGK469KFYL7A.png" class="kg-image" alt="Scalability and maintainability of applications"><figcaption>Sprint planning with minimum added complexity</figcaption></figure><p>So knowing how to iterate on a project adding modules with a minimum change of architecture helps to understand the development time and improve life in a planning perspective.</p><p>The conclusion here is simple. A team who want to iterate fast can use one bespoken architecture and use it until stakeholders feel it is enough for quick iterations. To simplify, each iteration has the number of features per sprint in the agile environment. When a team sticks to the architecture which fits current needs and gives enough room for iteration the process becomes easier.</p>]]></content:encoded></item></channel></rss>