<?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 Alper Kayabasi on Medium]]></title>
        <description><![CDATA[Stories by Alper Kayabasi on Medium]]></description>
        <link>https://medium.com/@alperkayabasi?source=rss-b940a5cac255------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FhydlKpHXowDId7YrnqKVg.jpeg</url>
            <title>Stories by Alper Kayabasi on Medium</title>
            <link>https://medium.com/@alperkayabasi?source=rss-b940a5cac255------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 13:32:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alperkayabasi/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[Creating a Binary Framework in iOS with Swift]]></title>
            <link>https://medium.com/verifykit/creating-a-binary-framework-in-ios-with-swift-29d1b4a03469?source=rss-b940a5cac255------2</link>
            <guid isPermaLink="false">https://medium.com/p/29d1b4a03469</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[framework]]></category>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[xcode]]></category>
            <dc:creator><![CDATA[Alper Kayabasi]]></dc:creator>
            <pubDate>Wed, 19 Aug 2020 11:14:56 GMT</pubDate>
            <atom:updated>2020-08-19T12:05:01.028Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dJjow20BfCPn5bh8211khw.png" /></figure><p>We all use a lot of frameworks in our daily development routine. We just type the magical word “import” and it’s all set. But what’s happening behind that import statement? How do you make it possible for your fellow developers to use your classes with just one line of code? Today, I’ll try to show you how to create a binary framework.</p><p>First, it’s better to understand the difference between framework and library, a subject that we commonly come across in iOS developer interviews.</p><ul><li>Library is a file that defines bunch of code; not part of your original target. A library can be dynamic (.dylib) or static (.a)<br>As you can understand from their names, static libraries are compiled once so the file size can be bigger.<br>Dynamic libraries, on the other hand, are loaded into memory when they are needed. This can be loadtime or runtime. All Apple system libraries are dynamic.</li><li>A framework is a package that contains resources like dynamic libraries, images, interface builder files, headers etc. It is basically a bundle that ends with .framework extension.<br>We will cover frameworks in this article.</li></ul><p>Let’s dive into Xcode and see how to create one.</p><p>First, we need to choose Xcode -&gt; New project -&gt; Framework.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ix_3Lf5qB818GiYCv6EzHw.png" /></figure><p>In this demo, we name our project <strong>VfkFrameworkDemo. </strong>It will be the name of our framework too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Z1h9u32Z9MIunJwWUahtQ.png" /></figure><p>After creating a new framework project, all we see in our bundle is a single .h file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*4H-MSAn5lnrNZ75k0ex5xA.png" /></figure><p>We can leave that .h file as it is, we won’t be needing it after.</p><p>Let’s create a new swift file, <strong>VfkFrameworkLogger.swift </strong><em>(filename doesn’t matter really)</em> and add the code below.</p><pre>import Foundation<br><br>public class VfkFrameworkDemo {<br><br>    public init() {<br>        debugPrint(&quot;VfkFrameworkDemo initialized.&quot;)<br>    }<br>}</pre><p>Important side note;<br>Classes and functions which will be used in integration must be marked as <strong>public</strong>.<br>You can still keep your internal classes; they won’t be available to developer who uses your framework.<br>You can still keep your internal classes; they won’t be available to the developer who uses your framework.<br>That’s the beauty of binary frameworks; people can use your code in background, but they can’t see what you don’t want them to see. Privacy matters.</p><p>If we select “Generic iOS Device” from device list and build project, we see a file named VfkFrameworkDemo.framework in Bundle, under Products folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vNm1VNg8aaBaASx4IJH4oA.png" /></figure><p>This is our first framework, now we can use it with drag and drop.<br>Well, that was simple. Are we done? Not quite.</p><p>The first problem we’ll encounter here is “build targets.” We built our framework for “Generic iOS Device”, that means our framework can only be used on real devices.<br>That’s a bummer. A lot of iOS developers use simulators. What should we do?</p><p>Let’s change our build target to “iPhone 8 simulator” and build again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KOoMr2DbMHK5RX1kMBEq9w.png" /></figure><p>We did it, now our framework can be used on a simulator. But wait…<br>We still need “real devices” too.</p><p>Fortunately, there is a way to combine these two frameworks and create a universal one which will work both on device and simulator.<br>This workaround is generally referred as “aggregate target” and it’s a simple way to create universal framework in Xcode, without the need of using Terminal. <em>(We can still use terminal for this process btw.)</em></p><p>Let’s create a new target with File -&gt; New -&gt; Target -&gt; Aggregate.<br>For the sake of understanding this process, we name our new target “Aggregate”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-462myB3L5sE7zh_wYPDBQ.png" /></figure><p>After creating our new target, we need to switch to “Aggregate”, go to “Build Phases”, and create a new “Run Script”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0p9xyBNx7OkIPiHHFAeXBw.png" /></figure><p>This is the code snippet we’ll use in the script.</p><pre>UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal<br><br># Make sure the output directory exists<br><br>mkdir -p &quot;${UNIVERSAL_OUTPUTFOLDER}&quot;<br><br># Step 2. Copy the framework structure (from iphoneos build) to the universal folder<br><br>cp -R &quot;${BUILD_DIR}/${CONFIGURATION}-iphoneos/VfkFrameworkDemo.framework&quot; &quot;${UNIVERSAL_OUTPUTFOLDER}/&quot;<br><br># Step 3. Copy Swift modules from iphonesimulator build (if it exists) to the copied framework directory<br><br>cp -R &quot;${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/VfkFrameworkDemo.framework/Modules/VfkFrameworkDemo.swiftmodule/.&quot; &quot;${UNIVERSAL_OUTPUTFOLDER}/VfkFrameworkDemo.framework/Modules/VfkFrameworkDemo.swiftmodule&quot;<br><br># Step 4. Create universal binary file using lipo and place the combined executable in the copied framework directory<br><br>lipo -create -output &quot;${UNIVERSAL_OUTPUTFOLDER}/VfkFrameworkDemo.framework/VfkFrameworkDemo&quot; &quot;${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/VfkFrameworkDemo.framework/VfkFrameworkDemo&quot; &quot;${BUILD_DIR}/${CONFIGURATION}-iphoneos/VfkFrameworkDemo.framework/VfkFrameworkDemo&quot;<br><br><br># Step 5. Convenience step to open the project&#39;s directory in Finder<br><br>open &quot;${UNIVERSAL_OUTPUTFOLDER}&quot;</pre><p>The process is simply explained in five steps.<br>First, we need to build our framework for both real device and simulator seperately. After that, the run script will combine these two frameworks into a one universal framework to rule them all.</p><ul><li>Choose VfkFrameworkDemo -&gt; Generic iOS Device and build.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CBekXpMBekWi8CTKoj3Baw.png" /></figure><ul><li>Choose VfkFrameworkDemo -&gt; iPhone 8 and build again.</li><li>Choose Aggregate -&gt; Generic iOS Device and build again.</li></ul><p>After these steps, Xcode (the run script) opens the finder and shows us our universal framework. This file can be used on both simulator and real devices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jyh2n34CwwG9iC4O5vxbzA.png" /></figure><p>Drag it into Desktop, we’ll use it in a couple of minutes.</p><p>Create a new Single-View Xcode project. We don’t need anything special, we just need a clean project to import our framework into.</p><ul><li>Drag <strong>VfkFrameworkDemo.framework</strong> into the bundle.</li><li>Go to project’s General settings, select <strong>Embed &amp; Sign</strong> from <strong>Frameworks, Libraries and Embedded Content</strong> menu.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AEh7PqlNrukFejCkHcQgxQ.png" /></figure><ul><li>This step is not important at this time but it must be done to use the framework on a real device.<br><em>PS: If you distribute your framework with Cocoapods, it takes care of that signing issue on its own.</em></li></ul><p>This is what our new project looks like.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eeXXQBkGGiwdXn-c1cEVNA.png" /></figure><ul><li>Open ViewController.swift and import <strong>VfkFrameworkDemo</strong></li><li>Add the framework’s init code into ViewDidLoad.</li></ul><pre>    override func viewDidLoad() {<br>        super.viewDidLoad()<br>        // Do any additional setup after loading the view.<br>        <br>        _ = VfkFrameworkDemo.init()<br>    }</pre><p>This is our ViewController.swift file. Now Build and Run the project and have a look at debug console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*74_eD28XRxO1Z1uhP2d1xA.png" /></figure><p>It worked! We just initialized our framework and used it from another project.</p><p>We didn’t see the framework’s code. We don’t know what happened in the background. With just a single line of code, the framework did its job −in this case, just a debug print− but it can be much more.</p><p>The <a href="https://swift.org/blog/abi-stability-and-more/">ABI Stability</a> came with Swift 5.1. That means a binary framework built with Xcode 10.2 or later can now be used on other Swift versions, too. Before that, a framework developer needed to build a new version of a framework for every Swift version. That was a real struggle but now it’s gone, kudos to Apple.</p><p>When creating VerifyKit, our development team came across with a strange bug. We can address this as <strong>“The corrupted .swiftinterface bug”</strong>.</p><p>We could use our framework on Macbook which built the .framework file without an issue, but when other developer tried to use it on another computer, Xcode gave the error <strong>“Failed to load module VfkFrameworkDemo”</strong><em>. (in our case, module name was VerifyKit)</em></p><p>We realized that Xcode created a corrupted .swiftinterface file and added our module name before every public class.<br>To fix this, you need to go framework’s folder in Terminal and run this line of code.</p><pre>find . -name &quot;*.swiftinterface&quot; -exec sed -i -e &#39;s/VfkFrameworkDemo\.//g&#39; {} \;</pre><p>This code snippet removes redundant module names <em>(you need to replace VfkFrameworkDemo with your framework module name)</em> in public class definitions, so everyone can use your framework.</p><p>I don’t know if this is a common bug but it gave us a real headache, so I wanted to add this as a side note.</p><p>That’s it, we just created a universal binary framework in Swift and used it from another project.<br>We did it with the classic drag&amp;drop, but there are other ways to distribute your framework, like Cocoapods or Carthage.</p><p>As you know, most common way to distribute your framework is Cocoapods. But unfortunately, it’s a subject for our another article.</p><p>Please feel free to comment if you have any questions.</p><p>Don’t forget to check <a href="https://verifykit.com/">VerifyKit</a> out!</p><p>Happy coding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29d1b4a03469" width="1" height="1" alt=""><hr><p><a href="https://medium.com/verifykit/creating-a-binary-framework-in-ios-with-swift-29d1b4a03469">Creating a Binary Framework in iOS with Swift</a> was originally published in <a href="https://medium.com/verifykit">VerifyKit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iOS UI Savaşları]]></title>
            <link>https://medium.com/teknasyon-engineering/ios-ui-sava%C5%9Flar%C4%B1-22aad57bcadc?source=rss-b940a5cac255------2</link>
            <guid isPermaLink="false">https://medium.com/p/22aad57bcadc</guid>
            <category><![CDATA[autolayout]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Alper Kayabasi]]></dc:creator>
            <pubDate>Wed, 27 Feb 2019 08:30:54 GMT</pubDate>
            <atom:updated>2019-03-05T11:36:45.717Z</atom:updated>
            <content:encoded><![CDATA[<h3>Xib vs Code / Constraints vs Frames</h3><p>Herkese merhaba. iOS yazılım dünyasında çok uzun yıllardır tartışılan, üzerine podcast’ler, canlı münazaralar yapılan bir konu; UI geliştirme. Bildiğiniz gibi UI geliştirmek için birden fazla yöntem var ve herkes kendine göre doğru olanı, daha rahat kullandığını tercih ediyor.</p><p>Öncelikle şununla başlayalım, Auto Layout nedir?<br>Auto Layout, Apple’ın farklı boyutlarda cihazlarını tanıttıktan sonra, bu cihazların hepsine birden tek bir kod/xib parçasıyla “responsive” bir UI oluşturmak için çıkardığı teknoloji. Eskiden ekranlar hazırlanırken -ki bu yöntem hala kullanılabiliyor- UI elementlerine frame set edilirdi. Auto Layout kullandığımızda ise frame yerine constraint set ediyoruz. Bu iki yöntemin farkını aşağıdaki görsellerde daha net anlayabiliriz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*iJuMusgBbGUnHC1tqzHtzg.png" /><figcaption>Frame Layout</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*oc6hTsPFx92SstovrrbUrQ.png" /><figcaption>Constriant Layout</figcaption></figure><p>Yukarıda gösterilmek istenen esasında şu; frame set ederken bir UI element’ine 4 adet parametre veriyoruz, ekranda bulunacağı X ve Y koordinatları, width ve height. Constaint yönetmini kullanırken ise koordinat vermek yerine ekranın köşelerine uzaklık veriyoruz, ana fark bu.</p><h3>Auto-Layout Döngüsü</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*c4rl1gyVynSVY8FnReCzgQ.png" /></figure><p>Yukarıdaki görselde de görebileceğiniz gibi, auto-layout döngüsü 3 adım barındırıyor. Update, Layout, Render. Şimdi kısaca bu adımlara göz gezdirelim.</p><h3>Adım 1: Update</h3><ul><li>Bu adımda, dıştan içe doğru bir hiyerarşide tüm view’lar için updateConstraints() fonksiyonu çağrılır.</li><li>setNeedsUpdateConstraints: Mevcut constraint’leri iptal eder ve bir sonraki döngü için bir update çağrısı zamanlar.</li><li>updateConstraintsIfNeeded: Eğer daha önceden zamanlanmış bir update çağrısı var ise updateConstraints() fonksiyonunu çağırır.</li><li>Bu adımda updateConstraints() fonksiyonunun “direkt” olarak çağrılması tavsiye edilmez.</li><li>Bu implementasyonun en sonunda super.updateConstraints() çağrısı yapılması gerekir.</li></ul><h3>Adım 2: Layout</h3><ul><li>Bu adımda, içten dışa doğru bir hiyerarşide tüm view’lar için layoutSubviews() fonksiyonu çağrılır.</li><li>Eğer manuel olarak frame hesaplama yapılacak ise, layoutSubviews() bunu yapmak için doğru yerdir.</li><li>setNeedsLayout + layoutIfNeeded -&gt; layoutSubviews çağrısı yapar.</li><li>Şayet layoutSubviews override edilecek ise, implementasyonun ilk adımı olarak super.layoutSubviews() çağrısı yapılması gerekir.</li><li>setNeedsLayout() veya setNeedsUpdateConstraint() fonksiyonlarının bu adımda çağrılması tavsiye edilmez. Benzer şekilde constraint’ler üzerinde değişiklik yapılması da uygun değildir, sonsuz döngü oluşturabilir.</li></ul><h3>Adım 3: Render</h3><ul><li>UIView, yapılacak bütün işlemleri CALayer’a aktarır.</li><li>drawRect() -&gt; Bütün çizim işleminin yapıldığı yerdir.</li><li>Eğer custom bir OpenGL ES, CoreGraphics veya UIKit işlemi yapılmıyor ise drawRect’in override edilmesine gerek yoktur.</li></ul><p>Bu bahsettiğimiz 3 adım View Controller’lar için de benzerdir.</p><ul><li>Update: updateViewConstraints</li><li>Layout: viewWillLayoutSubviews / viewDidLayoutSubviews</li></ul><p>Eğer manuel frame hesaplaması yapılacak ise bunun yapılması gereken yer viewDidLayoutSubviews metodudur.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*7_KMYK5uMMra3PkPCb8tzw.png" /><figcaption>Safe Area Layout Guide</figcaption></figure><p>Safe Area Layout Guide iOS 11 ile birlikte hayatımıza giren ve eski adıyla Top ve Bottom Layout Guide’ların yerini alan bir konsepttir. Asıl amacı iPhone X ile birlikte trend olan “çentik” boşluğunu düzgün şekilde yönetmektir. Eğer ekranın alt ve üst bölümünde (orientation’a göre sağ ve sol da olabilir) kalan alanları doğru şekilde hesaba katmak istiyorsak, UI element’lerimizi superview değil, Safe Area’ya göre hizalamak doğru olacaktır.</p><p>Yazının en başında da söylediğimiz gibi, iOS UI oluşturmada birden fazla seçenek mevcuttur. Yıllardır süren en hararetli tartışma ise şüphesiz “kod mu, xib mi” tartışmasıdır. Şimdi Interface Builder (Xib) veya Kod kullanmanın artılarını ve eksilerini listeleyelim.</p><h3>Interface Builder</h3><ul><li>Hızlıdır.</li><li>Yaptığımız şeyi anında görsel olarak görmemize olanak sağlar.</li><li>Projede daha az kod karmaşıklığı olur.</li><li>Yeniden kullanılabilir.</li><li>Dinamik içerik oluştururken en doğru seçim değildir.</li><li>Birden fazla yazılımcı aynı proje üzerinde çalıştığında problem yaratabilir.</li><li>“Bir sonraki yazılımcı” projenizi devraldığında adaptasyon süreci biraz daha sancılı olabilir.</li></ul><h3>Kod ile UI</h3><ul><li>Kod ile her zaman kontrol sizde olur. Elinizde olmayan hatalar ile karşılaşmazsınız.</li><li>Yeniden kullanılabilirliği çok yüksektir.</li><li>Birden fazla yazılımcı aynı projede çalıştığında adapte olması daha kolaydır.</li><li>Dinamik içerik oluşturmak için doğru seçimdir.</li><li>Debug etmesi kolaydır.</li><li>Ne yaptığınızı projeyi run edene kadar görsel olarak görme şansınız yoktur.</li><li>Daha çok kod yazarsınız. Doğru bir pattern kullanılmadığında Massive-View-Controller denilen sorun ile karşılaşabilirsiniz.</li><li>Aynı ekranı kod ile hazırlamak, IB ile hazırlamaktan daha yavaş olabilir.</li></ul><p>Apple artık tüm yazılımcılarının ekranları “Auto-Layout” kullanarak tasarlamalarını tavsiye ediyor. Fakat burada söylenmesi gereken, seçeceğimiz yöntemlerin hiç birinin bir diğerinden daha doğru olmadığıdır. Bu tamamen yazılımcının kendi tarzına, ekranın karmaşıklığına, en sonunda da kişisel tercihe kalır.</p><p>Ben, örnek projemizde aynı ekranı 3 farklı şekilde oluşturmayı göstereceğim. Herhangi birini diğerinden daha iyi veya daha kötü diye lanse etmeden karar vermeyi tamamen size bırakacağım. Göreceğimiz 3 yöntem şunlar;</p><p>1- Kod ve Auto-Layout(Anchors) kullanarak UI</p><p>2- Kod ve Frame kullanarak UI</p><p>3- XIB+AutoLayout kullanarak UI</p><p>Rahat anlaşılması için kolay olarak seçtiğim aynı ekranı bu farklı yöntemlerle oluşturduğum örnek projeyi aşağıdaki linkten indirip inceleyebilirsiniz. En sonunda da kendinize uygun olan yöntemi seçebilirsiniz.</p><p>Projede iOS 11 öncesi cihazlar için geliştirme yaparken SafeArea konusu nasıl yönetilir, bununla ilgili ufak bir extension bulunuyor. Bu tamamen benim kendi ihtiyaçlarım doğrultusunda oluşturduğum, iOS 11 öncesi ve sonrasında her seferinde #available kod bloğunu kullanmadan doğru değere ulaşmamızı sağlıyor. Dilerseniz kendi projelerinizde de kullanabilirsiniz.</p><pre>import Foundation<br>import UIKit</pre><pre>extension UIView {<br>    <br>    func addSubviewsUsingAutoLayout(_ views: UIView ...) {<br>        views.forEach {<br>            $0.translatesAutoresizingMaskIntoConstraints = false<br>            self.addSubview($0)<br>        }<br>    }<br>    <br>    // MARK: - Safe Area Anchors<br>    var safeTopAnchor: NSLayoutYAxisAnchor {<br>        if #available(iOS 11.0, *) {<br>            return self.safeAreaLayoutGuide.topAnchor<br>        } else {<br>            return self.topAnchor<br>        }<br>    }<br>    <br>    var safeBottomAnchor: NSLayoutYAxisAnchor {<br>        if #available(iOS 11.0, *) {<br>            return self.safeAreaLayoutGuide.bottomAnchor<br>        } else {<br>            return self.bottomAnchor<br>        }<br>    }<br>    <br>    var safeLeadingAnchor: NSLayoutXAxisAnchor {<br>        if #available(iOS 11.0, *) {<br>            return self.safeAreaLayoutGuide.leadingAnchor<br>        } else {<br>            return self.leadingAnchor<br>        }<br>    }<br>    <br>    var safeTrailingAnchor: NSLayoutXAxisAnchor {<br>        if #available(iOS 11.0, *) {<br>            return self.safeAreaLayoutGuide.trailingAnchor<br>        } else {<br>            return self.trailingAnchor<br>        }<br>    }<br>    <br>    var safeLeftAnchor: NSLayoutXAxisAnchor {<br>        if #available(iOS 11.0, *) {<br>            return self.safeAreaLayoutGuide.leftAnchor<br>        } else {<br>            return self.leftAnchor<br>        }<br>    }<br>    <br>    var safeRightAnchor: NSLayoutXAxisAnchor {<br>        if #available(iOS 11.0, *) {<br>            return self.safeAreaLayoutGuide.rightAnchor<br>        } else {<br>            return self.rightAnchor<br>        }<br>    }<br>    // Safe Area Anchors<br>    <br>    // MARK: - Safe Area Frames<br>    var sfTopY: CGFloat {<br>        if #available(iOS 11.0, *) {<br>            return self.safeAreaInsets.top<br>        } else {<br>            return 0<br>        }<br>    }<br>    <br>    var sfBottomY: CGFloat {<br>        if #available(iOS 11.0, *) {<br>            return self.frame.height-self.safeAreaInsets.bottom<br>        } else {<br>            return self.frame.height<br>        }<br>    }<br>    <br>    var sfLeftX: CGFloat {<br>        if #available(iOS 11.0, *) {<br>            return self.safeAreaInsets.left<br>        } else {<br>            return 0<br>        }<br>    }<br>    <br>    var sfRightX: CGFloat {<br>        if #available(iOS 11.0, *) {<br>            return self.frame.width-self.safeAreaInsets.right<br>        } else {<br>            return self.frame.width<br>        }<br>    }<br>    <br>    var sfHeight: CGFloat {<br>        if #available(iOS 11.0, *) {<br>            return self.frame.height-(self.safeAreaInsets.top+self.safeAreaInsets.bottom)<br>        } else {<br>            return self.frame.height<br>        }<br>    }<br>    <br>    var sfWidth: CGFloat {<br>        if #available(iOS 11.0, *) {<br>            return self.frame.width-(self.safeAreaInsets.left+self.safeAreaInsets.right)<br>        } else {<br>            return self.frame.width<br>        }<br>    }<br>    // Safe Area Frames<br>    <br>    // MARK: - Frame Endpoints<br>    var yOrigin: CGFloat {<br>        return self.frame.origin.y<br>    }<br>    <br>    var xOrigin: CGFloat {<br>        return self.frame.origin.x<br>    }<br>    <br>    var endY: CGFloat {<br>        return self.frame.origin.y+self.frame.size.height<br>    }<br>    <br>    var endX: CGFloat {<br>        return self.frame.origin.x+self.frame.size.width<br>    }<br>    // Frame Endpoints<br>}</pre><p>Bonus: Demo projede ayrıca “tek satır kod yazmadan” nasıl dinamik içerikli bir UIScrollView kullanılır bunu gösterdiğim bir örnek ekran da mevcut. Malum, iOS yazılım dünyası için scroll view’lar bazen oldukça baş ağrıtıcı olabiliyor, bu açıdan göz atmanızın size faydası olacaktır.</p><p><a href="http://git.pasifapp.com/alperkayabasi/ui-demo">Alper Kayabaşı / ui-demo</a></p><p>Herkese iyi kodlamalar.</p><p>Alper Kayabaşı</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22aad57bcadc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/teknasyon-engineering/ios-ui-sava%C5%9Flar%C4%B1-22aad57bcadc">iOS UI Savaşları</a> was originally published in <a href="https://medium.com/teknasyon-engineering">Teknasyon Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>