<?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 Vlad Liubov on Medium]]></title>
        <description><![CDATA[Stories by Vlad Liubov on Medium]]></description>
        <link>https://medium.com/@vladliubov?source=rss-806e9e162aec------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*RGYOp7FnYJSZ_S8K3SIrtQ.jpeg</url>
            <title>Stories by Vlad Liubov on Medium</title>
            <link>https://medium.com/@vladliubov?source=rss-806e9e162aec------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 04:38:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vladliubov/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[Trello integration: how to create a card and send a photo || Swift]]></title>
            <link>https://medium.com/@vladliubov/trello-integration-how-to-create-a-card-and-send-a-photo-swift-15fce36ff054?source=rss-806e9e162aec------2</link>
            <guid isPermaLink="false">https://medium.com/p/15fce36ff054</guid>
            <category><![CDATA[trello]]></category>
            <category><![CDATA[swift-tutorial]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Vlad Liubov]]></dc:creator>
            <pubDate>Sat, 12 Nov 2022 17:24:25 GMT</pubDate>
            <atom:updated>2022-11-12T17:24:25.019Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*flZsc5cHxwG3dAduVdwpsA.png" /><figcaption>Final result</figcaption></figure><p>To successfully send a photo in Trello, you need three things: a personal <strong>token</strong>, an <strong>API key </strong>and a <strong>board id</strong>:</p><ul><li>you can create your personal token and API key by <a href="https://trello.com/app-key">clicking here</a></li><li>to find out the id of the board on which the card will be created, you need: g<em>o to your Trello Board → Add “.json” to the end of the URL → Format the JSON so it’s readable (you can find a JSON viewer online) → Search for idBoard — this will list your full Board ID</em></li></ul><p>Create a new project and open the file ‘ViewController’. At the beginning of this file we add our created values:</p><pre><strong>import</strong> UIKit</pre><pre><strong>class</strong> ViewController: UIViewController {</pre><pre><strong>static</strong> <strong>let</strong> token = &quot;your token here&quot;<br><strong>static</strong> <strong>let</strong> api = &quot;your API key here&quot;<br><strong>static</strong> <strong>let</strong> boardId = &quot;your board id here&quot;</pre><p>Once this step is done we can move on.</p><p>Before sending the photo itself, we need to create a card on this board. For this we create a function createCard():</p><pre>func createCard() {<br><br>let url = URL(string: &quot;<a href="https://api.trello.com/1/cards?idList=\(ViewController.boardId)&amp;key=\(ViewController.api)&amp;token=\(ViewController.token)&amp;">https://api.trello.com/1/cards?idList=\(ViewController.boardId)&amp;key=\(ViewController.api)&amp;token=\(ViewController.token)&amp;</a>&quot;)!</pre><pre>let body: [String: Any] = [&quot;name&quot;: &quot;Some Photo&quot;,<br>                           &quot;desc&quot;: &quot;About my photo&quot;]</pre><pre>let finalBody = try! JSONSerialization.data(withJSONObject: body)</pre><pre>var request = URLRequest(url: url)<br>        request.httpMethod = &quot;POST&quot;<br>        request.httpBody = finalBody<br>        request.setValue(&quot;application/json&quot;, forHTTPHeaderField: &quot;Content-Type&quot;)</pre><pre>URLSession.shared.dataTask(with: request) { (data, response, error) in<br>       if let data = data {<br>            do {<br>            let json = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any]<br>          if let idCard = json?[&quot;id&quot;] as? String {<br>            self.uploadPhotoToCard(idCard: idCard)<br>            }<br>          } catch {<br>             print(error.localizedDescription)<br>            }<br>         }<br>      }<br>   .resume()<br>}</pre><ol><li>At the beginning of our function, after the URL, we create a body with two values: “name” — the name of the card and “desc” — any description. A more detailed description of what else you can add can be read <a href="https://developer.atlassian.com/cloud/trello/rest/api-group-actions/">in the official documentation</a></li><li>If the sending was successful, we would be able to extract the id of the card from the data —<em> let idCard = json?[“id”] as? String</em></li><li>After we got the card id, we create a function <em>uploadPhotoToCard(idCard: String</em>):</li></ol><pre>func uploadPhotoToCard(idCard: String) {</pre><pre>        let url = URL(string: &quot;<a href="https://api.trello.com/1/cards//(idCard)/attachments?key=\(ViewController.api)&amp;token=\(ViewController.token)&amp;">https://api.trello.com/1/cards/\(idCard)/attachments?key=\(ViewController.api)&amp;token=\(ViewController.token)&amp;</a>&quot;)!</pre><pre>        let somePhotoUrl = &quot;<a href="https://digilandia.io/wp-content/uploads/2020/06/Como-usar-o-Trello.jpg">https://digilandia.io/wp-content/uploads/2020/06/Como-usar-o-Trello.jpg</a>&quot;<br>        <br>        let body: [String: Any] = [&quot;url&quot;: somePhotoUrl]<br>        let finalBody = try! JSONSerialization.data(withJSONObject: body)<br>        <br>        var request = URLRequest(url: url)<br>        request.httpMethod = &quot;POST&quot;<br>        request.httpBody = finalBody<br>        request.setValue(&quot;application/json&quot;, forHTTPHeaderField: &quot;Content-Type&quot;)<br>        <br>        URLSession.shared.dataTask(with: request) { (data, response, error) in<br>        if let data = data {<br>           do {<br>       _ = try JSONSerialization.jsonObject(with: data, options: [])<br>            } catch {<br>               print(error.localizedDescription)<br>            }<br>        }<br>     }<br>   .resume()<br> }</pre><p>For example, I took the random address of the photo and added a URL to <em>let somePhotoUrl.</em></p><p>It remains only to add a function <strong>createCard()</strong> to <strong>viewDidLoad</strong> and run the application. After that, your photo will be published on Trello!</p><p>What does the whole code look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vYeGZn_He0Otibr7KD-_fw.png" /></figure><p>Good luck:)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15fce36ff054" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple way to create Picker Segment Controller using enum || SwiftUI]]></title>
            <link>https://medium.com/@vladliubov/simple-way-create-in-swiftui-picker-segment-controller-use-enum-a917ab565330?source=rss-806e9e162aec------2</link>
            <guid isPermaLink="false">https://medium.com/p/a917ab565330</guid>
            <category><![CDATA[pickers]]></category>
            <category><![CDATA[swiftui]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Vlad Liubov]]></dc:creator>
            <pubDate>Sat, 29 Oct 2022 19:55:57 GMT</pubDate>
            <atom:updated>2022-11-02T17:19:28.045Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QyTzOuGfeSmCdfOu" /><figcaption>Photo by <a href="https://unsplash.com/@belperunitarians?utm_source=medium&amp;utm_medium=referral">Belper Unitarians</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>To get started, create a project with interface based on SwiftUI and go to ContentView()</p><p>Let’s first introduce an enum with two names.</p><pre><strong>enum</strong> Enum: String, CaseIterable {</pre><pre><strong>    case</strong> firstScreen = &quot;first&quot;</pre><pre><strong>    case</strong> secondScreen = &quot;second&quot;</pre><pre>}</pre><p>Secondly, create a variable structure for selecting screens. As well as a body with two cases. They can be filled in as you like, the main thing is that they correspond to the type View (content for your custom view).</p><pre><strong>struct</strong> ChosenEnum: View {</pre><pre><strong>    var</strong> selectScreen: Enum</pre><pre>}</pre><pre><strong>     var</strong> body: <strong>some</strong> View {<br>         <strong>switch</strong> selectScreen {</pre><pre>             <strong>case</strong> .firstScreen:<br>             Image(systemName: &quot;1.circle&quot;)</pre><pre><strong>             case</strong> .secondScreen:<br>             Image(systemName: &quot;2.circle&quot;)</pre><pre>       }<br>    }<br>}</pre><p>The next step is to add a property wrapper type to our picker.</p><pre>@State <strong>private</strong> <strong>var</strong> selectpicker: Enum = .firstScreen</pre><p>It remains only to add the picker itself for selection, and do not forget to add after it the structure which will be displayed.</p><pre>VStack {<br>       Picker(&quot;Picker Enum&quot;, selection: $selectpicker) {            <br>             ForEach(Enum.allCases, id: \.<strong>self</strong>) { title <strong>in<br>                  </strong>Text(title.rawValue)<br>           }<br>      }<br>     .pickerStyle(.segmented)<br>     ChosenEnum(selectScreen: selectpicker)<br>}</pre><p>The entire code example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RhWBmWvigDogB9qOWuKwRQ.png" /></figure><p>Hopefully, I could help. Good luck!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a917ab565330" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>