<?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 Arvin San Miguel on Medium]]></title>
        <description><![CDATA[Stories by Arvin San Miguel on Medium]]></description>
        <link>https://medium.com/@arb1nsnmgl?source=rss-f83a8d53f1f3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*W294-kyBPf0RGPrv.jpeg</url>
            <title>Stories by Arvin San Miguel on Medium</title>
            <link>https://medium.com/@arb1nsnmgl?source=rss-f83a8d53f1f3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 14:41:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@arb1nsnmgl/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[Playing with CAGradientLayer — Swift 3.0]]></title>
            <link>https://medium.com/@arb1nsnmgl/playing-with-cagradientlayer-swift-3-0-6230b00054be?source=rss-f83a8d53f1f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/6230b00054be</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Arvin San Miguel]]></dc:creator>
            <pubDate>Tue, 01 Nov 2016 03:31:10 GMT</pubDate>
            <atom:updated>2016-11-01T04:32:19.378Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fHwm0JjnUV5Q5mZUzqI8Qw.jpeg" /></figure><p>This blog is intended to show basic implementation of CAGradientLayer. 👌</p><h4><strong>What is CAGradientLayer?</strong></h4><p>CAGradientLayer is a subclass of the CALayer which is used to draw a color gradient that fills the shape of the layer (within the bounds of any rounded corners). It is one of the easiest layers to play with, since implementing it only takes a couple of lines to add a nice colorful effect in your UI.</p><h4>Implementing CAGradientLayer</h4><p>The most basic implementation of the gradient layer only needs two things:</p><ul><li>Array of colors ( Needs to be in CGColor since CAGradientLayer uses Core Graphics)</li><li>Size of the Frame of the gradient layer.</li></ul><p>But most probably, we wanted to control where our gradient color stops and where to start again.</p><p>Here’s a sample code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_uhrwTMPhKblWR1xyH4Hrw.png" /></figure><p>You can see in this sample code,</p><p>gradient.colors is an array of CGColor objects defining the color of each gradient stop.</p><p>gradient.startPoint &amp; gradient.endPoint defines where the gradient starts and ends with respect to the bounds of the layer’s coordinate space. (I always prefer to use CGFloat because it’s easier to estimate the location of the gradient).</p><p>Let’s take a look on the differences when playing with the startPoint and endPoint.</p><p>at startPoint(0,0) &amp; endPoint(1,0)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5xtSamaKMmkK4xjotpoGMw.png" /></figure><p>at startPoint(0,0) &amp; endPoint(0,1)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1f2esFHrKt0ZLCuxwDdPgg.png" /></figure><p>at startPoint(0.25,0.25) &amp; endPoint(1,1)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zdl7qXRs0_Jmfr_7EI9CUg.png" /></figure><p>at startPoint(0.75,0.75) &amp; endPoint(0,1)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pn-qR2ujzf6msK5L6vcifw.png" /></figure><h3>How about Animation?</h3><p>Of course! You can animate gradient layers by accessing their properties, In this example, I tried to play with the locations property and used two colors to have this scanner-like effect in my UIView.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*PiXwtaTees0hrWA51avMBw.png" /></figure><p>And here’s the output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*K9CBmXxcqJ4zGmVBVT86Zw.gif" /></figure><p>Hope you can apply it in your awesome apps! 🙌</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*UzsOow_iftf0YlqTrkz0GA.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6230b00054be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[iCarousel Walkthrough — Swift 3.0]]></title>
            <link>https://medium.com/@arb1nsnmgl/icarousel-walkthrough-swift-3-0-887554155242?source=rss-f83a8d53f1f3------2</link>
            <guid isPermaLink="false">https://medium.com/p/887554155242</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[flatiron-school]]></category>
            <dc:creator><![CDATA[Arvin San Miguel]]></dc:creator>
            <pubDate>Thu, 13 Oct 2016 05:00:03 GMT</pubDate>
            <atom:updated>2016-10-13T14:08:51.485Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What is a Carousel?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6xHhRIc3NDRNJlHSIzahWg.png" /></figure><p>The idea of this framework is to move and present data in an impressive and fluid way.</p><p>— Big shoutout to <strong><em>nicklockwood </em></strong>of GitHub<strong><em>.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*w6qxD6YK7w-ZIyvGqAbPMw.png" /></figure><p>Let’s get started.</p><ol><li>Clone the iCarousel file provided on the github link and save it to your desktop.</li></ol><p><a href="https://github.com/nicklockwood/iCarousel">nicklockwood/iCarousel</a></p><p>2. Create a new XCode project &gt; Single View Application.</p><p>3. From the downloaded iCarousel file, copy and paste iCarousel.h and iCarousel.m to your project. Make sure to click “Create bridging header”, this will automatically configure a bridging to enable classes to be accessed by both languages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*1LsJb46ZwdJ9eKsiWDUohA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*xmkAw-AZnF5kTRd9_TnOpA.png" /></figure><p>4. In the &lt;nameOfYourProject&gt;-Bridging-Header.h file, we need to type</p><p>#import &quot;iCarousel.h&quot;</p><p>This will allow us to use all files in the iCarousel framework.</p><p>5. In order to use the iCarousel framework, we need to add QuartzCore.framework in the Build Phases &gt; Link Binary with Libraries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*M1hHh5BrCsb8li4ZAqbYcA.png" /></figure><p>Now that all files were setup. We can now proceed to code and setup our storyboard. The way to setup iCarousel programmatically is almost the same as TableViews and CollectionViews.</p><p>6. Go to your storyboard. In the View Controller scene, select View and change the custom class in the Identity Inspector and set it to iCarousel.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*4sg07Xw_KlOSbgn1jbPrqw.png" /></figure><p>7. Open the assistant editor. We need to make an IBOutlet connection from our Carousel view to our View Controller.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*587KlmqUmRXvB7g9BlcTtA.png" /></figure><p>8. Like on how we setup our TableViews and CollectionViews, we need to set the delegateand dataSource on both ViewController file and storyboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bVlS57vzB7sMQdlWRO1raA.png" /></figure><p>9. Since we stated that our ViewController has a protocol of iCarouselDataSource. We need to conform to these protocol in which we need to perform these functions in our ViewController.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UDjbOcuOjpIYuq1-06KykQ.png" /></figure><p>10. In my sample code, I wanted the carousel to display images of dogs. Let’s proceed and see how the code works.</p><p>Create an empty array that will hold the images of dogs.</p><p>var images = [UIImage]()</p><p>11. Call the functions carousel(viewForIndexAt:reusing:), numberOfItems(in:) and carousel(valueFor:withDefault:) in order to conform to our iCarouselDataSource protocol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tPbteaIQW4rhBg-PYVoAGQ.png" /></figure><p>The numberOfItems(in:) returns the count of the images in the array.</p><p>In carousel(viewForItemAt:reusing:), this functions requires us to return a UIView but what we want is to put an image to it, so what we can do is to insert another frame of type UIImageView on top of it and return the UIView once we are done inserting the images.</p><p>The function carousel(valueFor:withDefault:) is an optional method that you can call, this method allows you to edit the spacing, angle, title etc. of the UIView. In this case, we only touched the spacing.</p><p>12. Initialize the images array and filled it with the data that you want to present.</p><p>13. Lastly, and the coolest part. In the viewDidLoad(), call on the outlet that we connected to our View Controller.</p><p>carouselView.reloadData()</p><p>carouselView.type = .timeMachine</p><p>(this is an enum, so you can try to explore the different animation behind it)</p><p>Run the app! 🏃🏻</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/328/1*k0sj6meHmGu__FYClXTg-A.gif" /></figure><p>Hope you find this tutorial blog to be helpful and probably useful on your future apps. Happy coding! 👌</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*RFO6tHLJ-vj-59NAfp1LKQ.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=887554155242" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>