<?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 Tolga Sayan on Medium]]></title>
        <description><![CDATA[Stories by Tolga Sayan on Medium]]></description>
        <link>https://medium.com/@tolgasyn2?source=rss-8d46983d566------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Cx-MqoZHC5nRpkHqRq0dzQ@2x.jpeg</url>
            <title>Stories by Tolga Sayan on Medium</title>
            <link>https://medium.com/@tolgasyn2?source=rss-8d46983d566------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 02:31:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tolgasyn2/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[How to Add a Flutter Screen to an iOS App]]></title>
            <link>https://medium.com/@tolgasyn2/how-to-add-a-flutter-screen-to-an-ios-app-83a2cccee563?source=rss-8d46983d566------2</link>
            <guid isPermaLink="false">https://medium.com/p/83a2cccee563</guid>
            <dc:creator><![CDATA[Tolga Sayan]]></dc:creator>
            <pubDate>Wed, 28 Aug 2024 21:20:25 GMT</pubDate>
            <atom:updated>2024-09-12T23:36:35.508Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>updated with unexpected errors solution</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UeUsPfbwNetKQ0LKYFPUQw.png" /></figure><p>Flutter is a UI toolkit developed by Google that allows you to create high-performance applications for mobile, web, and desktop from a single codebase. If you want to integrate Flutter screens into an existing iOS app, this guide will walk you through the process step-by-step.</p><h3>Setting Up Flutter</h3><blockquote>If you haven’t installed the Flutter SDK on your computer yet, now is a great opportunity to get started. You can find detailed instructions on how to set up Flutter for your operating system by following this <a href="https://docs.flutter.dev/get-started/install"><strong><em>link</em></strong></a>. Take your time to complete the setup.</blockquote><p>If you prefer to read through the rest of the guide first and set up Flutter later, that’s perfectly fine too. The choice is yours!</p><h3>Create a Flutter module</h3><p>The initial step in integrating Flutter into your existing app is to create a Flutter module. This module will serve as the component you’ll add to your app. To get started, open your command line interface, navigate to the directory where you want to save your Flutter module, and execute the following command using the Flutter CLI tool:</p><pre>flutter create --template module my_flutter_module</pre><p>This command generates a new Flutter module named my_flutter_module that you can later integrate into your existing application. If you prefer, you can replace my_flutter_module with any name you choose for your module.</p><h3>Setup iOS</h3><p>For this tutorial, you’ll start by creating a brand new iOS app from Xcode. Use the <strong>Storyboard</strong> interface, <strong>Swift</strong> for the language, and <strong>UIKit App Delegate</strong> for the life cycle.</p><p>Returning to the command line, navigate into the new iOS project directory that you created in the last step and initialize CocoaPods using the following command:</p><pre>pod init</pre><p>After the Podfile is initialized, open it from the CLI and replace its contents with the following: (the flutter_application_path to match your Flutter module’s path if you’re using different values):</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/48ee4e877346b07aedffa56c7b3c4ca5/href">https://medium.com/media/48ee4e877346b07aedffa56c7b3c4ca5/href</a></iframe><p>Once the Podfile is updated, save the file and run the following command to link the Flutter module to the new iOS project:</p><pre>pod install</pre><h3>Run Your Application</h3><p>Now, open the .xcworkspace file in Xcode and run your application. The Flutter module will be available as a view controller within your iOS app.</p><blockquote>If the build fails, try the following two steps and attempt the build again:</blockquote><ol><li>Update your Xcode project build option ENABLE_USER_SCRIPT_SANDBOXING to &#39;No&#39;.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TXcvLuZCJ46h1UT43QOWWw.png" /></figure><p>2. Xcode warning: Run script build phase ‘Run Script’ will be run during every build because it does not specify any outputs.</p><p>Xcode isn’t handling input/output, flutter is, so it needs to be unchecked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4VKX5FkNMwbSCSguj7kAaw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H4t3hKETjFxbBSEWfHcIKA.png" /></figure><h3>Create a FlutterEngine</h3><pre>import UIKit<br>import Flutter<br>// The following library connects plugins with iOS platform code to this app.<br>import FlutterPluginRegistrant<br><br>@UIApplicationMain<br>class AppDelegate: FlutterAppDelegate { // More on the FlutterAppDelegate.<br>  lazy var flutterEngine = FlutterEngine(name: &quot;my flutter engine&quot;)<br><br>  override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -&gt; Bool {<br>    // Runs the default Dart entrypoint with a default Flutter route.<br>    flutterEngine.run();<br>    // Connects plugins with iOS platform code to this app.<br>    GeneratedPluginRegistrant.register(with: self.flutterEngine);<br>    return super.application(application, didFinishLaunchingWithOptions: launchOptions);<br>  }<br>}</pre><h3>Show a FlutterViewController with your FlutterEngine</h3><pre>import UIKit<br>import Flutter<br><br>class ViewController: UIViewController {<br>  override func viewDidLoad() {<br>    super.viewDidLoad()<br><br>    // Make a button to call the showFlutter function when pressed.<br>    let button = UIButton(type:UIButton.ButtonType.custom)<br>    button.addTarget(self, action: #selector(showFlutter), for: .touchUpInside)<br>    button.setTitle(&quot;Show Flutter!&quot;, for: UIControl.State.normal)<br>    button.frame = CGRect(x: 120.0, y: 120.0, width: 160.0, height: 40.0)<br>    button.backgroundColor = UIColor.blue<br>    self.view.addSubview(button)<br>  }<br><br>  @objc func showFlutter() {<br>    let flutterEngine = (UIApplication.shared.delegate as! AppDelegate).flutterEngine<br>    let flutterViewController =<br>        FlutterViewController(engine: flutterEngine, nibName: nil, bundle: nil)<br>    present(flutterViewController, animated: true, completion: nil)<br>  }<br>}</pre><p>Now, give running the app a shot. You should be able to launch your iOS app, tap the “Show Flutter!” button, and see a new Flutter screen smoothly appear.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*IV22vsimcnVxAW8bdiSChg.gif" /></figure><p>Congratulations!</p><h3>References &amp; Acknowledgments</h3><p>For further reading and a deeper understanding, please refer to “Adding Flutter to your existing iOS and Android codebases” by “<a href="https://medium.com/@ptruiz?source=post_page-----3e2c5a4797c1--------------------------------">Paul Ruiz</a>”. Thank you for inspiring and contributing to the knowledge shared in this article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83a2cccee563" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Add tap gesture to part of your label with an extension of UITapGestureRecognizer -Swift]]></title>
            <link>https://medium.com/@tolgasyn2/add-tap-gesture-to-part-of-your-label-with-an-extension-of-uitapgesturerecognizer-swift-adc6c76c6629?source=rss-8d46983d566------2</link>
            <guid isPermaLink="false">https://medium.com/p/adc6c76c6629</guid>
            <dc:creator><![CDATA[Tolga Sayan]]></dc:creator>
            <pubDate>Sat, 22 Oct 2022 15:13:20 GMT</pubDate>
            <atom:updated>2022-10-22T15:13:20.230Z</atom:updated>
            <content:encoded><![CDATA[<p>If you have a UILabel with underlined text in it and you want to give the underlined text a function property with finding accurate NSRange for location.</p><p>We need to 2 steps to implement.</p><h3><strong>1. Create an extension for UITapGestureRecognizer and add two methods inside.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FJ9VeIaghTypyGtvrlSBgA.png" /><figcaption>first method</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GkY4Q9jTwgI8QDcQMLf96w.png" /><figcaption>second method for finding location with NSRange</figcaption></figure><h3><strong>2. Make your UILabel’s text NSMutableAttributedString and add gesture to it</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SUDF9ZTS2xdDXDfLE_KXGg.png" /><figcaption>This is where you need to add gesture to your label and create a objc method for selector to make your things with your underlined string.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=adc6c76c6629" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>