<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by ozgunergen on Medium]]></title>
        <description><![CDATA[Stories by ozgunergen on Medium]]></description>
        <link>https://medium.com/@oo-e?source=rss-d2e2d0d016fe------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uTVqbxaFoiY12LVXkcvsWg.jpeg</url>
            <title>Stories by ozgunergen on Medium</title>
            <link>https://medium.com/@oo-e?source=rss-d2e2d0d016fe------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 09:54:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@oo-e/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Easy Way Responsive Design Development in Flutter With VelocityX and ScreenUtil]]></title>
            <link>https://medium.com/kocsistem/easy-way-responsive-design-development-in-flutter-with-velocityx-and-screenutil-4a634c20a9cb?source=rss-d2e2d0d016fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/4a634c20a9cb</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[flutter-ui]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[ozgunergen]]></dc:creator>
            <pubDate>Thu, 17 Nov 2022 14:16:27 GMT</pubDate>
            <atom:updated>2022-11-23T08:33:00.767Z</atom:updated>
            <content:encoded><![CDATA[<p>Today, I will talk about responsive design development with flutter. Firstly we need two SDK for that <a href="https://pub.dev/packages/velocity_x">VelocityX</a> and <a href="https://pub.dev/packages/flutter_screenutil">Flutter_ScreenUtil</a>. These two SDK make our job easier.</p><p><strong>Why We Use Flutter_ScreenUtil</strong></p><p>We are using for adapting screen and font size with this SDK.</p><p>Example Usage</p><pre>    ScreenUtil().setWidth(540)  (dart sdk&gt;=2.6 : 540.w) //Adapted to screen width<br>    ScreenUtil().setHeight(200) (dart sdk&gt;=2.6 : 200.h) //Adapted to screen height , under normal circumstances, the height still uses x.w<br>    ScreenUtil().radius(200)    (dart sdk&gt;=2.6 : 200.r)    //Adapt according to the smaller of width or height<br>    ScreenUtil().setSp(24)      (dart sdk&gt;=2.6 : 24.sp) //Adapter font<br>    12.sm   //return min(12,12.sp)<br><br>    ScreenUtil().pixelRatio       //Device pixel density<br>    ScreenUtil().screenWidth   (dart sdk&gt;=2.6 : 1.sw)    //Device width<br>    ScreenUtil().screenHeight  (dart sdk&gt;=2.6 : 1.sh)    //Device height<br>    ScreenUtil().bottomBarHeight  //Bottom safe zone distance, suitable for buttons with full screen<br>    ScreenUtil().statusBarHeight  //Status bar height , Notch will be higher<br>    ScreenUtil().textScaleFactor  //System font scaling factor<br><br>    ScreenUtil().scaleWidth //The ratio of actual width to UI design<br>    ScreenUtil().scaleHeight //The ratio of actual height to UI design<br><br>    ScreenUtil().orientation  //Screen orientation<br>    0.2.sw  //0.2 times the screen width<br>    0.5.sh  //50% of screen height<br>    20.setVerticalSpacing  // SizedBox(height: 20 * scaleHeight)<br>    20.horizontalSpace  // SizedBox(height: 20 * scaleWidth)<br>    const RPadding.all(8)   // Padding.all(8.r) - take advantage of const key word<br>    EdgeInsets.all(10).w    //EdgeInsets.all(10.w)<br>    REdgeInsets.all(8)       // EdgeInsets.all(8.r)<br>    EdgeInsets.only(left:8,right:8).r // EdgeInsets.only(left:8.r,right:8.r).<br>    BoxConstraints(maxWidth: 100, minHeight: 100).w    //BoxConstraints(maxWidth: 100.w, minHeight: 100.w)<br>    Radius.circular(16).w          //Radius.circular(16.w)<br>    BorderRadius.all(Radius.circular(16)).w</pre><p>Mostly we will use it to set the width and height value on the screens as a percentage. (0.2.sw = 20 percent width, 0.5.sh = 50 percent hight )</p><p><strong>Why We Use VelocityX</strong></p><p>With this library, you can develop user interfaces in a fast, easy and fun way. There are 9 main topics in Velocity_x. İf you are an iOS developer, you will be very easy for you to adapt to this library.</p><ul><li>Customization</li><li>Layout (Mostly used)</li><li>Typography</li><li>Shapes</li><li>Responsive</li><li>SuperVx</li><li>Extension</li><li>StateManagement</li><li>Navigator</li></ul><p>Mostly I used Layout, Colors, Typography and same Extensions. Today I will tell you this titles.</p><blockquote><em>I am not using this SDK for State Management and Navigator. I think GetX is the best for that.</em></blockquote><p><a href="https://velocityx.dev/docs/colors"><strong>Colors</strong></a></p><p>VelocityX includes a generous palette of great-looking, well-balanced colors that are perfect for prototyping or for kicking off a brand new project.</p><p>Example Usage, you can find more color usage this <a href="https://velocityx.dev/docs/colors">url</a></p><pre><br>Vx.yellow<br>Vx.hexToColor(&quot;#FAFAFA&quot;);<br>Vx.blue900<br>Color myColor = Vx.randomColor;<br>Color myColor = Vx.randomPrimaryColor;<br>Color myColor = Vx.randomOpaqueColor;</pre><p><a href="https://velocityx.dev/docs/padding"><strong>Layout — Padding</strong></a></p><pre>.p0() padding: 0px; <br>.p1() padding: 1px; <br>.p2() padding: 2px; <br>.p4() padding: 4px; <br>.p8() padding: 8px; <br>.p12() padding: 12px; <br>.p16() padding: 16px; <br>.p20() padding: 20px; <br>.p24() padding: 24px; <br>.p32() padding: 32px; <br>.p64() padding: 64px; <br><br>Text().p(10) // It will give 10px paddings from all directions.<br>Text().pLTRB(1,2,3,4) // It will give 1px left, 2px top, 3px right, 4px bottom paddings.<br>Text().pOnly(left:8,top:16) //It will give 8px left and 16px top paddings.<br></pre><p><a href="https://velocityx.dev/docs/flex"><strong>Layout — Flex</strong></a></p><p>Mostly I have been used this part for developing user interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*RuxJ9FtTxtBNIiZVpXjAyQ.png" /><figcaption>Velocity_X Flex</figcaption></figure><pre>VStack(this.children, // should not be null<br>      {Key key,<br>      this.alignment = MainAxisAlignment.start,<br>      this.crossAlignment = CrossAxisAlignment.start,<br>      this.axisSize = MainAxisSize.min})<br>----------------------------------------------------------<br>VStack(<br>    [<br>        Text(&quot;VelocityX is Super&quot;),<br>        Text(&quot;Sample Text&quot;),<br>        Text(&quot;Yet, Another Sample Text&quot;),<br>    ],<br>).scrollVertical().p20();<br><br><br>const HStack(this.children, // should not be null<br>      {Key key,<br>      this.alignment = MainAxisAlignment.start,<br>      this.crossAlignment = CrossAxisAlignment.center,<br>      this.axisSize = MainAxisSize.min})<br>----------------------------------------------------------<br>HStack(<br>    [<br>        Text(&quot;VelocityX is Super&quot;).px12(),<br>        Text(&quot;Sample Text&quot;).px12(),<br>        Text(&quot;Yet, Another Sample Text&quot;).px12(),<br>    ],<br>).scrollHorizontal().p20();<br><br>---------------------------------------------------------<br>const ZStack(this.children, // should not be null<br>      {Key key,<br>      this.alignment = AlignmentDirectional.topStart,<br>      this.fit = StackFit.loose,<br>      this.overflow = Overflow.clip})<br><br>ZStack(<br>    [<br>        VxBox().blue500.height(110.0).width(110.0).make(),<br>        VxBox().green500.height(90.0).width(90.0).make(),<br>        VxBox().red500.height(70.0).width(70.0).make(),<br>    ],<br>    alignment: Alignment.center,<br>).p20();</pre><p>We will design a sample screen soon using them.</p><p><a href="https://velocityx.dev/docs/box">Layout-Box</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*cOt7RvJckGV7O86gSWubHg.png" /><figcaption>Velocity_X Box</figcaption></figure><pre>VxBox({this.child})<br>VxBox(child: Text(&quot;Hello&quot;).centered())<br>        .height(100)<br>        .width(100)<br>        .red500<br>        .make()<br>        .centered();</pre><p><a href="https://velocityx.dev/docs/scroll">Layout — Scroll</a><br>VxScrollVorizontal is a widget that can be used to create horizontal scroll behaviour in the application.</p><pre>const VxScrollVertical({<br>  Key key,<br>  this.controller,<br>  this.physics,<br>  this.padding,<br>  this.child,<br>}) : super(key: key)<br>----------------------------------------------------<br>VxScrollHorizontal(<br>      physics: AlwaysScrollableScrollPhysics(),<br>      child: &lt;Widget&gt;[<br>        &#39;First Text&#39;.text.make(),<br>        &#39;Second Text&#39;.text.make()<br>      ].hStack(),<br>    );<br>----------------------------------------------------<br>[<br>  &#39;First Text&#39;.text.make(),<br>  &#39;Second Text&#39;.text.make()<br>].hStack().scrollHorizontal()</pre><p>There are many functions in the library that support us. I couldn’t explain all of them. You can find more details on this page. Let’s design a sample interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-U6zfkLgUbOaIJT8YD-M2A.png" /><figcaption>Page 1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3kDzAZaVOBms6mc88xXYIQ.png" /></figure><p>Firstly we will create 4 function for the UI.</p><ul><li>leftSideWidget(),</li><li>navigationBarWidget()</li><li>MainWidget()</li><li>bottomBarWidget()</li></ul><p><strong>For Left Side Widget</strong></p><blockquote><em>I didn’t care about the use of themes to show the usage of the library. I used Vx.hexToColor()</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/252/1*NFN7DVPh915YucyA1u8EEQ.png" /></figure><pre>  Widget leftSideWidget(BuildContext context) {<br>    return VxBox(<br>      child: VStack(<br>        [<br>          Text(<br>            &quot;Code \nGeneration&quot;,<br>            style: TextStyle(<br>              fontSize: 16.sp,<br>              color: Vx.hexToColor(&quot;#4561D6&quot;),<br>            ),<br>          ).paddingOnly(left: 23, top: 28, right: 23, bottom: 28),<br>          Text(<br>            &quot;Version 1.0.0&quot;,<br>            style: TextStyle(<br>              fontSize: 12,<br>              fontFamily: &quot;Poppins&quot;,<br>              color: Vx.hexToColor(&quot;#939393&quot;),<br>            ),<br>          ).paddingOnly(left: 23, top: 0, right: 23, bottom: 0),<br>          const Image(<br>            image: AssetImage(&#39;assets/left_center_image.png&#39;),<br>          ).paddingOnly(left: 13, top: 56, right: 13, bottom: 0),<br>        ],<br>      ),<br>    ).width(0.3.sw).height(1.0.sh).make().box.hexColor(&quot;#F2F2F2&quot;).make();<br>  }</pre><p>The Width value is 30 percent of the screen, the Height value is 100 percent of the screen.</p><p><strong>For Top Navigation Bar widget</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*sP0M7n5M2iWR6wORWRAHvQ.png" /></figure><pre>Widget topNavigationWidget(BuildContext context) {<br>  var selectedCircleColor = Vx.hexToColor(&quot;#E0E2FD&quot;);<br>  var unSelectedCircleColor = const Color.fromRGBO(0, 0, 0, 0);<br>  var selectedTextColor = Vx.hexToColor(&quot;#3B61C0&quot;);<br>  var unSelectedTextcolor = Vx.hexToColor(&quot;#A0A0A0 &quot;);<br>  return HStack([<br>    Text(<br>      &quot;1&quot;,<br>      style: TextStyle(<br>          color: logic.selectedPage.value == 1<br>              ? selectedTextColor<br>              : unSelectedTextcolor),<br>    ).centered().circle(<br>        backgroundColor: logic.selectedPage.value == 1<br>            ? selectedCircleColor<br>            : unSelectedCircleColor,<br>        radius: 35),<br>    Text(&quot;2&quot;,<br>        style: TextStyle(<br>            color: logic.selectedPage.value == 2<br>                ? selectedTextColor<br>                : unSelectedTextcolor))<br>        .centered()<br>        .circle(<br>        backgroundColor: logic.selectedPage.value == 2<br>            ? selectedCircleColor<br>            : unSelectedCircleColor,<br>        radius: 35),<br>    Text(&quot;3&quot;,<br>        style: TextStyle(<br>            color: logic.selectedPage.value == 3<br>                ? selectedTextColor<br>                : unSelectedTextcolor))<br>        .centered()<br>        .circle(<br>        backgroundColor: logic.selectedPage.value == 3<br>            ? selectedCircleColor<br>            : unSelectedCircleColor,<br>        radius: 35),<br>  ], alignment: MainAxisAlignment.spaceAround)<br>      .paddingOnly(left: 0.2.sw, right: 0.2.sw)<br>      .w(1.0.sw)<br>      .h(64)<br>      .box<br>      .make();<br>}</pre><p><strong>For Bottom Bar Widget</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/950/1*dG3vyXsXFYHOotgvBvDIZA.png" /></figure><pre>HStack bottomBarWidgetForFirstPage() {<br>    return HStack([<br>      Spacer(),<br>      TextButton(<br>        style: ButtonStyle(<br>          foregroundColor: MaterialStateProperty.all&lt;Color&gt;(Colors.white),<br>          backgroundColor: MaterialStateProperty.all&lt;Color&gt;(<br>                       Vx.hexToColor(&quot;#4561D6&quot;),),<br>        ),<br>        onPressed: () {<br>          logic.selectedPage.value = 2;<br>        },<br>        child: HStack([<br>          Spacer(),<br>          Text(&#39;NEXT&#39;),<br>          Spacer(),<br>          Icon(Icons.arrow_forward).paddingOnly(right: 10)<br>        ]),<br>      ).w(190).h(60).paddingOnly(top: 15, right: 20)<br>    ]);<br>  }</pre><p><strong>For Main Page Widget</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*9RZxuACDX1eSRRiQ4QSbuA.png" /></figure><pre>Widget mainPageWidget() {<br>    return HStack([<br>      VStack([<br>        HStack([<br>          Image(image: AssetImage(&quot;assets/unselected_icon.png&quot;)).w(20).h(20),<br>          const Text(&quot;Localization-Swift&quot;,<br>                  style: TextStyle(<br>                      fontSize: 20,<br>                      fontWeight: FontWeight.bold,<br>                      color: Colors.white,<br>                      height: 1.0))<br>              .p(20),<br>        ]).onTap(() {<br>          //Do Something<br>        }).box.make(),<br><br>        HStack([<br>          Image(image: AssetImage(&quot;assets/selected_icon.png&quot;)).w(20).h(20),<br>          const Text(&quot;Networking-Swift&quot;,<br>              style: TextStyle(<br>                  fontSize: 20,<br>                  fontWeight: FontWeight.bold,<br>                  color: Colors.white,<br>                  height: 1.0))<br>              .p(20),<br>        ]).onTap(() {<br>          //Do Something<br>        }).box.make()<br><br>      ]).w(0.3.sw),<br>      VStack([]).w(0.3.sw)<br>    ]).centered();<br>  }</pre><p><strong>For Body widget</strong></p><p>We combine all our codes in this function and we have completed our visual interface.</p><pre>HStack bodyWidget(BuildContext context) {<br>    return HStack([<br>      leftSideWidget(context),<br>      VStack([<br>        topNavigationWidget(context),<br><br>         //For Line<br>         VxBox().width(0.7.sw).height(2).hexColor(&quot;#545355&quot;).make(), <br>        <br>        //Message <br>        const Text(&quot;Lorem Ipsum&quot;,<br>                  style: TextStyle(<br>                      fontSize: 20,<br>                      fontWeight: FontWeight.bold,<br>                      color: Colors.white))<br>              .p(20),<br>         const Text(<br>                  &quot;Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd&quot;,<br>                  style: TextStyle(<br>                      fontSize: 20,<br>                      fontWeight: FontWeight.normal,<br>                      color: Vx.hexToColor(&quot;#939393&quot;)))<br>              .paddingOnly(left: 20, right: 20),<br>       <br>         //For Main Widget, if you want to show other view by workflow, <br>        // only you must set widget this line<br>        VxBox(child: mainPageWidget()).width(0.7.sw).height(0.6.sh).make(),<br><br>        VxBox().width(0.7.sw).height(2).hexColor(&quot;#545355&quot;).make(),// For Line<br>       <br>        bottomButtonWidgetForFirstPage()<br><br>      ]).w(0.7.sw).h(1.0.sh).box.hexColor(&quot;#333235&quot;).make(),<br>    ]);<br>  }</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-U6zfkLgUbOaIJT8YD-M2A.png" /><figcaption>Result</figcaption></figure><p>Thank you for reading my article.</p><p><strong>Referance Link</strong></p><ul><li><a href="https://velocityx.dev/docs/install">VelocityX | VelocityX</a></li><li><a href="https://pub.dev/packages/flutter_screenutil">flutter_screenutil | Flutter package</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a634c20a9cb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kocsistem/easy-way-responsive-design-development-in-flutter-with-velocityx-and-screenutil-4a634c20a9cb">Easy Way Responsive Design Development in Flutter With VelocityX and ScreenUtil</a> was originally published in <a href="https://medium.com/kocsistem">KoçSistem</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iOS SonarQube Code Coverage Report With Slather]]></title>
            <link>https://oo-e.medium.com/ios-sonarqube-code-coverage-with-slather-2f4162562317?source=rss-d2e2d0d016fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f4162562317</guid>
            <category><![CDATA[sonarqube]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[koçsistem]]></category>
            <category><![CDATA[slather]]></category>
            <dc:creator><![CDATA[ozgunergen]]></dc:creator>
            <pubDate>Thu, 30 Jun 2022 07:16:43 GMT</pubDate>
            <atom:updated>2022-11-23T08:31:36.953Z</atom:updated>
            <content:encoded><![CDATA[<p>Today we talk about how can we send code coverage value to SonarQube with iOS projects.</p><p>Firstly I will tell Slather.</p><p>Slather is a generate test coverage reports tool for Xcode projects. Firstly we enable code coverage in our projects</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ff8GsUmWn75rq6ef.png" /><figcaption>Enable Code Coverage</figcaption></figure><p>We install slather our with this code. Copy and Paste this code in terminal</p><p>gem install slather</p><p>✤ We use this code for code coverage report generating.</p><blockquote>slather coverage --sonarqube-xml --scheme ProjectSchemeName ProjectFileName.xcodeproj</blockquote><p>✤ If we use Cocoapods and we work with xcworkspace file, we must use this code</p><blockquote>slather coverage --sonarqube-xml --scheme ProjectSchemeName --workspace ProjectFileName.xcworkspace ProjectFileName.xcodeproj</blockquote><p>✤ We can see our reports with html file. We can use this code</p><blockquote>slather coverage --html --scheme ProjectSchemeName ProjectFileName.xcodeproj</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o2hPaV9YSMDsMqLIPKnd7g.png" /><figcaption>open index.html</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FWr_3KvDidXqM0pDEL0Law.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XeImqnnY74T48BOEGJnEBg.png" /></figure><p>You can see all reports file in html folder.</p><p>✤ Sample SonarQube Properties</p><p>sonar.language=swift<br>sonar.profile=Sonar way<br>sonar.projectDescription= Project Description<br>sonar.swift.simulator=platform=iOS Simulator,name=iPhone 6s<br>sonar.swift.project=ProjectFileName.xcodeproj<br>sonar.swift.appScheme=ProjectSchemeName<br>sonar.swift.testScheme=ProjectTestScheme<br><strong>sonar.coverageReportPaths=report/sonarqube-generic-coverage.xml</strong><br>sonar.inclusions=**/*.swift<br><a href="http://sonar.branch.name/">sonar.branch.name</a>=master</p><p>You can see Coverage value in SonarQube</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/982/1*N-5pnwcTcu9Tqgib9n7dag.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f4162562317" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iOS Uygulamalarda Code Coverage Değerimizi Nasıl Yükseltiriz ? ]]></title>
            <link>https://medium.com/kocsistem/ios-uygulamalarda-code-coverage-de%C4%9Ferimizi-nas%C4%B1l-y%C3%BCkseltiriz-535940471bb1?source=rss-d2e2d0d016fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/535940471bb1</guid>
            <category><![CDATA[uitest]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ios-testing]]></category>
            <category><![CDATA[unittest]]></category>
            <dc:creator><![CDATA[ozgunergen]]></dc:creator>
            <pubDate>Tue, 29 Mar 2022 15:53:36 GMT</pubDate>
            <atom:updated>2022-03-30T07:09:52.877Z</atom:updated>
            <content:encoded><![CDATA[<h3>iOS Uygulamalarda Code Coverage Değerimizi Nasıl Yükseltiriz ? 🤔</h3><figure><img alt="iOS Code Coverage" src="https://cdn-images-1.medium.com/max/868/1*kprW156L2ps4Z4asqk8Bug.png" /></figure><p>Öncelikle geliştirdiğimiz, uygulamalarda ya da SDK lerde projenin bug oranını azaltmak ve daha sonra karşımıza geliştirme esnasında çıkabilecek sorunları daha kolay tespit etmemiz açısından Unit Test ve UI testler çok büyük önem taşımaktadır. Bu yazımızda Unit test &amp; UI test nasıl yazılır ? Code Coverage puanımız nasıl yukarı taşınır ?</p><h3>🌟 <strong>Code Coverage Nedir ve Nasıl Görürüz ?</strong></h3><p>Code Coverage, Bir yazılımın kod satırlarını kapsamlı bir şekilde analiz etmeye yardımcı olan ve yazılan test kodlarımızın başarılı bir şekilde doğrulanan kod satırlarının sayısını gösteren test metriğidir.</p><p>✤ Her gün büyüyen ve geliştirilen bir yazılım ürününde oluşabilecek hataların önceden tespit edilmesinde</p><p>✤ Kötü kodun Unit test ve UI test vasıtası ile ortaya çıkmasında ve markete çok daha hızlı version çıkmamızda yardımcı olur.</p><p>Code Coverage sayımızı yükseltilken dikkat etmemiz gereken bazı kriterler vardır. En az 1 kere kod içerisinde bulunan methodların çağrılması gerekir.</p><p>iOS projede code coverage değerimizi görmek için aşağıdaki adımları izlemeliyiz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/1*oSKyNTy4Uxzx11IwXbd5vg.png" /><figcaption>Edit Scheme</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y9cFL-mbjTmjvwHKtRuP9Q.png" /><figcaption>Code Coverage Özelliğini Açalım</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3mF3_MtGAPXYsHQFjotfgA.png" /><figcaption>iOS Test Hedeflerini Belirleyelim.</figcaption></figure><blockquote>Code Coverage alanını seçelim. Ve proje içerisindeki test modüllerini gösterelim.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*seRvOj2GTSi4ESksVw18Xw.png" /><figcaption>Build For Testing</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V_r5nyRm7ffVnmCxMpUpiw.png" /><figcaption>Sonuç Ekranı</figcaption></figure><blockquote>Daha sonra Test modunda projemizi çalıştırıp sonuçlara bakalım.</blockquote><h3>🌟 Unit Test</h3><p>Code Coverage değerimizi yükseltmek için en önemli kriterlerden bir tanesini Unit Test yazılmasıdır. Ekranlarımız içerisinde oluşan business logiclerin, Helper classlarımızın içide bulunan methodların, Backend sorguları, logic tabanlı işler için kullanırız.</p><p>Projemizde Unit Test sınıfına tıklayınca karşımıza aşağıdaki gibi bir görüntü gelmektedir, <strong>XCTest </strong>unit test yazabilmemiz için gereken classları ve methodları bize sunan SDK’dir.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/af1e1c260065cc95f0aa58bdbbe92bf6/href">https://medium.com/media/af1e1c260065cc95f0aa58bdbbe92bf6/href</a></iframe><pre>setUp() </pre><pre>setUpWithError() </pre><p>⁂ bu methodlar class içerisindeki her test methodlarının çağrılmadan önce çağrılan kurulum işlemlerinin yapıldığı methodlardır. Oluşturulan classların veya değişkenlerin başlangıç durumlarını belirlemenizde yardımcı olurlar.</p><pre>tearDown()</pre><pre>tearDownWithError()</pre><p>⁂ bu methodlar class içerisindeki test methodların çağrılması bittikten sonra çağrılan methodlardır. Test methodları tamamlandıktan sonra her hangi bir iş yaptırmak isterseniz bu method kullanılır.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9a7641b560feda563f9187004251e9f8/href">https://medium.com/media/9a7641b560feda563f9187004251e9f8/href</a></iframe><pre><strong>func</strong> testEmailValidation() <strong>throws</strong> {</pre><pre>XCTAssertTrue(Helper.isValidEmail(“test_email@gmail.com”), “Email Doğru Durum Testi”)</pre><pre>XCTAssertFalse(Helper.isValidEmail(“test_email@”), “Email Yanlış Durum Testi”)</pre><pre>}</pre><p><strong>XCAssertTrue(_ expression, message: String)</strong></p><p><strong>XCAssertFalse(_ expression, message: String)</strong></p><blockquote>methodları Boolean değer kontrolü yapmamıza sağlayan methodlardır. Bunlara benzer olarakta aşağıdaki methodlarda kullanılmaktadır.</blockquote><p><strong>XCTAssertNil(_ expression, message: String)</strong></p><p><strong>XCTAssertNotNil(_ expression, message: String)</strong></p><p><strong>XCTAssertEqual(_ expression, _ expression, message: String)</strong></p><p><strong>XCTAssertNotEqual(_ expression, _ expression, message: String)</strong></p><p><strong>XCTAssertGreaterThan(_ expression, _ expression, message: String)</strong></p><p><strong>XCTAssertGreaterThanOrEqual(_ expression, _ expression, message: String)</strong></p><p><strong>XCTAssertLessThan(_ expression, _ expression, message: String)</strong></p><p><strong>XCTAssertLessThanOrEqual(_ expression, _ expression, message: String)</strong></p><p><strong>XCTAssertThrowsError(_ expression)</strong></p><p><strong>XCTAssertNoThrow(_ expression)</strong></p><pre>XCTAssertEqual(Helper.isValidEmail(&quot;test_email@gmail.com&quot;), <strong>true</strong>, &quot;Email Doğru Durum Testi&quot;)</pre><pre><strong>func</strong> testExpectedFailure() <strong>throws</strong> {</pre><pre><strong>let</strong> thingThatFails: Bool = <strong>false</strong></pre><pre>XCTExpectFailure(&quot;Working on a fix for this problem.&quot;)</pre><pre>XCTAssertTrue(thingThatFails, &quot;This is not working right now.&quot;)</pre><pre>}</pre><p>✥ <strong>XCTExpectFailure(“Working on a fix for this problem.”) </strong>Bu method sayesinde test anında oluşabilecek hatalar da testinizin başarısız olmasını sağlamaz. İlgili methodda hata olduğunu size gösterir. Bu Methodu CI&amp;CD hatlarınızda testlerinizi çalıştırırken oluşan hataları önlemek için kullanabilirsiniz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uqklOsY0uoDAtNeozUZ_dw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a_7zVecLFOGEkeOYpw49JA.png" /></figure><p>✤ Asenkron testler yazarken <strong>self.expectation(description: String)</strong> ya da <strong>XCTestExpectation(description: String)</strong> methodlarını kullanırız.</p><p>✤ <strong>expectation.fulfill()</strong> methodunu işlem bittikten sonra çağırmazsak timeout süresi kadar bekler sonra test başarısız sonuçları. Bunu unutmamamız gerekmektedir.⚡</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aca534f9b93136350259d31698b7e98f/href">https://medium.com/media/aca534f9b93136350259d31698b7e98f/href</a></iframe><p>✤ Code coverage değerimizi yükseltmek için, network sorgulamızın bulunduğu classlar içinde yazmamız gerekmektedir, ancak servise sorgu atılması istenmediği durumlarda ise mock response dataları kullanarakta testlerimizi yazabiliriz. Bu durumu başka bir yazımda detaylı bir şekilde anlatacağım.</p><h3>🌟 UI Test</h3><p>Bu bölümde yazdığımız uygulamaların UI elementleri ile aksiyona geçerek sanki bir kullanıcı tarafından test ediyormuşunuz gibi aksiyonlar almamızı sağlayacaktır. UI Test bize ilgili ekranlarda sorun varsa onların tespitinde yardımcı olacaktır.</p><blockquote>Genelde UI Test yazarken uygulamada en önemli ekranları yazmaya öncelik veriyorum, mesela Login Ekranı, Kayıt Olma Ekranı, Uygulama içi satın alma olan ekranlar vb. Daha sonra diğer ekranlar için yazıyorum.</blockquote><p>Yukarda belirttiğim <strong>Unit Test</strong> alanındaki kodlarımız UI Test yazarkende kullanıyoruz, bunlarla birlikte UI elementleri yönetmemiz için <strong>XCUIApplication </strong>classını kullanıyoruz. Bu class uygulama yaşam döngüsünü, UI elementlerine erişmemizi, uygulamanın açılmasını, sonlandırılmasını, ve kapatılmasını sağlayan classtır. Aşağıda örneklerde inceleyelim.</p><figure><img alt="iOS UI Test Login" src="https://cdn-images-1.medium.com/max/180/1*Mmq1FtJtYSdOt6r7ScL1pQ.png" /><figcaption>iOS Uygulama Login Ekranı</figcaption></figure><p>Uygulamamızda böyle bir login ekranı olduğunu kabul edelim ve bu ekran için UI Test yazmaya başlayalım.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b6c389119123e1fbd23af5450410b4af/href">https://medium.com/media/b6c389119123e1fbd23af5450410b4af/href</a></iframe><p>UI Testimizi ilk açtığımızda karşımıza bu şekilde kodlar gelmektedir. <strong>testExample(), testLaunchPerformance()</strong> bu iki methodu silebiliriz. Kendimiz Login ekranı için yazalım.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/32bfcaed19c3329a356ab4953a044f19/href">https://medium.com/media/32bfcaed19c3329a356ab4953a044f19/href</a></iframe><p><strong>app.launch()</strong> uygulamamızı çalıştırmamızı sağlayan kod, bunu bütün testlerimize ekliyoruz ya da yukarıda <strong>setUIWithError()</strong> methodu içerisine de ekleyebiliriz.</p><p>app değişkeni sayesinde UI daki nesnelerimize erişmek, değer girmek, scroll yapmak veya dokunma gibi aksiyonları yapmamıza olanak sağlıyor. Bu sayede ekranlar da ilgili aksiyonlarımızı yaptırabiliyoruz.</p><p><strong>XCUIApplication </strong>classı bize <strong>launchArguments</strong>, <strong>launchEnvironment </strong>değerlerini sunmaktadır, Bunları testimizi çalışırken ekranlar içerisinde istediğimiz kurallara göre çalışmasını sağlayabiliyoruz. Benim bu örneğimde <strong>“-alwaysLogin”</strong> kısmında uygulama açılırken oturumu kapatmasını ve login ekranına yönlenmesini yaptım, sizde isterseniz Reklamları gizle veya göster gibi ekranlarınıza göre değerler verebilirsiniz.</p><pre>app.<strong>launchArguments</strong> = [&quot;<strong>-alwaysLogin</strong>&quot;]<br>app.<strong>launchEnvironment</strong> =[<br>      <strong>&quot;base_url&quot;</strong>: &quot;https://www.x.com/&quot;,<br>      <strong>&quot;inAppPurchasesEnabled&quot;</strong>: &quot;true&quot;,<br>      <strong>&quot;inAppAdsEnabled&quot;</strong>: &quot;true&quot; ]</pre><pre><strong><br>// Arguments kullanımı: Uygulama içerisindeki classlarınızda kullanırken</strong></pre><pre>#if DEBUG</pre><pre><strong>      if</strong> CommandLine.arguments.contains(“-alwaysLogin”) {</pre><pre><strong>          do</strong> {<br></pre><pre><strong>              try</strong> Amplify.Auth.signOut() <strong>//Oturumu kapattım, sizde burda istediğiniz işlemi yaptırabilirsiniz.</strong></pre><pre>            } catch(<strong>let</strong> error) {</pre><pre>            }</pre><pre>        }</pre><pre>#endif<br><strong>//Environment Kullanımı: Uygulama içerisindeki classlarınızda kullanırken</strong></pre><pre>var url = ProcessInfo.processInfo.environment[<strong>&quot;base_url&quot;</strong>]</pre><h3>🌟 XCUIElement</h3><p><strong>XCUIApplication </strong>classımız <strong>XCUIElement</strong> sınıfından miras almış bir classtır ve burada UI ile ilgili aksiyonlara erişmemizi sağlar. En çok kullanılanlardan bazıları;</p><p><strong>Seçilen bir UI elementinin var olup olmadığını kontrol ederken kullanıyoruz.</strong></p><pre><strong>open</strong> <strong>var</strong> exists: Bool { <strong>get</strong> }</pre><p><strong>Bir değer, uygulama açıldığında olmayabilir bunun kontrolünü yapmak ve bir süre bekletmek için bu kod kullanılır</strong></p><pre><strong>open</strong> <strong>func</strong> waitForExistence(timeout: TimeInterval) -&gt; Bool </pre><pre><strong>let</strong> apnsToken = app.staticTexts[&quot;apnsToken&quot;]<br>XCTAssert(apnsToken.<strong>waitForExistence</strong>(<strong>timeout: 7</strong>))</pre><p>Bir TextField, TextView ya da Button gibi elementler ile etkileşime geçmek için kullanılır.</p><pre><strong>open</strong> <strong>func</strong> tap()<br><strong>open</strong> <strong>func</strong> doubleTap()</pre><p>UI nesnelerine erişebilmek için kullanılan bazı değişkenler;</p><pre><strong>@NSCopying</strong> <strong>var</strong> textFields: XCUIElementQuery { <strong>get</strong> }<br><strong>@NSCopying</strong> <strong>var</strong> scrollViews: XCUIElementQuery { <strong>get</strong> }<br><strong>@NSCopying</strong> <strong>var</strong> switches: XCUIElementQuery { <strong>get</strong> }<br><strong>@NSCopying</strong> <strong>var</strong> toggles: XCUIElementQuery { <strong>get</strong> }<br><strong>@NSCopying</strong> <strong>var</strong> keyboards: XCUIElementQuery { <strong>get</strong> }<br><strong>@NSCopying</strong> <strong>var</strong> alerts: XCUIElementQuery { <strong>get</strong> }<br><strong>@NSCopying</strong> <strong>var</strong> tables: XCUIElementQuery { <strong>get</strong> }<br><strong>@NSCopying</strong> <strong>var</strong> buttons: XCUIElementQuery { <strong>get</strong> }<br><strong>@NSCopying</strong> <strong>var</strong> secureTextFields: XCUIElementQuery { <strong>get</strong> }</pre><pre>app.<strong>textFields</strong>[“Email”]<br>app.<strong>secureTextFields</strong>[&quot;Password&quot;]<br>app.<strong>buttons</strong>[&quot;Login&quot;]</pre><h3>⏺️ <strong>Record</strong></h3><p>UITest yazarken yukarda belirtilen bütün kodları illa bilmemiz ve o sıraya göre yazmamız gerekmez, XCode bize <strong>Record</strong> ederek de testlerimizi yazmaya olanak sağlıyor.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*selUyucA7-UFZMzGcgmhKg.png" /></figure><p>Son olarak UI Testlerimiz çalışırken XCode bu esnada her adım için otomatik olarak ekran görüntülerini alır, eğer testiniz başarısız olursa bunun görüntüsünü XCode üzerinden de görebilirsiniz.</p><p>Test başarı ile sonuçlanırsa resimleri otomatik olarak siler. Testlerimizin sonuçlarını ve Code Coverage puanımızı aşağıdaki ekran görüntülerinde görebiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OUpHcYtW9KYIATHS-ghegQ.png" /><figcaption>Test senaryolarının sonuçlarının listelendiği ekran</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dB7dlK9VeLRfr-Bm0oJRUQ.png" /><figcaption>Code Coverage Puanımız</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2mIknaM2Ukq_xUyQBk8l2g.png" /><figcaption>Testlerimiz çalıştığı ve hiç çalışmadığı kod satırları</figcaption></figure><p>Testlerimiz çalıştıktan sonra karşımıza böyle bir rapor çıkmaktadır. Bu rapor sonucunda uygulama geneli code coverage değerimiz ve ilgili ekranlardaki code coverage değerlerini görmekteyiz.🥳</p><p>En kısa zamanda tekrar görüşmek üzere 👋</p><h3><a href="https://emojipedia.org/page-facing-up/">📄</a> Kaynaklar</h3><p><a href="https://developer.apple.com/documentation/xctest">XCTest | Apple Developer Documentation</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=535940471bb1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kocsistem/ios-uygulamalarda-code-coverage-de%C4%9Ferimizi-nas%C4%B1l-y%C3%BCkseltiriz-535940471bb1">iOS Uygulamalarda Code Coverage Değerimizi Nasıl Yükseltiriz ? 🤔</a> was originally published in <a href="https://medium.com/kocsistem">KoçSistem</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[First Step to Swift UI Layout]]></title>
            <link>https://medium.com/kocsistem/first-step-to-swift-ui-layout-42daa60108d3?source=rss-d2e2d0d016fe------2</link>
            <guid isPermaLink="false">https://medium.com/p/42daa60108d3</guid>
            <category><![CDATA[layout]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[swiftui]]></category>
            <dc:creator><![CDATA[ozgunergen]]></dc:creator>
            <pubDate>Thu, 30 Sep 2021 12:22:49 GMT</pubDate>
            <atom:updated>2021-10-05T12:39:12.427Z</atom:updated>
            <content:encoded><![CDATA[<p>It is a powerfull language for Apple platform, it will helps for build apps across all Apple.</p><p>SwiftUI uses a declarative syntax, so you can simply state what your user interface should do. Your code is simpler and easier to read than ever before, saving you time and maintenance.</p><h3><strong>Stacks and Spacer</strong></h3><p>Stacks in SwiftUI are similar to the stack views in UIKit.There are 3 types of stacks: <strong>HStack</strong>, <strong>VStack</strong> and <strong>ZStack</strong>.</p><p><strong>HStack Usage &amp; Preview</strong></p><p>The <strong>HStack</strong> is used to stack views <strong>horizontally</strong>. Just like the VStack, you can set the alignment and space items.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d804f38833d13efb315eba9b800e8a77/href">https://medium.com/media/d804f38833d13efb315eba9b800e8a77/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/253/1*NtDe1gWrx0-mwyZWgCTwcg.png" /><figcaption>HStack Preview</figcaption></figure><p><strong>VStack Usage &amp; Preview</strong></p><p>The VStack allows you to stack views <strong>vertically</strong>, from top to bottom. You can further customize the view by adding alignment or spacing to the VStack.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/add0e47de4eaeb8d6cacdd3c59c6da05/href">https://medium.com/media/add0e47de4eaeb8d6cacdd3c59c6da05/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/251/1*wtf7kgvxDoXMqjh2EC6_pA.png" /><figcaption>VStack Preview</figcaption></figure><p><strong>ZStack Usage &amp; Preview</strong></p><p>The ZStack assigns each successive child view a higher z-axis value than the one before it, meaning later children appear “on top” of earlier ones. The ZStack uses an Alignment to set the x- and y-axis coordinates of each child, defaulting to a center alignment</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8a43069f20fc455a4bfc5662245f1d47/href">https://medium.com/media/8a43069f20fc455a4bfc5662245f1d47/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/242/1*Jt49-6yYl8H3_hufIobmng.png" /><figcaption>ZStack Preview</figcaption></figure><p><strong>Spacer Usage &amp; Preview</strong></p><p>A flexible space that expands along the major axis of its containing stack layout, or on both axes if not contained in a stack.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/539ab8dff504e67120da8cb5a8d62eed/href">https://medium.com/media/539ab8dff504e67120da8cb5a8d62eed/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/261/1*3Pmni6_y0NOp6frQw0yWig.png" /><figcaption>Spacer Preview</figcaption></figure><h3>Building Grid Layout with LazyVGrid and LazyHGrid</h3><p>SwiftUI provides developers two new UI components called <strong><em>LazyVGrid</em></strong> and <strong><em>LazyHGrid</em></strong>.</p><p>The word <em>Lazy</em>, as mentioned by Apple, refers that the grid view does not create items until they are needed. What this means to you is that the performance of these grid views are already optimized by default.</p><p><strong>LazyVGrid Usage &amp; Preview<br></strong>A container view that arranges its child views in a grid that grows vertically, creating items only as needed</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6b5fb82656b905e5f2a149ce24a9b364/href">https://medium.com/media/6b5fb82656b905e5f2a149ce24a9b364/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*LnpE61tBBys4fdOBV8t4JA.png" /><figcaption>LazyVGrid Preview</figcaption></figure><p><strong>LazyHGrid Usage &amp; Preview</strong></p><p>A container view that arranges its child views in a grid that grows horizontally, creating items only as needed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d660a36b0f7e0833eea70cece0d58d2a/href">https://medium.com/media/d660a36b0f7e0833eea70cece0d58d2a/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/229/1*Qb-Pf376Mbn2t2fVu901qg.png" /><figcaption>LazyHGrid Preview</figcaption></figure><p>Download source code</p><p><a href="https://github.com/OO-E/FristStepToSwiftUILayout">GitHub - OO-E/FristStepToSwiftUILayout</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42daa60108d3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/kocsistem/first-step-to-swift-ui-layout-42daa60108d3">First Step to Swift UI Layout</a> was originally published in <a href="https://medium.com/kocsistem">KoçSistem</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>