<?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: JerryFans</title>
    <description>The latest articles on DEV Community by JerryFans (@jerryfans).</description>
    <link>https://dev.to/jerryfans</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%2F724731%2F9cebb831-a46b-4841-a797-f298f194f185.jpeg</url>
      <title>DEV Community: JerryFans</title>
      <link>https://dev.to/jerryfans</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jerryfans"/>
    <language>en</language>
    <item>
      <title>JFPopup-A iOS Swift Kit Help You Popup your Custom View In A Easy Way</title>
      <dc:creator>JerryFans</dc:creator>
      <pubDate>Wed, 13 Oct 2021 11:45:58 +0000</pubDate>
      <link>https://dev.to/jerryfans/jfpopup-a-ios-swift-kit-help-you-popup-your-custom-view-in-a-easy-way-b5o</link>
      <guid>https://dev.to/jerryfans/jfpopup-a-ios-swift-kit-help-you-popup-your-custom-view-in-a-easy-way-b5o</guid>
      <description>&lt;p&gt;JFPopup is a Swift Module help you popup your custom view easily.&lt;/p&gt;

&lt;p&gt;Support 3 way to popup, Drawer, Dialog and BottomSheet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;To run the example project, clone the repo, and run &lt;code&gt;pod install&lt;/code&gt; from the Example directory first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Create your popup view
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Dialog
&lt;/h3&gt;

&lt;p&gt;dialog mode, like UIAlertConroller, you also can use your custom alert view&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;self.popup.dialog {
            let v = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: 200))
            v.backgroundColor = .red
            return v
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Z58vXwtN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/http://image.jerryfans.com/dialog.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Z58vXwtN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/http://image.jerryfans.com/dialog.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Drawer
&lt;/h3&gt;

&lt;p&gt;drawer mode , support direction left or right&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//default left
self.popup.drawer {
            let v = DrawerView(frame: CGRect(x: 0, y: 0, width: CGSize.jf.screenWidth(), height: CGSize.jf.screenHeight()))
            v.closeHandle = { [weak self] in
                self?.popup.dismiss()
            }
            return v
        }

self.popup.drawer(with: .right) {
            let v = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: CGSize.jf.screenHeight()))
            v.backgroundColor = .red
            return v
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g7mnFE88--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/http://image.jerryfans.com/drawer.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g7mnFE88--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/http://image.jerryfans.com/drawer.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Bottomsheet
&lt;/h3&gt;

&lt;p&gt;Like Flutter Bottomsheet, popup a custom container from bottom 。 You alose can use this mode to build your custom UIActionSheet.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;self.popup.bottomSheet {
            let v = UIView(frame: CGRect(x: 0, y: 0, width: CGSize.jf.screenWidth(), height: 300))
            v.backgroundColor = .red
            return v
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1aAkmh8E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/http://image.jerryfans.com/bottom_sheet.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1aAkmh8E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/http://image.jerryfans.com/bottom_sheet.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Gerenal Kit
&lt;/h3&gt;

&lt;p&gt;Wechat Style ActionSheet&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;self.popup.actionSheet {
            [
                JFPopupAction(with: "拍摄", subTitle: "照片或视频照片", clickActionCallBack: { [weak self] in
                    self?.pushVC()
                }),
                JFPopupAction(with: "从手机相册选择", subTitle: nil, clickActionCallBack: {

                }),
                JFPopupAction(with: "用秒剪制作视频", subTitle: nil, clickActionCallBack: {

                }),
            ]
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v0Ke3SI3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/http://image.jerryfans.com/wechat_sheet.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v0Ke3SI3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/http://image.jerryfans.com/wechat_sheet.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create With VC Mode
&lt;/h2&gt;

&lt;p&gt;This way suggest to adapt Objc, you can write your entension method to compatibility Objc.&lt;/p&gt;

&lt;p&gt;Extends Base PopUpVC （Like Extends UITableview to write your custom table view）&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var config = JFPopupConfig.bottomSheet
        config.isDismissible = false
        let vc = TestCustomViewController(with: config)
        vc.show(with: self)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Call Back Way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var config = JFPopupConfig.dialog
        config.bgColor = .clear
        let vc = JFPopupController(with: config, popupProtocol: self) {
            let view: UIView = {
                let view = UIView()
                view.frame = CGRect(x: 0, y: 0, width: 200, height: 200)
                view.layer.cornerRadius = 12
                view.backgroundColor = .black
                return view
            }()
            return view
        }
        vc.show(with: self)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;JFPopup is available through &lt;a href="https://cocoapods.org"&gt;CocoaPods&lt;/a&gt;. To install&lt;br&gt;
it, simply add the following line to your Podfile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;pod&lt;/span&gt; &lt;span class="s1"&gt;'JFPopup'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'1.0.0'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Author
&lt;/h2&gt;

&lt;p&gt;JerryFans, &lt;a href="mailto:fanjiarong_haohao@163.com"&gt;fanjiarong_haohao@163.com&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  License
&lt;/h2&gt;

&lt;p&gt;JFPopup is available under the MIT license. See the LICENSE file for more info.&lt;/p&gt;

</description>
      <category>ios</category>
    </item>
    <item>
      <title>JFPopup-A iOS Swift Kit Help You Popup your Custom View In A Easy Way </title>
      <dc:creator>JerryFans</dc:creator>
      <pubDate>Wed, 13 Oct 2021 10:45:00 +0000</pubDate>
      <link>https://dev.to/jerryfans/jfpopup-a-swift-kit-help-you-popup-your-custom-view-in-a-easy-way-39fo</link>
      <guid>https://dev.to/jerryfans/jfpopup-a-swift-kit-help-you-popup-your-custom-view-in-a-easy-way-39fo</guid>
      <description>&lt;h1&gt;
  
  
  JFPopup
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Github
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/JerryFans/JFPopup"&gt;https://github.com/JerryFans/JFPopup&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;JFPopup is a Swift Module help you popup your custom view easily.&lt;/p&gt;

&lt;p&gt;Support 3 way to popup, Drawer, Dialog and BottomSheet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Example
&lt;/h2&gt;

&lt;p&gt;To run the example project, clone the repo, and run &lt;code&gt;pod install&lt;/code&gt; from the Example directory first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Create your popup view
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Dialog
&lt;/h3&gt;

&lt;p&gt;dialog mode, like UIAlertConroller, you also can use your custom alert view&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;self.popup.dialog {
            let v = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: 200))
            v.backgroundColor = .red
            return v
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Z58vXwtN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/http://image.jerryfans.com/dialog.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Z58vXwtN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/http://image.jerryfans.com/dialog.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Drawer
&lt;/h3&gt;

&lt;p&gt;drawer mode , support direction left or right&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;//default left
self.popup.drawer {
            let v = DrawerView(frame: CGRect(x: 0, y: 0, width: CGSize.jf.screenWidth(), height: CGSize.jf.screenHeight()))
            v.closeHandle = { [weak self] in
                self?.popup.dismiss()
            }
            return v
        }

self.popup.drawer(with: .right) {
            let v = UIView(frame: CGRect(x: 0, y: 0, width: 200, height: CGSize.jf.screenHeight()))
            v.backgroundColor = .red
            return v
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--g7mnFE88--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/http://image.jerryfans.com/drawer.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g7mnFE88--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/http://image.jerryfans.com/drawer.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Bottomsheet
&lt;/h3&gt;

&lt;p&gt;Like Flutter Bottomsheet, popup a custom container from bottom 。 You alose can use this mode to build your custom UIActionSheet.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;self.popup.bottomSheet {
            let v = UIView(frame: CGRect(x: 0, y: 0, width: CGSize.jf.screenWidth(), height: 300))
            v.backgroundColor = .red
            return v
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1aAkmh8E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/http://image.jerryfans.com/bottom_sheet.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1aAkmh8E--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/http://image.jerryfans.com/bottom_sheet.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Gerenal Kit
&lt;/h3&gt;

&lt;p&gt;Wechat Style ActionSheet&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;self.popup.actionSheet {
            [
                JFPopupAction(with: "拍摄", subTitle: "照片或视频照片", clickActionCallBack: { [weak self] in
                    self?.pushVC()
                }),
                JFPopupAction(with: "从手机相册选择", subTitle: nil, clickActionCallBack: {

                }),
                JFPopupAction(with: "用秒剪制作视频", subTitle: nil, clickActionCallBack: {

                }),
            ]
        }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--v0Ke3SI3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/http://image.jerryfans.com/wechat_sheet.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--v0Ke3SI3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/http://image.jerryfans.com/wechat_sheet.gif" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create With VC Mode
&lt;/h2&gt;

&lt;p&gt;This way suggest to adapt Objc, you can write your entension method to compatibility Objc.&lt;/p&gt;

&lt;p&gt;Extends Base PopUpVC （Like Extends UITableview to write your custom table view）&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var config = JFPopupConfig.bottomSheet
        config.isDismissible = false
        let vc = TestCustomViewController(with: config)
        vc.show(with: self)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Call Back Way&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var config = JFPopupConfig.dialog
        config.bgColor = .clear
        let vc = JFPopupController(with: config, popupProtocol: self) {
            let view: UIView = {
                let view = UIView()
                view.frame = CGRect(x: 0, y: 0, width: 200, height: 200)
                view.layer.cornerRadius = 12
                view.backgroundColor = .black
                return view
            }()
            return view
        }
        vc.show(with: self)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;JFPopup is available through &lt;a href="https://cocoapods.org"&gt;CocoaPods&lt;/a&gt;. To install&lt;br&gt;
it, simply add the following line to your Podfile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;pod&lt;/span&gt; &lt;span class="s1"&gt;'JFPopup'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'1.0.0'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Author
&lt;/h2&gt;

&lt;p&gt;JerryFans, &lt;a href="mailto:fanjiarong_haohao@163.com"&gt;fanjiarong_haohao@163.com&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  License
&lt;/h2&gt;

&lt;p&gt;JFPopup is available under the MIT license. See the LICENSE file for more info.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
