[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7078":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":43,"readmeContent":44,"aiSummary":45,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":46,"discoverSource":47},7078,"SPStorkController","ivanvorobei\u002FSPStorkController","ivanvorobei","Now playing controller from Apple Music, Mail & Podcasts Apple's apps.","https:\u002F\u002Fopensource.ivanvorobei.io",null,"Swift",2742,201,38,15,0,2,59.12,"MIT License",false,"master",[23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42],"alert","animation","app","apple","controller","gester","ios11","mail","mimicrate","music","native","pop","popover","popup","similar","swift","swipe","transition","ui","up","2026-06-12 04:00:32","# SPStorkController\n\n\u003Ca href=\"https:\u002F\u002Fitunes.apple.com\u002Fapp\u002Fid1446635818\" target=\"_blank\">\u003Cimg align=\"left\" src=\"https:\u002F\u002Fgithub.com\u002Fivanvorobei\u002FSPStorkController\u002Fblob\u002Fmaster\u002FResources\u002FPreview.gif\" width=\"400\"\u002F>\u003C\u002Fa>\n\n### About\nController **as in Apple Music, Podcasts and Mail** apps. Help if you need customize height or suppport modal style in iOS 12.\n\nSimple adding close button and centering arrow indicator. Customizable height. Using custom `TransitionDelegate`.\n\nAlert you can find in [SPAlert](https:\u002F\u002Fgithub.com\u002Fivanvorobei\u002FSPAlert) project. It support diffrents presets, some animatable.\n\nIf you like the project, don't forget to `put star ★` and follow me on GitHub:\n\n\u003Cp float=\"left\">\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fivanvorobei\">\n        \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fivanvorobei\u002FReadme\u002Fblob\u002Fmain\u002FButtons\u002Ffollow-me-ivanvorobei.svg\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fopensource.ivanvorobei.by\">\n        \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fivanvorobei\u002FReadme\u002Fblob\u002Fmain\u002FButtons\u002Fmore-libraries.svg\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n## Navigate\n\n- [Requirements](#requirements)\n- [Installation](#installation)\n    - [CocoaPods](#cocoapods)\n    - [Carthage](#carthage)\n    - [Swift Package Manager](#swift-package-manager)\n    - [Manually](#manually)\n- [Quick Start](#quick-start)\n- [Usage](#usage)\n    - [Light StatusBar](#light-statusbar)\n    - [Custom Height](#custom-height)\n    - [Close Button](#close-button)\n    - [Arrow Indicator](#arrow-indicator)\n    - [Dismissing](#dismissing)\n    - [Corner Radius](#corner-radius)\n    - [Haptic](#haptic)\n    - [Snapshots](#snapshots)\n    - [Navigation Bar](#navigation-bar)\n    - [Working with UIScrollView](#working-with-uiscrollview)\n    - [UITableView & UICollectionView](#working-with-uitableview--uicollectionview)\n    - [Confirm before dismiss](#confirm-before-dismiss)\n    - [Delegate](#delegate)\n    - [Storyboard](#storyboard)\n- [Sheets in iOS 13](#sheets-in-ios-13)\n- [Other Projects](#other-projects)\n- [Russian Community](#russian-community)\n\n## Requirements\n\nSwift `4.2` & `5.0`. Ready for use on iOS 10+\n\n## Installation\n\n### CocoaPods:\n\n[CocoaPods](https:\u002F\u002Fcocoapods.org) is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate `SPStorkController` into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\npod 'SPStorkController'\n```\n\n### Carthage\n\n[Carthage](https:\u002F\u002Fgithub.com\u002FCarthage\u002FCarthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. To integrate `SPStorkController` into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"ivanvorobei\u002FSPStorkController\"\n```\n\n### Swift Package Manager\n\nThe [Swift Package Manager](https:\u002F\u002Fswift.org\u002Fpackage-manager\u002F) is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.\n\nTo integrate `SPStorkController` into your Xcode project using Xcode 11, specify it in `Project > Swift Packages`:\n\n```ogdl\nhttps:\u002F\u002Fgithub.com\u002Fivanvorobei\u002FSPStorkController\n```\n\n### Manually\n\nIf you prefer not to use any of the aforementioned dependency managers, you can integrate `SPStorkController` into your project manually. Put `Source\u002FSPStorkController` folder in your Xcode project. Make sure to enable `Copy items if needed` and `Create groups`.\n\n## Quick Start\n\nCreate controller and call func `presentAsStork`:\n\n```swift\nimport UIKit\nimport SPStorkController\n\nclass ViewController: UIViewController {\n    \n    override func viewDidAppear(_ animated: Bool) {\n        super.viewDidAppear(animated)\n\n        let controller = UIViewController()\n        self.presentAsStork(controller)\n    }\n}\n```\n\nIf you want customize controller (remove indicator, set custom height and other), create controller and set `transitioningDelegate` to `SPStorkTransitioningDelegate` object. Use `present` or `dismiss` functions:\n\n```swift\nlet controller = UIViewController()\nlet transitionDelegate = SPStorkTransitioningDelegate()\ncontroller.transitioningDelegate = transitionDelegate\ncontroller.modalPresentationStyle = .custom\ncontroller.modalPresentationCapturesStatusBarAppearance = true\nself.present(controller, animated: true, completion: nil)\n```\n\nPlease, do not init `SPStorkTransitioningDelegate` like this:\n\n```swift\ncontroller.transitioningDelegate = SPStorkTransitioningDelegate()\n```\n\nYou will get an error about weak property.\n\n## Usage\n\n### Light StatusBar\n\nTo set light status bar for presented controller, use `preferredStatusBarStyle` property. Also set `modalPresentationCapturesStatusBarAppearance`. See example:\n\n```swift\nimport UIKit\n\nclass ModalViewController: UIViewController {\n    \n    override var preferredStatusBarStyle: UIStatusBarStyle {\n        return .lightContent\n    }\n}\n```\n\n### Custom Height\n\nProperty `customHeight` sets custom height for controller. Default is `nil`:\n\n```swift\ntransitionDelegate.customHeight = 350\n```\n\n### Close Button\n\nProperty `showCloseButton` added circle button with dismiss action. Default is `false`:\n```swift\ntransitionDelegate.showCloseButton = false\n```\n\n### Arrow Indicator\n\nOn the top of controller you can add arrow indicator with animatable states. It simple configure.\nProperty `showIndicator` shows or hides top arrow indicator. Default is `true`:\n\n```swift\ntransitionDelegate.showIndicator = true\n```\n\nProperty Parameter `indicatorColor` for customize color of arrow. Default is `gray`:\n\n```swift\ntransitionDelegate.indicatorColor = UIColor.white\n```\n\nProperty `hideIndicatorWhenScroll` shows or hides indicator when scrolling. Default is `false`:\n\n```swift\ntransitionDelegate.hideIndicatorWhenScroll = true\n```\n\nYou can set always line or arrow indicator. Set `indicatorMode`:\n\n```swift\ntransitionDelegate.indicatorMode = .alwaysLine\n```\n\n### Dismissing\n\nYou can also configure events that will dimiss the controller.\nProperty `swipeToDismissEnabled` enables dismissal by swipe gesture. Default is `true`:\n\n```swift\ntransitionDelegate.swipeToDismissEnabled = true\n```\n\nProperty `translateForDismiss` sets how much need to swipe down to close the controller. Work only if `swipeToDismissEnabled` is true. Default is `240`:\n\n```swift\ntransitionDelegate.translateForDismiss = 100\n```\n\nProperty `tapAroundToDismissEnabled` enables dismissal by tapping parent controller. Default is `true`:\n\n```swift\ntransitionDelegate.tapAroundToDismissEnabled = true\n```\n\n### Corner Radius\n\nProperty `cornerRadius` for customize corner radius of controller's view. Default is `10`:\n\n```swift\ntransitionDelegate.cornerRadius = 10\n```\n\n### Haptic\n\nProperty `hapticMoments` allow add taptic feedback for some moments. Default is `.willDismissIfRelease`:\n\n```swift\ntransitionDelegate.hapticMoments = [.willPresent, .willDismiss]\n```\n\n### Snapshots\n\nThe project uses a snapshot of the screen in order to avoid compatibility and customisation issues. Before controller presentation, a snapshot of the parent view is made, and size and position are changed for the snapshot. Sometimes you will need to update the screenshot of the parent view, for that use static func:\n\n```swift\nSPStorkController.updatePresentingController(modal: controller)\n```\n\nand pass the controller, which is modal and uses `SPStorkTransitioningDelegate`.\n\nIf the parent controller scrollings and you try to show `SPStorkController`, you will see how it froze, and in a second its final position is updated. I recommend before present `SPStorkController`  stop scrolling force:\n\n```swift \nscrollView.setContentOffset(self.contentOffset, animated: false)\n```\n\n### Navigation Bar\n\nYou may want to add a navigation bar to your modal controller. Since it became impossible to change or customize the native controller in swift 4 (I couldn’t even find a way to change the height of the bar), I had to recreate navigation bar from the ground up. Visually it looks real, but it doesn’t execute the necessary functions:\n\n```swift\nimport UIKit\nimport SPFakeBar\n\nclass ModalController: UIViewController {\n    \n    let navBar = SPFakeBarView(style: .stork)\n        \n    override func viewDidLoad() {\n        super.viewDidLoad()\n\n        self.view.backgroundColor = UIColor.white\n\n        self.navBar.titleLabel.text = \"Title\"\n        self.navBar.leftButton.setTitle(\"Cancel\", for: .normal)\n        self.navBar.leftButton.addTarget(self, action: #selector(self.dismissAction), for: .touchUpInside)\n\n        self.view.addSubview(self.navBar)\n    }\n}\n```\n\nYou only need to add a navigation bar to the main view, it will automatically layout. Use style `.stork` in init of `SPFakeBarView`. Here is visual preview with Navigation Bar and without it:\n\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fivanvorobei\u002FSPStorkController\u002Fblob\u002Fmaster\u002FResources\u002FNavigation%20Bar.jpg\"\u002F>\n\nTo use it, you need to install [SPFakeBar](https:\u002F\u002Fgithub.com\u002Fivanvorobei\u002FSPFakeBar) pod: \n\n```ruby\npod 'SPFakeBar'\n```\n\n### Working with UIScrollView\n\nIf you use `UIScrollView` (or UITableView & UICollectionView) on controller, I recommend making it more interactive. When scrolling reaches the top position, the controller will interactively drag down, simulating a closing animation. Also available close controller by drag down on `UIScrollView`. To do this, set the delegate and in the function `scrollViewDidScroll` call:\n\n```swift\nfunc scrollViewDidScroll(_ scrollView: UIScrollView) {\n    SPStorkController.scrollViewDidScroll(scrollView)\n}\n```\n\n### Working with UITableView & UICollectionView\n\nWorking with a collections classes is not difficult. In the `Example` folder you can find an implementation. However, I will give a couple of tips for making the table look better.\n\nFirstly, if you use `SPFakeBarView`, don't forget to set top insets for content & scroll indicator. Also, I recommend setting bottom insets (it optional):\n\n```swift\ntableView.contentInset.top = self.navBar.height\ntableView.scrollIndicatorInsets.top = self.navBar.height\n```\n\nPlease, also use `SPStorkController.scrollViewDidScroll` function in scroll delegate for more interactiveness with your collection or table view.\n\n### Confirm before dismiss\n\nFor confirm closing by swipe, tap around, close button and indicator use `SPStorkControllerConfirmDelegate`. Implenet protocol:\n\n```swift\n@objc public protocol SPStorkControllerConfirmDelegate: class {\n    \n    var needConfirm: Bool { get }\n    \n    func confirm(_ completion: @escaping (_ isConfirmed: Bool)->())\n}\n```\n\nand set `confirmDelegate` property to object, which protocol impleneted. Function `confirm` call if `needConfirm` return true. Pass `isConfirmed` with result. Best options use `UIAlertController` with `.actionSheet` style for confirmation.\n\nIf you use custom buttons, in the target use this code:\n\n```swift\nSPStorkController.dismissWithConfirmation(controller: self, completion: nil)\n```\n\nIt call `confirm` func and check result of confirmation. See example project for more details.\n\n### Delegate\n\nYou can check events by implement `SPStorkControllerDelegate` and set delegate for `transitionDelegate`:\n\n```swift\ntransitionDelegate.storkDelegate = self\n```\n\nDelagate has this functions: \n\n```swift\nprotocol SPStorkControllerDelegate: class {\n    \n    optional func didDismissStorkBySwipe()\n    \n    optional func didDismissStorkByTap()\n}\n```\n\n### Storyboard\n\nIf need using `SPStorkController` with storyboard, set class `SPStorkSegue` for transition setting in storyboard file. I will give the class code so that you understand what it does:\n\n```swift\nimport UIKit\n\nclass SPStorkSegue: UIStoryboardSegue {\n    \n    public var transitioningDelegate: SPStorkTransitioningDelegate?\n    \n    override func perform() {\n        transitioningDelegate = transitioningDelegate ?? SPStorkTransitioningDelegate()\n        destination.transitioningDelegate = transitioningDelegate\n        destination.modalPresentationStyle = .custom\n        super.perform()\n    }\n}\n```\n\nOpen your storyboard, choose transition and open right menu. Open `Attributes Inspector` and in Class section insert `SPStorkSegue`.\n\n### Modal presentation of other controller\n\nIf you want to present modal controller on `SPStorkController`, please set:\n\n```swift\ncontroller.modalPresentationStyle = .custom\n```\n\nIt’s needed for correct presentation and dismissal of all modal controllers.\n\n## Sheets in iOS 13\n\nApple present in `WWDC 2019` new modal presentation style - `Sheets`. It ready use Support interactive dismiss and work with navigations bars. Available since iOS 13. I will add more information when I study this in more detail. You can see presentation [here](https:\u002F\u002Fdeveloper.apple.com\u002Fvideos\u002Fplay\u002Fwwdc2019\u002F224\u002F).\n\n\u003Ca href=\"https:\u002F\u002Fdeveloper.apple.com\u002Fvideos\u002Fplay\u002Fwwdc2019\u002F224\u002F\" target=\"_blank\">\u003Cimg align=\"center\" src=\"https:\u002F\u002Fgithub.com\u002Fivanvorobei\u002FSPStorkController\u002Fblob\u002Fmaster\u002FResources\u002FSheets.png\"\u002F>\u003C\u002Fa>\n\n## Other Projects\n\nI love being helpful. Here I have provided a list of libraries that I keep up to date. For see `video previews` of libraries without install open [opensource.ivanvorobei.by](https:\u002F\u002Fopensource.ivanvorobei.by) website.\u003Cbr>\nI have libraries with native interface and managing permissions. Also available pack of useful extensions for boost your development process.\n\n\u003Cp float=\"left\">\n    \u003Ca href=\"https:\u002F\u002Fopensource.ivanvorobei.by\">\n        \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fivanvorobei\u002FReadme\u002Fblob\u002Fmain\u002FButtons\u002Fmore-libraries.svg\">\n    \u003C\u002Fa>\n        \u003Ca href=\"https:\u002F\u002Fxcodeshop.ivanvorobei.by\">\n        \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fivanvorobei\u002FReadme\u002Fblob\u002Fmain\u002FButtons\u002Fxcode-shop.svg\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n## Russian Community\n\nПодписывайся в телеграмм-канал, если хочешь получать уведомления о новых туториалах.\u003Cbr>\nСо сложными и непонятными задачами помогут в чате.\n\n\u003Cp float=\"left\">\n    \u003Ca href=\"https:\u002F\u002Ftutorials.ivanvorobei.by\u002Ftelegram\u002Fchannel\">\n        \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fivanvorobei\u002FReadme\u002Fblob\u002Fmain\u002FButtons\u002Fopen-telegram-channel.svg\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Ftutorials.ivanvorobei.by\u002Ftelegram\u002Fchat\">\n        \u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fivanvorobei\u002FReadme\u002Fblob\u002Fmain\u002FButtons\u002Frussian-community-chat.svg\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\nВидео-туториалы выклыдываю на [YouTube](https:\u002F\u002Ftutorials.ivanvorobei.by\u002Fyoutube):\n\n[![Tutorials on YouTube](https:\u002F\u002Fcdn.ivanvorobei.by\u002Fgithub\u002Freadme\u002Fyoutube-preview.jpg)](https:\u002F\u002Ftutorials.ivanvorobei.by\u002Fyoutube)\n","SPStorkController 是一个模仿 Apple Music、Podcasts 和 Mail 应用中播放控制器的 iOS 控件。它支持自定义高度和在 iOS 12 中以模态样式展示，同时提供了一个简单的关闭按钮和居中的箭头指示器。该项目使用了自定义的 `TransitionDelegate` 来实现平滑的过渡动画，并且可以轻松集成到现有的 Swift 项目中。SPStorkController 适用于需要类似苹果原生应用弹出控制器功能的场景，如音乐播放界面或邮件详情页等。项目采用 MIT 许可证开源，提供了多种安装方式，包括 CocoaPods、Carthage 和 Swift Package Manager，方便开发者按需选择。","2026-06-11 03:10:27","top_language"]