<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sadman Samee</title>
    <description>The latest articles on DEV Community by Sadman Samee (@sadmansamee).</description>
    <link>https://dev.to/sadmansamee</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F59980%2Fb237e506-c796-4be0-a61c-7a28218b4eef.jpeg</url>
      <title>DEV Community: Sadman Samee</title>
      <link>https://dev.to/sadmansamee</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sadmansamee"/>
    <language>en</language>
    <item>
      <title>Intelligence in Mobile Applications.</title>
      <dc:creator>Sadman Samee</dc:creator>
      <pubDate>Thu, 12 Sep 2019 18:12:33 +0000</pubDate>
      <link>https://dev.to/sadmansamee/intelligence-in-mobile-applications-4o2p</link>
      <guid>https://dev.to/sadmansamee/intelligence-in-mobile-applications-4o2p</guid>
      <description>

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1200%2F1%2ArGJbTtEiXpg68goG2afoUw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1200%2F1%2ArGJbTtEiXpg68goG2afoUw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Machine learning is a cool topic nowadays, people are excited about Google Assistant, Apple Siri, Microsoft Cortana, Amazon Alexa, self-driving cars, robots, even apps like Uber, Snapchat are using Machine Learning to enhance the experience and of course for smart pieces of stuff.&lt;br&gt;
If you are interested in building kick-ass apps with intelligence that includes features such as speech recognition, face detection, natural language processing, prediction or anything like that, it's not always an easy option to develop a machine learning system from the ground for any indie developers or small to medium or even for a large team because of it's cost, time (coffee) consumption, therefore, there are many open-source machine learning platforms like &lt;a href="https://www.tensorflow.org/lite" rel="noopener noreferrer"&gt;Tensorflow Lite&lt;/a&gt;, &lt;a href="https://pytorch.org" rel="noopener noreferrer"&gt;Pytorch&lt;/a&gt;, &lt;a href="https://developer.apple.com/documentation/coreml" rel="noopener noreferrer"&gt;Core ML&lt;/a&gt;, services like &lt;a href="https://dialogflow.com" rel="noopener noreferrer"&gt;Dialogflow&lt;/a&gt;, &lt;a href="https://wit.ai" rel="noopener noreferrer"&gt;Wit.ai&lt;/a&gt;, &lt;a href="https://cloud.google.com/products/ai/" rel="noopener noreferrer"&gt;Google Cloud Machine Learning APIs&lt;/a&gt;, &lt;a href="https://azure.microsoft.com/en-us/services/cognitive-services/" rel="noopener noreferrer"&gt;Microsoft Cognitive Services&lt;/a&gt;, &lt;a href="https://www.ibm.com/watson" rel="noopener noreferrer"&gt;IBM Watson&lt;/a&gt; are available to the developers to get things done in a very convenient way.&lt;br&gt;
Here we will explore various machine learning libraries, APIs, and services.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.tensorflow.org/lite" rel="noopener noreferrer"&gt;Tensorflow Lite&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;TensorFlow™ is an open-source software library for numerical computation using data flow graphs. Nodes in the graph represent mathematical operations, while the graph edges represent the multidimensional data arrays (tensors) communicated between them and TensorFlow Lite is TensorFlow's lightweight solution for mobile and embedded devices. It enables on-device machine learning inference with low latency and small binary size.&lt;br&gt;
Android app with Tensorflow.You can build intelligent apps using Tensorflow Lite and even it will work on offline. Here's an Android demo built with inception model for image identification. This app can identify simple basic objects such as notebook, mouse, water bottle, phone, books, pen, table chair, etc look at the top texts of the photo it describes the object.&lt;br&gt;
There are other &lt;a href="https://github.com/tensorflow/models" rel="noopener noreferrer"&gt;open-source models&lt;/a&gt; for natural language processing, computer vision, image captioning, generating words, text recognition or else you can train and generate your models to use with Tensorflow for your own very need.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://developer.apple.com/documentation/coreml" rel="noopener noreferrer"&gt;Core ML&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://developer.apple.com/documentation/coreml" rel="noopener noreferrer"&gt;Core ML&lt;/a&gt; is a new foundational machine learning framework used across Apple products, including Siri, Camera, and QuickType. &lt;a href="https://developer.apple.com/documentation/coreml" rel="noopener noreferrer"&gt;Core ML&lt;/a&gt; delivers blazingly fast performance with easy integration of machine learning models enabling you to build apps with intelligent new features using just a few lines of code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fxnqxhk4l9foarwr9y1bi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fxnqxhk4l9foarwr9y1bi.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Interestingly you can train your models in Tensorflow and convert them to the &lt;a href="https://developer.apple.com/documentation/coreml" rel="noopener noreferrer"&gt;Core ML&lt;/a&gt; format so you can take advantages of both platforms. &lt;a href="https://github.com/likedan/Awesome-CoreML-Models" rel="noopener noreferrer"&gt;Here's&lt;/a&gt; a nice list of pre-trained models for &lt;a href="https://developer.apple.com/documentation/coreml" rel="noopener noreferrer"&gt;Core ML&lt;/a&gt; and a &lt;a href="https://www.raywenderlich.com/577-core-ml-and-vision-machine-learning-in-ios-11-tutorial" rel="noopener noreferrer"&gt;good tutorial&lt;/a&gt; to learn it.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://wit.ai" rel="noopener noreferrer"&gt;Wit.ai&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://wit.ai" rel="noopener noreferrer"&gt;Wit.ai&lt;/a&gt; is a natural language processing platform that makes it possible for developers to add intelligent conversation functionality to applications. Developers can use the &lt;a href="https://wit.ai" rel="noopener noreferrer"&gt;Wit.ai&lt;/a&gt; API to add an intelligent voice or chat interface to home automation, connected car, smart TV, robotic, smartphone, wearable, and many other types of applications or you can build an intelligent bot and got your application connected to the bot via API. Users can enjoy a hands-free mobile experience while driving, working out, cooking.&lt;br&gt;
The basic idea of integration of &lt;a href="https://wit.ai" rel="noopener noreferrer"&gt;Wit.ai&lt;/a&gt; to your mobile app is via API like node, python, ruby. There are many &lt;a href="https://wit.ai/docs/recipes" rel="noopener noreferrer"&gt;recipes&lt;/a&gt; out there for you. API training is done around Stories (domain-specific use cases), where the engine learns conversation flow from examples of user input with bot response.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F0x2gnyd3sici2nylpjpy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F0x2gnyd3sici2nylpjpy.gif" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
This is a simple android app connected with &lt;a href="https://wit.ai" rel="noopener noreferrer"&gt;Wit.ai&lt;/a&gt;, it takes images as input and describes what is in it in natural language. You can build an app that can talk to you. Great!&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fa64un0k1ne9fnamasb5v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fa64un0k1ne9fnamasb5v.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Here's another example of &lt;a href="https://wit.ai" rel="noopener noreferrer"&gt;Wit.ai&lt;/a&gt;. Users can order pizza and it can have a smart conversation with the users. It can be a nifty feature in your mobile app.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://www.ibm.com/watson" rel="noopener noreferrer"&gt;IBM Watson&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.ibm.com/watson" rel="noopener noreferrer"&gt;IBM Watson&lt;/a&gt; is well-known platforms for machine learning with cognitive computing. It provides APIs such as speech to text, text to speech, trade-off analytics, personality insights, question and answer, tone analyzer, and visual recognition. You can build very smart applications with these APIs without banging your heads! everything is ready at your hands. Take a look at &lt;a href="https://www.cio.com/article/3400756/10-ibm-watson-powered-apps-that-are-changing-our-world.html" rel="noopener noreferrer"&gt;"10 IBM Watson-powered Apps That Are Changing Our World"&lt;/a&gt; and this one too &lt;a href="https://www.techradar.com/news/world-of-tech/5-unusual-things-you-can-do-with-ibm-s-watson-1321443" rel="noopener noreferrer"&gt;"5 unusual things you can do with IBM's Watson"&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://cloud.google.com/products/ai/" rel="noopener noreferrer"&gt;Google Cloud Machine Learning Platform&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Google Cloud ML Platform provides modern machine learning services, with pre-trained models and a service to generate your tailored models. Major Google applications use Cloud Machine Learning, including Photos, the Google app, Translate and many other.&lt;br&gt;
Google itself uses this service to develop its smart applications. Usage of their service is massive you can do a lot of things in your applications with the services they provide, and their documentation is mind-blowing.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://aws.amazon.com/ai/" rel="noopener noreferrer"&gt;Amazon AI&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://aws.amazon.com/ai/" rel="noopener noreferrer"&gt;Amazon AI&lt;/a&gt; is a machine learning service provided by Amazon. Under Amazon AI umbrella there is &lt;a href="https://aws.amazon.com/rekognition/?nc2=h_m1" rel="noopener noreferrer"&gt;Rekognition&lt;/a&gt;, a service that makes it easy to add image analysis to your applications. With &lt;a href="https://aws.amazon.com/rekognition/?nc2=h_m1" rel="noopener noreferrer"&gt;Rekognition&lt;/a&gt;, you can detect objects, scenes, and faces in images. You can also search and compare faces. Rekognition's API enables you to quickly add sophisticated deep-learning-based visual search and image classification to your applications.&lt;/p&gt;

&lt;p&gt;Rekognition identifies thousands of objects such as vehicles, pets, or furniture, and provides a confidence score. Rekognition also detects scenes within an image, such as a sunset or beach. This makes it easy for you to add features that search, filter, and curate large image libraries.&lt;br&gt;
It has other capabilities like Facial Analysis as an example it can locate faces within images and analyze face attributes, such as whether or not the face is smiling or the eyes are open, Face Comparison like measures the likelihood that faces in two images are of the same person, and Facial Recognition. There are many use cases for this service like Searchable Image Library, Face-Based User Verification, Sentiment Analysis.&lt;/p&gt;

&lt;p&gt;Another service under Amazon AI is Polly a text-to-speech service that uses a lot of machine learning smarts under the hood.&lt;br&gt;
Amazon Polly is a service that turns text into lifelike speech. Polly lets you create applications that talk, enabling you to build entirely new categories of speech-enabled products.&lt;br&gt;
The third and probably most important new service is called Lex. It is essentially the technology that fuels Amazon's own Alexa service. It allows you to build conversational applications that can feature multi-step conversations.&lt;br&gt;
You can use &lt;a href="https://aws.amazon.com/lex/?nc2=h_m1" rel="noopener noreferrer"&gt;Amazon Lex&lt;/a&gt; to build chatbots and mobile applications that support engaging, lifelike interactions. It has many interesting use cases like Informational Bots, Application Bots like Alexa.&lt;/p&gt;

&lt;p&gt;There are other services out there you can explore like &lt;a href="https://azure.microsoft.com/en-us/services/cognitive-services/" rel="noopener noreferrer"&gt;Microsoft Cognitive Services&lt;/a&gt;, AlchemyAPI.&lt;/p&gt;

&lt;p&gt;Before finishing we all know machine learning stuff is really cool but we shouldn't implement it in our app just because it is cool, if scenario really calls for it then we should go for it, like you want to make an app like Uber now you need to fraud analysis then you can go for like the Uber did so, or like Google's Allo app they extensively used natural language processing for their Google Assistant.&lt;br&gt;
Trends of intelligent apps are going on, time to catch up. :) Happy Learning.&lt;/p&gt;




&lt;p&gt;Did you find this article useful? Which technology do you want to try out among them? Leave a comment to discuss it!&lt;br&gt;
If you enjoyed the writings then please use the ❤ heart below to recommend this article so that others can see it.&lt;br&gt;
Let's connect through &lt;a href="https://www.linkedin.com/in/sadmansamee/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>mobile</category>
      <category>tensorflow</category>
    </item>
    <item>
      <title>A Caching Library, written in Swift that can cache Anything.</title>
      <dc:creator>Sadman Samee</dc:creator>
      <pubDate>Sun, 08 Sep 2019 16:55:11 +0000</pubDate>
      <link>https://dev.to/sadmansamee/a-caching-library-is-written-in-swift-that-can-cache-anything-6ec</link>
      <guid>https://dev.to/sadmansamee/a-caching-library-is-written-in-swift-that-can-cache-anything-6ec</guid>
      <description>&lt;p&gt;Needed a cache Library that has&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[x] Asynchronous data downloading and caching.&lt;/li&gt;
&lt;li&gt;[x] Asynchronous image downloading, caching and showing.&lt;/li&gt;
&lt;li&gt;[x] Expiry date/time for all the objects individually.&lt;/li&gt;
&lt;li&gt;[x] Multiple-layer hybrid cache for both memory and disk.&lt;/li&gt;
&lt;li&gt;[x] Fine control on cache behavior. Customizable expiration date and size limit.&lt;/li&gt;
&lt;li&gt;[x] Force refresh if needed.&lt;/li&gt;
&lt;li&gt;[x] Independent components. Use the &lt;a href="https://github.com/Sadmansamee/CachyKit"&gt;Cachy&lt;/a&gt; or &lt;a href="https://github.com/Sadmansamee/CachyKit"&gt;CachyLoader&lt;/a&gt; system separately as you need.&lt;/li&gt;
&lt;li&gt;[x] Can save JSON, UIImage, ZIP or anything.&lt;/li&gt;
&lt;li&gt;[x] View extensions for &lt;code&gt;UIImageView&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;[x] Indicator while loading images.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Couldn't find any all in one solution, either it's too much or too less, so came up with this.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Sadmansamee/CachyKit"&gt;https://github.com/Sadmansamee/CachyKit&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;it's the first version there might be a lot of issues or bad, please point them out and how I can improve them.&lt;/p&gt;

</description>
      <category>swift</category>
      <category>ios</category>
      <category>cache</category>
    </item>
    <item>
      <title>Working with WebRTC</title>
      <dc:creator>Sadman Samee</dc:creator>
      <pubDate>Tue, 20 Aug 2019 09:48:55 +0000</pubDate>
      <link>https://dev.to/sadmansamee/working-with-webrtc-on-android-ios-465c</link>
      <guid>https://dev.to/sadmansamee/working-with-webrtc-on-android-ios-465c</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kTZvCqXY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/tv6g1skrgh9s6bbjs2xp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kTZvCqXY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/tv6g1skrgh9s6bbjs2xp.png" alt="Alt Text" width="880" height="440"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Anybody who worked with &lt;a href="https://webrtc.org/"&gt;WebRTC&lt;/a&gt; will agree that there is a huge lack of learning resources and on top of that on every few years, &lt;a href="https://webrtc.org/"&gt;WebRTC&lt;/a&gt; standards changes and changes are big sometimes that makes previous resources outdated, creating more gap. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;WebRTC is a free, open project that provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. The WebRTC components have been optimized to best serve this purpose.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I have found most of the resources either not clear, not compatible with the current &lt;a href="https://webrtc.org/"&gt;WebRTC&lt;/a&gt; library or very incomplete. During my searching for resources, I have found a few as good resources. &lt;/p&gt;

&lt;h2&gt;
  
  
  Web
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://codelabs.developers.google.com/codelabs/webrtc-web"&gt;Real time communication with WebRTC&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/webrtc/samples"&gt;WebRTC Web demos and samples&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://webrtc.org/start/"&gt;Official documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Android
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/Sadmansamee/webrtc-android-codelab"&gt;WebRTC Android Codelab&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vivekc.xyz/getting-started-with-webrtc-part-4-de72b58ab31e"&gt;Getting Started with WebRTC for Android— Develop video call app easily!&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  iOS
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/stasel/WebRTC-iOS"&gt;A simple native WebRTC demo iOS app using swift&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/kurzdigital/Whale"&gt;A WebRTC and CallKit demo application&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Flutter
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/cloudwebrtc/flutter-webrtc"&gt;Flutter WebRTC plugin for Mobile/Desktop&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/cloudwebrtc/flutter-webrtc-demo"&gt;Demo for flutter-webrtc&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/cloudwebrtc/flutter-webrtc-server"&gt;A simple WebRTC signaling server for flutter-webrtc and html5.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://flutterawesome.com/flutter-webrtc-plugin-for-ios-android"&gt;Flutter WebRTC plugin for iOS/Android&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are very high-level examples, I have a plan to write a full-fledged tutorial on this topic soon. &lt;/p&gt;

</description>
      <category>webrtc</category>
      <category>voip</category>
      <category>vp8</category>
    </item>
    <item>
      <title>SwiftUI Cheat Sheet</title>
      <dc:creator>Sadman Samee</dc:creator>
      <pubDate>Mon, 10 Jun 2019 14:25:51 +0000</pubDate>
      <link>https://dev.to/sadmansamee/swiftui-cheat-sheet-34ga</link>
      <guid>https://dev.to/sadmansamee/swiftui-cheat-sheet-34ga</guid>
      <description>&lt;h1&gt;
  
  
  SwiftUI Cheat Sheet
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FSimpleBoilerplates%2FSwiftUI-Cheat-Sheet%2Fmaster%2Fassets%2Fimage.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2FSimpleBoilerplates%2FSwiftUI-Cheat-Sheet%2Fmaster%2Fassets%2Fimage.png" alt="SwiftUI"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This was originally published in &lt;a href="https://github.com/SimpleBoilerplates/SwiftUI-Cheat-Sheet" rel="noopener noreferrer"&gt;here&lt;/a&gt;, in Github &lt;/p&gt;

&lt;h3&gt;
  
  
  Table of Contents
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
SwiftUI Cheat Sheet

&lt;ul&gt;
&lt;li&gt;Table of Contents&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Tutorial&lt;/li&gt;

&lt;li&gt;UIKIT equivalent in SwiftUI&lt;/li&gt;

&lt;li&gt;

View

&lt;ul&gt;
&lt;li&gt;Text&lt;/li&gt;
&lt;li&gt;Image&lt;/li&gt;
&lt;li&gt;Shape&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Layout

&lt;ul&gt;
&lt;li&gt;Background&lt;/li&gt;
&lt;li&gt;VStack&lt;/li&gt;
&lt;li&gt;HStack&lt;/li&gt;
&lt;li&gt;ZStack&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

Input

&lt;ul&gt;
&lt;li&gt;Toggle&lt;/li&gt;
&lt;li&gt;Button&lt;/li&gt;
&lt;li&gt;TextField&lt;/li&gt;
&lt;li&gt;Slider&lt;/li&gt;
&lt;li&gt;Date Picker&lt;/li&gt;
&lt;li&gt;Segmented Control&lt;/li&gt;
&lt;li&gt;Tap&lt;/li&gt;
&lt;li&gt;Gesture&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;List&lt;/li&gt;

&lt;li&gt;

Containers

&lt;ul&gt;
&lt;li&gt;NavigationView&lt;/li&gt;
&lt;li&gt;Group&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Alerts and Action Sheets&lt;/li&gt;

&lt;li&gt;Navigation&lt;/li&gt;

&lt;li&gt;

Work with UIKIT

&lt;ul&gt;
&lt;li&gt;Navigate to ViewController&lt;/li&gt;
&lt;li&gt;Use UIKit and SwiftUI Views Together&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h1&gt;
  
  
  Tutorial
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/tutorials/swiftui/creating-and-combining-views" rel="noopener noreferrer"&gt;SwiftUI Tutorials (Official)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/videos/play/wwdc2019/204/" rel="noopener noreferrer"&gt;Introducing SwiftUI: Building Your First App (Official)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.apple.com/videos/play/wwdc2019/216" rel="noopener noreferrer"&gt;SwiftUI Essentials (Official)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/@martinlasek/swiftui-getting-started-372389fff423" rel="noopener noreferrer"&gt;SwiftUI - How to setup a project&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  UIKIT equivalent in SwiftUI
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;UIKIT&lt;/th&gt;
&lt;th&gt;&lt;a href="https://developer.apple.com/xcode/swiftui/" rel="noopener noreferrer"&gt;SwiftUI&lt;/a&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;UILabel&lt;/td&gt;
&lt;td&gt;Text&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UIImageView&lt;/td&gt;
&lt;td&gt;Image&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UITextField&lt;/td&gt;
&lt;td&gt;TextField&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UITextView&lt;/td&gt;
&lt;td&gt;No equivalent (use Text)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UISwitch&lt;/td&gt;
&lt;td&gt;Toggle&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UISlider&lt;/td&gt;
&lt;td&gt;Slider&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UIButton&lt;/td&gt;
&lt;td&gt;Button&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UITableView&lt;/td&gt;
&lt;td&gt;List&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UICollectionView&lt;/td&gt;
&lt;td&gt;No equivalent (can be implemented by List)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UINavigationController&lt;/td&gt;
&lt;td&gt;NavigationView&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UIAlertController with style .alert&lt;/td&gt;
&lt;td&gt;Alert&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UIAlertController with style .actionSheet&lt;/td&gt;
&lt;td&gt;ActionSheet&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UIStackView with horizontal axis&lt;/td&gt;
&lt;td&gt;HStack&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UIStackView with vertical axis&lt;/td&gt;
&lt;td&gt;VStack&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UISegmentedControl&lt;/td&gt;
&lt;td&gt;SegmentedControl&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UIStepper&lt;/td&gt;
&lt;td&gt;Stepper&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;UIDatePicker&lt;/td&gt;
&lt;td&gt;DatePicker&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;NSAttributedString&lt;/td&gt;
&lt;td&gt;No equivalent (use Text)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h1&gt;
  
  
  View
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Text
&lt;/h3&gt;

&lt;p&gt;To show a &lt;strong&gt;text&lt;/strong&gt; in UI simply write&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Text("Hello World")


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To add style&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Text("Hello World")
    .font(.largeTitle)
    .foregroundColor(Color.green)
    .lineSpacing(50)
    .lineLimit(nil)
    .padding()


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To format text inside text view&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

static let dateFormatter: DateFormatter = {
    let formatter = DateFormatter()
    formatter.dateStyle = .long
    return formatter
    }()

    var now = Date()

    var body: some View {
        Text("Task due date: \(now, formatter: Self.formatter)")
    }


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Image
&lt;/h3&gt;

&lt;p&gt;To show image&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Image("hello_world") //image name is hello_world


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To use system icon&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Image(systemName: "cloud.heavyrain.fill")


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;you can add style to system icon set&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Image(systemName: "cloud.heavyrain.fill")
    .foregroundColor(.red)
    .font(.largeTitle)


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Add style to Image&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Image("hello_world")
    .resizable() //it will sized so that it fills all the available space
    .aspectRatio(contentMode: .fill)
    .padding(.bottom)


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Shape
&lt;/h3&gt;

&lt;p&gt;To create Rectangle&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Rectangle()
    .fill(Color.red)
    .frame(width: 200, height: 200)


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To create circle&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Circle()
    .fill(Color.blue)
    .frame(width: 50, height: 50)


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Layout
&lt;/h1&gt;
&lt;h3&gt;
  
  
  Background
&lt;/h3&gt;

&lt;p&gt;To use image as a background&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Text("Hello World")
    .font(.largeTitle)
    .background(
        Image("hello_world")
            .resizable()
            .frame(width: 100, height: 100))


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Gradient background&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Text("Hello World")
    .background(LinearGradient(gradient: Gradient(colors: [.white, .red, .black]), startPoint: .leading, endPoint: .trailing), cornerRadius: 0)


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  VStack
&lt;/h3&gt;

&lt;p&gt;Shows child view vertically&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

VStack {
    Text("Hello")
    Text("World")
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Styling&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

VStack (alignment: .leading, spacing: 20){
    Text("Hello")
    Divider()
    Text("World")
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  HStack
&lt;/h3&gt;

&lt;p&gt;Shows child view horizontally&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

HStack {
    Text("Hello")
    Text("World")
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  ZStack
&lt;/h3&gt;

&lt;p&gt;To create overlapping content use ZStack&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

ZStack() {
    Image("hello_world")
    Text("Hello World")
        .font(.largeTitle)
        .background(Color.black)
        .foregroundColor(.white)
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Input
&lt;/h1&gt;
&lt;h3&gt;
  
  
  Toggle
&lt;/h3&gt;

&lt;p&gt;Toggle lets users move between true and false states&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

    @State var isShowing = true //state

    Toggle(isOn: $isShowing) {
        Text("Hello World")
    }.padding()


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Button
&lt;/h3&gt;

&lt;p&gt;To create button&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Button(action: {
    // do something
}) {
    Text("Click Me")
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To create image Button&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Button(action: {
    // do something
}) {
    Image("hello_world")
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  TextField
&lt;/h3&gt;

&lt;p&gt;It heavily relies in state, simply create a state and pass it as it will bind to it&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

@State var fullName: String = "Joe" //create State

TextField($fullName) // passing it to bind
    .textFieldStyle(.roundedBorder) //adds border



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To create secure TextField&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

@State var password: String = "" //create State

SecureField($password) // passing it to bind
    .textFieldStyle(.roundedBorder) //adds border



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Slider
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

@State var value: Double = 0 //create State

Slider(value: $value, from: -100, through: 100, by: 1)


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Date Picker
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

@State var selectedDate = Date()
DatePicker(
            $selectedDate,
            maximumDate: Date(),
            displayedComponents: .date
        )


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Segmented Control
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

@State var favoriteColor = 0
var colors = ["Red", "Green", "Blue"]

SegmentedControl(selection: $favoriteColor) {
    ForEach(0..&amp;lt;colors.count) { index in
        Text(self.colors[index]).tag(index)
    }
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Tap
&lt;/h3&gt;

&lt;p&gt;For single tap&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Text("Tap me!")
    .tapAction {
       print("Tapped!")
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;For double tap&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Text("Tap me!")
    .tapAction (count: 2){
       print("Tapped!")
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Gesture
&lt;/h3&gt;

&lt;p&gt;Gesture like &lt;strong&gt;TapGesture&lt;/strong&gt;, &lt;strong&gt;LongPressGesture&lt;/strong&gt;, &lt;strong&gt;DragGesture&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Text("Tap")
    .gesture(
        TapGesture()
            .onEnded { _ in

            }
        )

Text("Long Press")
    .gesture(
        DragGesture(minimumDistance: 50)
            .onEnded { _ in

            }
        )

Text("Drag Me")
   .gesture(
        LongPressGesture(minimumDuration: 2)
            .onEnded { _ in

            }
        )


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  List
&lt;/h1&gt;

&lt;p&gt;To create static scrollable &lt;strong&gt;List&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

List {
    Text("Hello world")
    Text("Hello world")
    Text("Hello world")
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To create dynamic &lt;strong&gt;List&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

let names = ["Thanos", "Iron man", "Ant man"]
List(names) { name in
        Text(name)
    }


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To add section&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

 List {
    Section(header: Text("Good Hero")) {
        Text("Thanos")
    }

    Section(header: Text("Bad Heros")) {
        Text("Iron man")
    }
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To make it grouped add &lt;em&gt;.listStyle(.grouped)&lt;/em&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

 List {
    Section(header: Text("Good Hero")) {
        Text("Thanos")
    }

    Section(header: Text("Bad Heros")) {
        Text("Iron man")
    }
}.listStyle(.grouped)


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Containers
&lt;/h1&gt;
&lt;h3&gt;
  
  
  NavigationView
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;NavigationView&lt;/strong&gt; is more/less like &lt;strong&gt;UINavigationController&lt;/strong&gt;, It handles navigation between views, shows title, places navigation bar on top. &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

NavigationView {
    Text("Hello")
        .navigationBarTitle(Text("World"), displayMode: .inline)
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;For large title use &lt;em&gt;.large&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Add bar items to &lt;strong&gt;NavigationView&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

NavigationView {
    Text("Hello")
        .navigationBarTitle(Text("World"), displayMode: .inline)
        .navigationBarItems(trailing:
                Button(action: {
                    print("Going to Setting")
                }) {
                    Text("Setting")
                })
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Group
&lt;/h3&gt;

&lt;p&gt;Group creates several views to act as one, also to avoid Stack's 10 View maximum limit.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

 VStack {
        Group {
            Text("Hello")
            Text("Hello")
            Text("Hello")
        }
        Group {
            Text("Hello")
            Text("Hello")
        }
    }


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Alerts and Action Sheets
&lt;/h1&gt;

&lt;p&gt;To Show an Alert&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Alert(title: Text("Title"), message: Text("message"), dismissButton: .default(Text("Ok!")))



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;To Show Action Sheet&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

ActionSheet(title: Text("Title"), message: Text("Message"), buttons: [.default(Text("Ok!"), onTrigger: {

    })])


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Navigation
&lt;/h1&gt;

&lt;p&gt;Navigate via &lt;strong&gt;NavigationButton&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

NavigationView {
    NavigationButton(destination: SecondView()) {
        Text("Show")
    }.navigationBarTitle(Text("First View"))
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Navigate via tap on List Item&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

let names = ["Thanos", "Iron man", "Ant man"]
List(names) { name in
    NavigationButton(destination: HeroView(name: name)) {
        Text(name)
    }
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Navigate via &lt;strong&gt;PresentationButton&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

PresentationButton(Text("Tap"), destination: HeroView())


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Work with UIKIT
&lt;/h1&gt;
&lt;h3&gt;
  
  
  Navigate to ViewController
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;It's possible to work with UIKIT component from SwiftUI or call SwiftUI view as View Controller from UIKIT. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's say you have a View Controller named as SuperVillainViewController and want to call from SwiftUI view, to do that ViewController need to implement UIViewControllerRepresentable&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

struct SuperVillainViewController: UIViewControllerRepresentable {
    var controllers: [UIViewController]
    func makeUIViewcontroller(context: Context)  SuperVillainViewController {
        // you could have a custom constructor here, I'm just keeping it simple
        let vc = SuperVillainViewController()
        retrun vc
    }
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Now you can use it like &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

NavigationButton(destination: SuperVillainViewController()) {
        Text("Click")
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Use UIKit and SwiftUI Views Together
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;To use UIView subclasses from within SwiftUI, you wrap the other view in a SwiftUI view that conforms to the UIViewRepresentable protocol. (&lt;a href="https://developer.apple.com/tutorials/swiftui/creating-and-combining-views#use-uikit-and-swiftui-views-together" rel="noopener noreferrer"&gt;Reference&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;as example &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


import SwiftUI
import MapKit

struct MapView: UIViewRepresentable {
    func makeUIView(context: Context) -&amp;gt; MKMapView {
        MKMapView(frame: .zero)
    }

    func updateUIView(_ view: MKMapView, context: Context) {
        let coordinate = CLLocationCoordinate2D(
            latitude: 34.011286, longitude: -116.166868)
        let span = MKCoordinateSpan(latitudeDelta: 2.0, longitudeDelta: 2.0)
        let region = MKCoordinateRegion(center: coordinate, span: span)
        view.setRegion(region, animated: true)
    }
}

struct MapView_Preview: PreviewProvider {
    static var previews: some View {
        MapView()
    }
}


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>swiftui</category>
      <category>swift</category>
      <category>declarativeui</category>
    </item>
    <item>
      <title>Keep your iOS projects healthy</title>
      <dc:creator>Sadman Samee</dc:creator>
      <pubDate>Mon, 08 Apr 2019 17:18:59 +0000</pubDate>
      <link>https://dev.to/sadmansamee/keep-your-ios-projects-healthy-1ao4</link>
      <guid>https://dev.to/sadmansamee/keep-your-ios-projects-healthy-1ao4</guid>
      <description>&lt;p&gt;Keeping your code and projects is the best thing you can do to your projects and here’s how to do it your iOS projects written in swift.&lt;/p&gt;

&lt;h2&gt;
  
  
  Following style guide
&lt;/h2&gt;

&lt;p&gt;There are several style guide for writing swift, and every team member should follow them well. Such as&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://github.com/raywenderlich/swift-style-guide"&gt;Raywinderlich style guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/linkedin/swift-style-guide"&gt;Linkedin style guide&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://google.github.io/swift/"&gt;Google style guide&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Using tools
&lt;/h2&gt;

&lt;p&gt;In reality not everyone does it properly so there should be a way to enforce it amongst team members, a way of doing is manual code review which is very time-consuming and code review should happen in logic level not how a developer should declare variable or indentation, we could simple automate these things and invest our time more on harder things.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://github.com/realm/SwiftLint"&gt;Swiftlint&lt;/a&gt; will excellently lint the swift codes. &lt;/li&gt;
&lt;li&gt;You can also add linting for storyboard and xib files with &lt;a href="https://github.com/lyft/xiblint"&gt;xiblint&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;It is also preferred to have a one way of formatting code like how many indents, way declaring variable etc and this is where &lt;a href="https://github.com/nicklockwood/SwiftFormat"&gt;Swiftformat&lt;/a&gt; shines really well.&lt;/li&gt;
&lt;li&gt;To Eliminate Unused Swift Code go for &lt;a href="https://github.com/peripheryapp/periphery"&gt;periphery&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Having a static analysis of your codes is a good way to have fewer bugs, &lt;a href="http://fbinfer.com"&gt;Infer&lt;/a&gt; is a static analysis tool that produces a list of potential bugs.&lt;/li&gt;
&lt;li&gt;You can also automate using these tools on &lt;a href="https://www.thoughtworks.com/continuous-integration"&gt;Continuous Integration&lt;/a&gt; level using danger. You can use Danger to codify your teams’ norms. Leaving humans to think about harder problems. And &lt;a href="https://danger.systems/ruby/"&gt;danger&lt;/a&gt; supports Circle, Travis, Jenkins, Buildkite, BuddyBuild, Semaphore, TeamCity, Xcode Bots, Drone, Surf and Bitrise.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Organising Xcode projects
&lt;/h2&gt;

&lt;p&gt;In older versions of Xcode you could only group and in beneath there was no folder structure so basically every file used to stay in one single folder by default and this is messy!&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You can use &lt;a href="https://github.com/venmo/synx"&gt;Synx&lt;/a&gt;, a command line tool to create folder according to Xcode group.&lt;/li&gt;
&lt;li&gt;And sometimes your Xcode project might be corrupted and broken and you can get back your Xcode project based on folder structure using &lt;a href="https://github.com/yonaskolb/XcodeGen"&gt;XcodeGen&lt;/a&gt;, A Swift command line tool for generating your Xcode project.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ios</category>
      <category>swift</category>
      <category>objc</category>
      <category>xcode</category>
    </item>
  </channel>
</rss>
