<?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 61 on Medium]]></title>
        <description><![CDATA[Stories by 61 on Medium]]></description>
        <link>https://medium.com/@liuyi0922?source=rss-a3a8e92d26b4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*85WXqETeQ-vFvTSIzFqijA.jpeg</url>
            <title>Stories by 61 on Medium</title>
            <link>https://medium.com/@liuyi0922?source=rss-a3a8e92d26b4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 04:06:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@liuyi0922/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[Cocoa: Make a CurrencyX-like Window]]></title>
            <link>https://medium.com/get-schwifty/cocoa-make-a-currencyx-like-window-e563b2f5f180?source=rss-a3a8e92d26b4------2</link>
            <guid isPermaLink="false">https://medium.com/p/e563b2f5f180</guid>
            <category><![CDATA[cocoa]]></category>
            <category><![CDATA[mac-apps]]></category>
            <dc:creator><![CDATA[61]]></dc:creator>
            <pubDate>Mon, 04 Jul 2016 15:26:05 GMT</pubDate>
            <atom:updated>2016-07-04T15:32:39.064Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ayGQY9OYjO4hrI9shU931g.jpeg" /></figure><p>Feature of <a href="https://itunes.apple.com/us/app/currencyx/id1088564306?l=en&amp;mt=12">CurrencyX</a>-like window：</p><p>* No Title Bar</p><p>* Full Size Content</p><p>* Resizable Vertical Only</p><p>* Blur Effect</p><h3>No Title Bar</h3><p>Expected:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*-kE3Jgw3NcOO2ASkCCsPeQ.jpeg" /></figure><p>We can configure appearance of window using attribute inspector in storyboard, the first checkbox is <strong>Title Bar</strong>，if we uncheck it, our window will look like below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*96VVY50cFexRsvJQbxBrDw.jpeg" /></figure><p>The problem is, the default round corner and traffic lights are missing. Moreover, window is undraggable. That’s not what we want.</p><h4>NoTitleBarWindowController</h4><p>All we need can be easily achieved by inheriting <strong>NSWindowController.</strong></p><pre>import Cocoa<br>class NoTitleBarWindowController: NSWindowController {</pre><pre>override func windowDidLoad() {<br>        super.windowDidLoad()<br>    <br>        if let window = self.window {<br>            window.titleVisibility = .Hidden<br>            window.titlebarAppearsTransparent = true<br>        }<br>    }<br>}</pre><p>Then set <strong>NoTitleBarWindowController </strong>as the class of window controller in storyboard. We do two little things:</p><p>* Hide Title</p><p>* Set Title Bar Appears Transparent</p><h3>Full Size Content</h3><p>It’s a simple trick, all we need is select <strong>Full Size Content View </strong>in storyboard. The image below shows the difference of before and after.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*5eHNiPiyFMPnP6F9qPQo1w.jpeg" /></figure><h3>Resizable Vertical Only</h3><p>CurrencyX window has a fixed width while it’s height is resizable which enables as much entries of currency display within the window as our user want. We can implement fixed width by constraint the <em>max</em> and <em>min</em> value of width in content to be the same. Hence the cursor will be resize icon only if it hovers over window’s vertical edge.</p><p>Configure content size of window in size inspector of storyboard:</p><pre>Content Size<br> Width: 370 Height: 500<br>Max Content Size<br> Width: 370 Height: 9999<br>Min Content Size<br> Width: 370 Height: 200</pre><h3>Blur Effect</h3><p>Like iOS, Adding a blur effect is achieved by dragging a <strong>NSVisualEffectView </strong>as subview of content view controller’s view owned by window controller.</p><p>Final Result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HOpbBCf5UX1ea2e0UbCwpg.jpeg" /></figure><p>Compare to CurrencyX:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*vxopaLNuv3NemBKoPUCPKQ.jpeg" /></figure><h3>Source Code</h3><p><a href="https://github.com/SeedLabIO/CurrencyXLikeWindow">SeedLabIO/CurrencyXLikeWindow · GitHub</a></p><h3>ADs</h3><p><a href="https://itunes.apple.com/us/app/currencyx/id1088564306?l=en&amp;mt=12">CurrencyX</a> is a beautiful app designed for macOS, if this article is helpful you can buy it to support us. It’s available on <a href="https://itunes.apple.com/us/app/currencyx/id1088564306?l=en&amp;mt=12">App Store</a> for $0.99.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e563b2f5f180" width="1" height="1" alt=""><hr><p><a href="https://medium.com/get-schwifty/cocoa-make-a-currencyx-like-window-e563b2f5f180">Cocoa: Make a CurrencyX-like Window</a> was originally published in <a href="https://medium.com/get-schwifty">Get Schwifty</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>