├── .gitignore ├── .swift-version ├── Dismissable-Demo ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── motionbook.imageset │ │ ├── Contents.json │ │ └── iTunesArtwork.pdf ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── BaseNavigationController.swift ├── DetailViewController.swift ├── Info.plist └── ViewController.swift ├── Dismissable.podspec ├── Dismissable.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── Dismissable ├── DismissAnimator.swift ├── DismissInteractor.swift ├── DismissTriggerUsable.swift ├── Dismissable.h ├── DismissableUsable.swift ├── Info.plist └── UIViewController+Dismissable.swift ├── LICENSE ├── README.md └── image └── Dismissable.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | # Package.pins 40 | # Package.resolved 41 | .build/ 42 | 43 | # CocoaPods 44 | # 45 | # We recommend against adding the Pods directory to your .gitignore. However 46 | # you should judge for yourself, the pros and cons are mentioned at: 47 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 48 | # 49 | # Pods/ 50 | 51 | # Carthage 52 | # 53 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 54 | # Carthage/Checkouts 55 | 56 | Carthage/Build 57 | 58 | # fastlane 59 | # 60 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 61 | # screenshots whenever they are needed. 62 | # For more information about the recommended setup visit: 63 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 64 | 65 | fastlane/report.xml 66 | fastlane/Preview.html 67 | fastlane/screenshots/**/*.png 68 | fastlane/test_output 69 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 4.2 -------------------------------------------------------------------------------- /Dismissable-Demo/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Dismissable-Demo 4 | // 5 | // Created by Seungyoun Yi on 06/02/2019. 6 | // Copyright © 2019 Seungyoun Yi. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Dismissable-Demo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /Dismissable-Demo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Dismissable-Demo/Assets.xcassets/motionbook.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "iTunesArtwork.pdf" 6 | } 7 | ], 8 | "info" : { 9 | "version" : 1, 10 | "author" : "xcode" 11 | } 12 | } -------------------------------------------------------------------------------- /Dismissable-Demo/Assets.xcassets/motionbook.imageset/iTunesArtwork.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/younatics/Dismissable/bfc49fc52228ffb2e2d1eaed6c76d600a69ee1d2/Dismissable-Demo/Assets.xcassets/motionbook.imageset/iTunesArtwork.pdf -------------------------------------------------------------------------------- /Dismissable-Demo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /Dismissable-Demo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | -------------------------------------------------------------------------------- /Dismissable-Demo/BaseNavigationController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BaseNavigationController.swift 3 | // Dismissable-Demo 4 | // 5 | // Created by Seungyoun Yi on 22/03/2019. 6 | // Copyright © 2019 Seungyoun Yi. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Dismissable 11 | 12 | class BaseNavigationController: UINavigationController, DismissableUsable { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /Dismissable-Demo/DetailViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DetailViewController.swift 3 | // FlexibleViewController-Demo 4 | // 5 | // Created by Seungyoun Yi on 03/02/2019. 6 | // Copyright © 2019 Seungyoun Yi. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Dismissable 11 | 12 | class DetailViewController: UIViewController { 13 | @IBOutlet weak var tableView: UITableView! 14 | 15 | override func viewDidLoad() { 16 | super.viewDidLoad() 17 | 18 | self.tableView.dataSource = self 19 | self.tableView.delegate = self 20 | } 21 | 22 | @IBAction func closeButtonClicked(_ sender: UIButton) { 23 | self.dismiss(animated: true, completion: nil) 24 | } 25 | } 26 | 27 | extension DetailViewController: UITableViewDataSource { 28 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 29 | return 20 30 | } 31 | 32 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 33 | switch indexPath.row { 34 | case 0: 35 | let cell = tableView.dequeueReusableCell(withIdentifier: "first") 36 | return cell! 37 | case 1: 38 | let cell = tableView.dequeueReusableCell(withIdentifier: "second") 39 | return cell! 40 | case 2: 41 | let cell = tableView.dequeueReusableCell(withIdentifier: "third") 42 | return cell! 43 | 44 | default: 45 | let cell = tableView.dequeueReusableCell(withIdentifier: "third") 46 | return cell! 47 | } 48 | } 49 | } 50 | 51 | extension DetailViewController: UITableViewDelegate { 52 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 53 | let vc = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "detail") as! DetailViewController 54 | self.navigationController?.pushViewController(vc, animated: true) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Dismissable-Demo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Dismissable-Demo/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // FlexibleViewController-Demo 4 | // 5 | // Created by Seungyoun Yi on 03/02/2019. 6 | // Copyright © 2019 Seungyoun Yi. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | import Dismissable 11 | 12 | class ViewController: UIViewController, DismissTriggerUsable { 13 | var dismissAnimator: DismissAnimator = { 14 | let animator = DismissAnimator() 15 | animator.transitionDuration = 0.35 16 | animator.dimmedViewStartColor = UIColor.black.withAlphaComponent(0.4) 17 | animator.dimmedViewEndColor = UIColor.black.withAlphaComponent(0) 18 | return animator 19 | }() 20 | 21 | @IBOutlet weak var tableView: UITableView! 22 | 23 | override func viewDidLoad() { 24 | super.viewDidLoad() 25 | 26 | tableView.delegate = self 27 | tableView.dataSource = self 28 | } 29 | } 30 | 31 | extension ViewController: UITableViewDelegate { 32 | func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 33 | tableView.deselectRow(at: indexPath, animated: true) 34 | 35 | let vc = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "detail") as! DetailViewController 36 | var navi = BaseNavigationController(rootViewController: vc) 37 | navi.setup(self) 38 | self.present(navi, animated: true , completion: nil) 39 | } 40 | } 41 | 42 | extension ViewController: UITableViewDataSource { 43 | func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 44 | return 30 45 | } 46 | 47 | func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 48 | let cell = tableView.dequeueReusableCell(withIdentifier: "cell") 49 | return cell! 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Dismissable.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint YNDropDownMenu.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'Dismissable' 11 | s.version = '1.3.0' 12 | s.summary = 'Magical way to pull to dismiss your modal view!' 13 | 14 | s.description = <<-DESC 15 | Magic will be happened when you use Dismissable! 16 | DESC 17 | 18 | s.homepage = 'https://github.com/younatics/Dismissable' 19 | s.license = { :type => 'MIT', :file => 'LICENSE' } 20 | s.author = { "Seungyoun Yi" => "younatics@gmail.com" } 21 | 22 | s.source = { :git => 'https://github.com/younatics/Dismissable.git', :tag => s.version.to_s } 23 | s.source_files = 'Dismissable/*.swift' 24 | 25 | s.ios.deployment_target = '9.0' 26 | s.frameworks = 'UIKit' 27 | s.requires_arc = true 28 | end 29 | -------------------------------------------------------------------------------- /Dismissable.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 19165B902243FA05006D7FC9 /* BaseNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19165B8F2243FA05006D7FC9 /* BaseNavigationController.swift */; }; 11 | 199953B5220AF1A900A59D3B /* Dismissable.h in Headers */ = {isa = PBXBuildFile; fileRef = 199953B3220AF1A900A59D3B /* Dismissable.h */; settings = {ATTRIBUTES = (Public, ); }; }; 12 | 19E47C88220AF2000025DBC0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E47C87220AF2000025DBC0 /* AppDelegate.swift */; }; 13 | 19E47C8A220AF2000025DBC0 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E47C89220AF2000025DBC0 /* ViewController.swift */; }; 14 | 19E47C8D220AF2000025DBC0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 19E47C8B220AF2000025DBC0 /* Main.storyboard */; }; 15 | 19E47C8F220AF2010025DBC0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 19E47C8E220AF2010025DBC0 /* Assets.xcassets */; }; 16 | 19E47C92220AF2010025DBC0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 19E47C90220AF2010025DBC0 /* LaunchScreen.storyboard */; }; 17 | 19E47C9B220AF2370025DBC0 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E47C97220AF2370025DBC0 /* DetailViewController.swift */; }; 18 | 19E47CA1220AF23F0025DBC0 /* DismissableUsable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E47C9F220AF23F0025DBC0 /* DismissableUsable.swift */; }; 19 | 19E47CA2220AF23F0025DBC0 /* DismissAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E47CA0220AF23F0025DBC0 /* DismissAnimator.swift */; }; 20 | 19E47CA4220AF2B90025DBC0 /* DismissInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E47CA3220AF2B90025DBC0 /* DismissInteractor.swift */; }; 21 | 19E47CA6220AF2F40025DBC0 /* DismissTriggerUsable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19E47CA5220AF2F40025DBC0 /* DismissTriggerUsable.swift */; }; 22 | 19E47CA8220AF3FD0025DBC0 /* Dismissable.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 199953B0220AF1A900A59D3B /* Dismissable.framework */; }; 23 | 19E47CAA220AF8460025DBC0 /* Dismissable.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 199953B0220AF1A900A59D3B /* Dismissable.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 24 | CE5B4099220D3EAA009C3066 /* UIViewController+Dismissable.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE5B4098220D3EAA009C3066 /* UIViewController+Dismissable.swift */; }; 25 | /* End PBXBuildFile section */ 26 | 27 | /* Begin PBXContainerItemProxy section */ 28 | 19E47CAB220AF8460025DBC0 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 199953A7220AF1A900A59D3B /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 199953AF220AF1A900A59D3B; 33 | remoteInfo = Dismissable; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXCopyFilesBuildPhase section */ 38 | 19E47CAD220AF8460025DBC0 /* Embed Frameworks */ = { 39 | isa = PBXCopyFilesBuildPhase; 40 | buildActionMask = 2147483647; 41 | dstPath = ""; 42 | dstSubfolderSpec = 10; 43 | files = ( 44 | 19E47CAA220AF8460025DBC0 /* Dismissable.framework in Embed Frameworks */, 45 | ); 46 | name = "Embed Frameworks"; 47 | runOnlyForDeploymentPostprocessing = 0; 48 | }; 49 | /* End PBXCopyFilesBuildPhase section */ 50 | 51 | /* Begin PBXFileReference section */ 52 | 19165B8F2243FA05006D7FC9 /* BaseNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseNavigationController.swift; sourceTree = ""; }; 53 | 199953B0220AF1A900A59D3B /* Dismissable.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Dismissable.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 199953B3220AF1A900A59D3B /* Dismissable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Dismissable.h; sourceTree = ""; }; 55 | 199953B4220AF1A900A59D3B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | 19E47C85220AF2000025DBC0 /* Dismissable-Demo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Dismissable-Demo.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | 19E47C87220AF2000025DBC0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 58 | 19E47C89220AF2000025DBC0 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 59 | 19E47C8C220AF2000025DBC0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 60 | 19E47C8E220AF2010025DBC0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 61 | 19E47C91220AF2010025DBC0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 62 | 19E47C93220AF2010025DBC0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 63 | 19E47C97220AF2370025DBC0 /* DetailViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = ""; }; 64 | 19E47C9F220AF23F0025DBC0 /* DismissableUsable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DismissableUsable.swift; sourceTree = ""; }; 65 | 19E47CA0220AF23F0025DBC0 /* DismissAnimator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DismissAnimator.swift; sourceTree = ""; }; 66 | 19E47CA3220AF2B90025DBC0 /* DismissInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DismissInteractor.swift; sourceTree = ""; }; 67 | 19E47CA5220AF2F40025DBC0 /* DismissTriggerUsable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DismissTriggerUsable.swift; sourceTree = ""; }; 68 | CE5B4098220D3EAA009C3066 /* UIViewController+Dismissable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIViewController+Dismissable.swift"; sourceTree = ""; }; 69 | /* End PBXFileReference section */ 70 | 71 | /* Begin PBXFrameworksBuildPhase section */ 72 | 199953AD220AF1A900A59D3B /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | ); 77 | runOnlyForDeploymentPostprocessing = 0; 78 | }; 79 | 19E47C82220AF2000025DBC0 /* Frameworks */ = { 80 | isa = PBXFrameworksBuildPhase; 81 | buildActionMask = 2147483647; 82 | files = ( 83 | 19E47CA8220AF3FD0025DBC0 /* Dismissable.framework in Frameworks */, 84 | ); 85 | runOnlyForDeploymentPostprocessing = 0; 86 | }; 87 | /* End PBXFrameworksBuildPhase section */ 88 | 89 | /* Begin PBXGroup section */ 90 | 199953A6220AF1A900A59D3B = { 91 | isa = PBXGroup; 92 | children = ( 93 | 199953B2220AF1A900A59D3B /* Dismissable */, 94 | 19E47C86220AF2000025DBC0 /* Dismissable-Demo */, 95 | 199953B1220AF1A900A59D3B /* Products */, 96 | 19E47CA7220AF3FD0025DBC0 /* Frameworks */, 97 | ); 98 | sourceTree = ""; 99 | }; 100 | 199953B1220AF1A900A59D3B /* Products */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 199953B0220AF1A900A59D3B /* Dismissable.framework */, 104 | 19E47C85220AF2000025DBC0 /* Dismissable-Demo.app */, 105 | ); 106 | name = Products; 107 | sourceTree = ""; 108 | }; 109 | 199953B2220AF1A900A59D3B /* Dismissable */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | CE5B4098220D3EAA009C3066 /* UIViewController+Dismissable.swift */, 113 | 19E47CA0220AF23F0025DBC0 /* DismissAnimator.swift */, 114 | 19E47CA5220AF2F40025DBC0 /* DismissTriggerUsable.swift */, 115 | 19E47C9F220AF23F0025DBC0 /* DismissableUsable.swift */, 116 | 19E47CA3220AF2B90025DBC0 /* DismissInteractor.swift */, 117 | 199953B3220AF1A900A59D3B /* Dismissable.h */, 118 | 199953B4220AF1A900A59D3B /* Info.plist */, 119 | ); 120 | path = Dismissable; 121 | sourceTree = ""; 122 | }; 123 | 19E47C86220AF2000025DBC0 /* Dismissable-Demo */ = { 124 | isa = PBXGroup; 125 | children = ( 126 | 19E47C89220AF2000025DBC0 /* ViewController.swift */, 127 | 19E47C97220AF2370025DBC0 /* DetailViewController.swift */, 128 | 19165B8F2243FA05006D7FC9 /* BaseNavigationController.swift */, 129 | 19E47C8B220AF2000025DBC0 /* Main.storyboard */, 130 | 19E47C87220AF2000025DBC0 /* AppDelegate.swift */, 131 | 19E47C8E220AF2010025DBC0 /* Assets.xcassets */, 132 | 19E47C90220AF2010025DBC0 /* LaunchScreen.storyboard */, 133 | 19E47C93220AF2010025DBC0 /* Info.plist */, 134 | ); 135 | path = "Dismissable-Demo"; 136 | sourceTree = ""; 137 | }; 138 | 19E47CA7220AF3FD0025DBC0 /* Frameworks */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | ); 142 | name = Frameworks; 143 | sourceTree = ""; 144 | }; 145 | /* End PBXGroup section */ 146 | 147 | /* Begin PBXHeadersBuildPhase section */ 148 | 199953AB220AF1A900A59D3B /* Headers */ = { 149 | isa = PBXHeadersBuildPhase; 150 | buildActionMask = 2147483647; 151 | files = ( 152 | 199953B5220AF1A900A59D3B /* Dismissable.h in Headers */, 153 | ); 154 | runOnlyForDeploymentPostprocessing = 0; 155 | }; 156 | /* End PBXHeadersBuildPhase section */ 157 | 158 | /* Begin PBXNativeTarget section */ 159 | 199953AF220AF1A900A59D3B /* Dismissable */ = { 160 | isa = PBXNativeTarget; 161 | buildConfigurationList = 199953B8220AF1A900A59D3B /* Build configuration list for PBXNativeTarget "Dismissable" */; 162 | buildPhases = ( 163 | 199953AB220AF1A900A59D3B /* Headers */, 164 | 199953AC220AF1A900A59D3B /* Sources */, 165 | 199953AD220AF1A900A59D3B /* Frameworks */, 166 | 199953AE220AF1A900A59D3B /* Resources */, 167 | ); 168 | buildRules = ( 169 | ); 170 | dependencies = ( 171 | ); 172 | name = Dismissable; 173 | productName = Dismissable; 174 | productReference = 199953B0220AF1A900A59D3B /* Dismissable.framework */; 175 | productType = "com.apple.product-type.framework"; 176 | }; 177 | 19E47C84220AF2000025DBC0 /* Dismissable-Demo */ = { 178 | isa = PBXNativeTarget; 179 | buildConfigurationList = 19E47C96220AF2010025DBC0 /* Build configuration list for PBXNativeTarget "Dismissable-Demo" */; 180 | buildPhases = ( 181 | 19E47C81220AF2000025DBC0 /* Sources */, 182 | 19E47C82220AF2000025DBC0 /* Frameworks */, 183 | 19E47C83220AF2000025DBC0 /* Resources */, 184 | 19E47CAD220AF8460025DBC0 /* Embed Frameworks */, 185 | ); 186 | buildRules = ( 187 | ); 188 | dependencies = ( 189 | 19E47CAC220AF8460025DBC0 /* PBXTargetDependency */, 190 | ); 191 | name = "Dismissable-Demo"; 192 | productName = "Dismissable-Demo"; 193 | productReference = 19E47C85220AF2000025DBC0 /* Dismissable-Demo.app */; 194 | productType = "com.apple.product-type.application"; 195 | }; 196 | /* End PBXNativeTarget section */ 197 | 198 | /* Begin PBXProject section */ 199 | 199953A7220AF1A900A59D3B /* Project object */ = { 200 | isa = PBXProject; 201 | attributes = { 202 | LastSwiftUpdateCheck = 1010; 203 | LastUpgradeCheck = 1010; 204 | ORGANIZATIONNAME = "Seungyoun Yi"; 205 | TargetAttributes = { 206 | 199953AF220AF1A900A59D3B = { 207 | CreatedOnToolsVersion = 10.1; 208 | LastSwiftMigration = 1010; 209 | }; 210 | 19E47C84220AF2000025DBC0 = { 211 | CreatedOnToolsVersion = 10.1; 212 | }; 213 | }; 214 | }; 215 | buildConfigurationList = 199953AA220AF1A900A59D3B /* Build configuration list for PBXProject "Dismissable" */; 216 | compatibilityVersion = "Xcode 9.3"; 217 | developmentRegion = en; 218 | hasScannedForEncodings = 0; 219 | knownRegions = ( 220 | en, 221 | Base, 222 | ); 223 | mainGroup = 199953A6220AF1A900A59D3B; 224 | productRefGroup = 199953B1220AF1A900A59D3B /* Products */; 225 | projectDirPath = ""; 226 | projectRoot = ""; 227 | targets = ( 228 | 199953AF220AF1A900A59D3B /* Dismissable */, 229 | 19E47C84220AF2000025DBC0 /* Dismissable-Demo */, 230 | ); 231 | }; 232 | /* End PBXProject section */ 233 | 234 | /* Begin PBXResourcesBuildPhase section */ 235 | 199953AE220AF1A900A59D3B /* Resources */ = { 236 | isa = PBXResourcesBuildPhase; 237 | buildActionMask = 2147483647; 238 | files = ( 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | }; 242 | 19E47C83220AF2000025DBC0 /* Resources */ = { 243 | isa = PBXResourcesBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | 19E47C92220AF2010025DBC0 /* LaunchScreen.storyboard in Resources */, 247 | 19E47C8F220AF2010025DBC0 /* Assets.xcassets in Resources */, 248 | 19E47C8D220AF2000025DBC0 /* Main.storyboard in Resources */, 249 | ); 250 | runOnlyForDeploymentPostprocessing = 0; 251 | }; 252 | /* End PBXResourcesBuildPhase section */ 253 | 254 | /* Begin PBXSourcesBuildPhase section */ 255 | 199953AC220AF1A900A59D3B /* Sources */ = { 256 | isa = PBXSourcesBuildPhase; 257 | buildActionMask = 2147483647; 258 | files = ( 259 | 19E47CA6220AF2F40025DBC0 /* DismissTriggerUsable.swift in Sources */, 260 | 19E47CA1220AF23F0025DBC0 /* DismissableUsable.swift in Sources */, 261 | 19E47CA4220AF2B90025DBC0 /* DismissInteractor.swift in Sources */, 262 | CE5B4099220D3EAA009C3066 /* UIViewController+Dismissable.swift in Sources */, 263 | 19E47CA2220AF23F0025DBC0 /* DismissAnimator.swift in Sources */, 264 | ); 265 | runOnlyForDeploymentPostprocessing = 0; 266 | }; 267 | 19E47C81220AF2000025DBC0 /* Sources */ = { 268 | isa = PBXSourcesBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | 19165B902243FA05006D7FC9 /* BaseNavigationController.swift in Sources */, 272 | 19E47C9B220AF2370025DBC0 /* DetailViewController.swift in Sources */, 273 | 19E47C8A220AF2000025DBC0 /* ViewController.swift in Sources */, 274 | 19E47C88220AF2000025DBC0 /* AppDelegate.swift in Sources */, 275 | ); 276 | runOnlyForDeploymentPostprocessing = 0; 277 | }; 278 | /* End PBXSourcesBuildPhase section */ 279 | 280 | /* Begin PBXTargetDependency section */ 281 | 19E47CAC220AF8460025DBC0 /* PBXTargetDependency */ = { 282 | isa = PBXTargetDependency; 283 | target = 199953AF220AF1A900A59D3B /* Dismissable */; 284 | targetProxy = 19E47CAB220AF8460025DBC0 /* PBXContainerItemProxy */; 285 | }; 286 | /* End PBXTargetDependency section */ 287 | 288 | /* Begin PBXVariantGroup section */ 289 | 19E47C8B220AF2000025DBC0 /* Main.storyboard */ = { 290 | isa = PBXVariantGroup; 291 | children = ( 292 | 19E47C8C220AF2000025DBC0 /* Base */, 293 | ); 294 | name = Main.storyboard; 295 | sourceTree = ""; 296 | }; 297 | 19E47C90220AF2010025DBC0 /* LaunchScreen.storyboard */ = { 298 | isa = PBXVariantGroup; 299 | children = ( 300 | 19E47C91220AF2010025DBC0 /* Base */, 301 | ); 302 | name = LaunchScreen.storyboard; 303 | sourceTree = ""; 304 | }; 305 | /* End PBXVariantGroup section */ 306 | 307 | /* Begin XCBuildConfiguration section */ 308 | 199953B6220AF1A900A59D3B /* Debug */ = { 309 | isa = XCBuildConfiguration; 310 | buildSettings = { 311 | ALWAYS_SEARCH_USER_PATHS = NO; 312 | CLANG_ANALYZER_NONNULL = YES; 313 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 314 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 315 | CLANG_CXX_LIBRARY = "libc++"; 316 | CLANG_ENABLE_MODULES = YES; 317 | CLANG_ENABLE_OBJC_ARC = YES; 318 | CLANG_ENABLE_OBJC_WEAK = YES; 319 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 320 | CLANG_WARN_BOOL_CONVERSION = YES; 321 | CLANG_WARN_COMMA = YES; 322 | CLANG_WARN_CONSTANT_CONVERSION = YES; 323 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 325 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 326 | CLANG_WARN_EMPTY_BODY = YES; 327 | CLANG_WARN_ENUM_CONVERSION = YES; 328 | CLANG_WARN_INFINITE_RECURSION = YES; 329 | CLANG_WARN_INT_CONVERSION = YES; 330 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 331 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 332 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 333 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 334 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 335 | CLANG_WARN_STRICT_PROTOTYPES = YES; 336 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 337 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 338 | CLANG_WARN_UNREACHABLE_CODE = YES; 339 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 340 | CODE_SIGN_IDENTITY = "iPhone Developer"; 341 | COPY_PHASE_STRIP = NO; 342 | CURRENT_PROJECT_VERSION = 1; 343 | DEBUG_INFORMATION_FORMAT = dwarf; 344 | ENABLE_STRICT_OBJC_MSGSEND = YES; 345 | ENABLE_TESTABILITY = YES; 346 | GCC_C_LANGUAGE_STANDARD = gnu11; 347 | GCC_DYNAMIC_NO_PIC = NO; 348 | GCC_NO_COMMON_BLOCKS = YES; 349 | GCC_OPTIMIZATION_LEVEL = 0; 350 | GCC_PREPROCESSOR_DEFINITIONS = ( 351 | "DEBUG=1", 352 | "$(inherited)", 353 | ); 354 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 355 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 356 | GCC_WARN_UNDECLARED_SELECTOR = YES; 357 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 358 | GCC_WARN_UNUSED_FUNCTION = YES; 359 | GCC_WARN_UNUSED_VARIABLE = YES; 360 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 361 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 362 | MTL_FAST_MATH = YES; 363 | ONLY_ACTIVE_ARCH = YES; 364 | SDKROOT = iphoneos; 365 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 366 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 367 | VERSIONING_SYSTEM = "apple-generic"; 368 | VERSION_INFO_PREFIX = ""; 369 | }; 370 | name = Debug; 371 | }; 372 | 199953B7220AF1A900A59D3B /* Release */ = { 373 | isa = XCBuildConfiguration; 374 | buildSettings = { 375 | ALWAYS_SEARCH_USER_PATHS = NO; 376 | CLANG_ANALYZER_NONNULL = YES; 377 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 378 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 379 | CLANG_CXX_LIBRARY = "libc++"; 380 | CLANG_ENABLE_MODULES = YES; 381 | CLANG_ENABLE_OBJC_ARC = YES; 382 | CLANG_ENABLE_OBJC_WEAK = YES; 383 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 384 | CLANG_WARN_BOOL_CONVERSION = YES; 385 | CLANG_WARN_COMMA = YES; 386 | CLANG_WARN_CONSTANT_CONVERSION = YES; 387 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 388 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 389 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 390 | CLANG_WARN_EMPTY_BODY = YES; 391 | CLANG_WARN_ENUM_CONVERSION = YES; 392 | CLANG_WARN_INFINITE_RECURSION = YES; 393 | CLANG_WARN_INT_CONVERSION = YES; 394 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 395 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 396 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 397 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 398 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 399 | CLANG_WARN_STRICT_PROTOTYPES = YES; 400 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 401 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 402 | CLANG_WARN_UNREACHABLE_CODE = YES; 403 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 404 | CODE_SIGN_IDENTITY = "iPhone Developer"; 405 | COPY_PHASE_STRIP = NO; 406 | CURRENT_PROJECT_VERSION = 1; 407 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 408 | ENABLE_NS_ASSERTIONS = NO; 409 | ENABLE_STRICT_OBJC_MSGSEND = YES; 410 | GCC_C_LANGUAGE_STANDARD = gnu11; 411 | GCC_NO_COMMON_BLOCKS = YES; 412 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 413 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 414 | GCC_WARN_UNDECLARED_SELECTOR = YES; 415 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 416 | GCC_WARN_UNUSED_FUNCTION = YES; 417 | GCC_WARN_UNUSED_VARIABLE = YES; 418 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 419 | MTL_ENABLE_DEBUG_INFO = NO; 420 | MTL_FAST_MATH = YES; 421 | SDKROOT = iphoneos; 422 | SWIFT_COMPILATION_MODE = wholemodule; 423 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 424 | VALIDATE_PRODUCT = YES; 425 | VERSIONING_SYSTEM = "apple-generic"; 426 | VERSION_INFO_PREFIX = ""; 427 | }; 428 | name = Release; 429 | }; 430 | 199953B9220AF1A900A59D3B /* Debug */ = { 431 | isa = XCBuildConfiguration; 432 | buildSettings = { 433 | CLANG_ENABLE_MODULES = YES; 434 | CODE_SIGN_IDENTITY = ""; 435 | CODE_SIGN_STYLE = Automatic; 436 | DEFINES_MODULE = YES; 437 | DEVELOPMENT_TEAM = 4G7K3CN2JU; 438 | DYLIB_COMPATIBILITY_VERSION = 1; 439 | DYLIB_CURRENT_VERSION = 1; 440 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 441 | INFOPLIST_FILE = Dismissable/Info.plist; 442 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 443 | LD_RUNPATH_SEARCH_PATHS = ( 444 | "$(inherited)", 445 | "@executable_path/Frameworks", 446 | "@loader_path/Frameworks", 447 | ); 448 | PRODUCT_BUNDLE_IDENTIFIER = com.seungyounyi.Dismissable; 449 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 450 | SKIP_INSTALL = YES; 451 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 452 | SWIFT_VERSION = 4.2; 453 | TARGETED_DEVICE_FAMILY = "1,2"; 454 | }; 455 | name = Debug; 456 | }; 457 | 199953BA220AF1A900A59D3B /* Release */ = { 458 | isa = XCBuildConfiguration; 459 | buildSettings = { 460 | CLANG_ENABLE_MODULES = YES; 461 | CODE_SIGN_IDENTITY = ""; 462 | CODE_SIGN_STYLE = Automatic; 463 | DEFINES_MODULE = YES; 464 | DEVELOPMENT_TEAM = 4G7K3CN2JU; 465 | DYLIB_COMPATIBILITY_VERSION = 1; 466 | DYLIB_CURRENT_VERSION = 1; 467 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 468 | INFOPLIST_FILE = Dismissable/Info.plist; 469 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 470 | LD_RUNPATH_SEARCH_PATHS = ( 471 | "$(inherited)", 472 | "@executable_path/Frameworks", 473 | "@loader_path/Frameworks", 474 | ); 475 | PRODUCT_BUNDLE_IDENTIFIER = com.seungyounyi.Dismissable; 476 | PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; 477 | SKIP_INSTALL = YES; 478 | SWIFT_VERSION = 4.2; 479 | TARGETED_DEVICE_FAMILY = "1,2"; 480 | }; 481 | name = Release; 482 | }; 483 | 19E47C94220AF2010025DBC0 /* Debug */ = { 484 | isa = XCBuildConfiguration; 485 | buildSettings = { 486 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 487 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 488 | CODE_SIGN_STYLE = Automatic; 489 | DEVELOPMENT_TEAM = 4G7K3CN2JU; 490 | INFOPLIST_FILE = "Dismissable-Demo/Info.plist"; 491 | LD_RUNPATH_SEARCH_PATHS = ( 492 | "$(inherited)", 493 | "@executable_path/Frameworks", 494 | ); 495 | PRODUCT_BUNDLE_IDENTIFIER = "com.seungyounyi.Dismissable-Demo"; 496 | PRODUCT_NAME = "$(TARGET_NAME)"; 497 | SWIFT_VERSION = 4.2; 498 | TARGETED_DEVICE_FAMILY = "1,2"; 499 | }; 500 | name = Debug; 501 | }; 502 | 19E47C95220AF2010025DBC0 /* Release */ = { 503 | isa = XCBuildConfiguration; 504 | buildSettings = { 505 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; 506 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 507 | CODE_SIGN_STYLE = Automatic; 508 | DEVELOPMENT_TEAM = 4G7K3CN2JU; 509 | INFOPLIST_FILE = "Dismissable-Demo/Info.plist"; 510 | LD_RUNPATH_SEARCH_PATHS = ( 511 | "$(inherited)", 512 | "@executable_path/Frameworks", 513 | ); 514 | PRODUCT_BUNDLE_IDENTIFIER = "com.seungyounyi.Dismissable-Demo"; 515 | PRODUCT_NAME = "$(TARGET_NAME)"; 516 | SWIFT_VERSION = 4.2; 517 | TARGETED_DEVICE_FAMILY = "1,2"; 518 | }; 519 | name = Release; 520 | }; 521 | /* End XCBuildConfiguration section */ 522 | 523 | /* Begin XCConfigurationList section */ 524 | 199953AA220AF1A900A59D3B /* Build configuration list for PBXProject "Dismissable" */ = { 525 | isa = XCConfigurationList; 526 | buildConfigurations = ( 527 | 199953B6220AF1A900A59D3B /* Debug */, 528 | 199953B7220AF1A900A59D3B /* Release */, 529 | ); 530 | defaultConfigurationIsVisible = 0; 531 | defaultConfigurationName = Release; 532 | }; 533 | 199953B8220AF1A900A59D3B /* Build configuration list for PBXNativeTarget "Dismissable" */ = { 534 | isa = XCConfigurationList; 535 | buildConfigurations = ( 536 | 199953B9220AF1A900A59D3B /* Debug */, 537 | 199953BA220AF1A900A59D3B /* Release */, 538 | ); 539 | defaultConfigurationIsVisible = 0; 540 | defaultConfigurationName = Release; 541 | }; 542 | 19E47C96220AF2010025DBC0 /* Build configuration list for PBXNativeTarget "Dismissable-Demo" */ = { 543 | isa = XCConfigurationList; 544 | buildConfigurations = ( 545 | 19E47C94220AF2010025DBC0 /* Debug */, 546 | 19E47C95220AF2010025DBC0 /* Release */, 547 | ); 548 | defaultConfigurationIsVisible = 0; 549 | defaultConfigurationName = Release; 550 | }; 551 | /* End XCConfigurationList section */ 552 | }; 553 | rootObject = 199953A7220AF1A900A59D3B /* Project object */; 554 | } 555 | -------------------------------------------------------------------------------- /Dismissable.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Dismissable.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Dismissable/DismissAnimator.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DismissAnimator.swift 3 | // Dismissable 4 | // 5 | // Created by Seungyoun Yi on 06/02/2019. 6 | // Copyright © 2019 Seungyoun Yi. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | open class DismissAnimator : NSObject { 12 | public var transitionDuration: TimeInterval = 0.35 13 | public var dimmedViewStartColor: UIColor = UIColor.black.withAlphaComponent(0.4) 14 | public var dimmedViewEndColor: UIColor = UIColor.black.withAlphaComponent(0) 15 | } 16 | 17 | extension DismissAnimator { 18 | static var `default`: DismissAnimator = DismissAnimator() 19 | } 20 | 21 | extension DismissAnimator : UIViewControllerAnimatedTransitioning { 22 | public func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval { 23 | return transitionDuration 24 | } 25 | 26 | public func animateTransition(using transitionContext: UIViewControllerContextTransitioning) { 27 | guard 28 | let fromVC = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.from), 29 | let toVC = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to) else { return } 30 | 31 | let dimmedView = UIView(frame: UIScreen.main.bounds) 32 | dimmedView.backgroundColor = dimmedViewStartColor 33 | toVC.view.addSubview(dimmedView) 34 | 35 | transitionContext.containerView.insertSubview(toVC.view, belowSubview: fromVC.view) 36 | 37 | let screenBounds = UIScreen.main.bounds 38 | let bottomLeftCorner = CGPoint(x: 0, y: screenBounds.height) 39 | let finalFrame = CGRect(origin: bottomLeftCorner, size: screenBounds.size) 40 | 41 | UIView.animate( 42 | withDuration: transitionDuration(using: transitionContext), 43 | animations: { 44 | dimmedView.backgroundColor = self.dimmedViewEndColor 45 | fromVC.view.frame = finalFrame 46 | }, completion: { _ in 47 | dimmedView.removeFromSuperview() 48 | transitionContext.completeTransition(!transitionContext.transitionWasCancelled) 49 | }) 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Dismissable/DismissInteractor.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DismissInteractor.swift 3 | // Dismissable 4 | // 5 | // Created by Seungyoun Yi on 06/02/2019. 6 | // Copyright © 2019 Seungyoun Yi. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | open class DismissInteractor: UIPercentDrivenInteractiveTransition { 12 | var hasStarted = false 13 | var shouldFinish = false 14 | } 15 | 16 | extension DismissInteractor { 17 | static var `default`: DismissInteractor = DismissInteractor() 18 | } 19 | -------------------------------------------------------------------------------- /Dismissable/DismissTriggerUsable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DismissTriggerUIViewController.swift 3 | // Dismissable 4 | // 5 | // Created by Seungyoun Yi on 06/02/2019. 6 | // Copyright © 2019 Seungyoun Yi. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public typealias DismissTriggerViewController = (UIViewController & DismissTriggerUsable) 12 | 13 | public protocol DismissTriggerUsable { 14 | var dismissInteractor: DismissInteractor { get } 15 | var dismissAnimator: DismissAnimator { get } 16 | } 17 | 18 | public extension DismissTriggerUsable { 19 | var dismissInteractor: DismissInteractor { return DismissInteractor.default } 20 | var dismissAnimator: DismissAnimator { return DismissAnimator.default } 21 | } 22 | 23 | final class DismissTriggerTransitioningDelegate: NSObject, UIViewControllerTransitioningDelegate { 24 | private weak var rootViewController: DismissTriggerViewController? 25 | 26 | init(rootViewController: DismissTriggerViewController) { 27 | super.init() 28 | self.rootViewController = rootViewController 29 | } 30 | 31 | func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? { 32 | return rootViewController?.dismissAnimator 33 | } 34 | 35 | func interactionControllerForDismissal(using animator: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? { 36 | guard let dismissInteractor = rootViewController?.dismissInteractor else { return nil } 37 | return dismissInteractor.hasStarted ? dismissInteractor : nil 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Dismissable/Dismissable.h: -------------------------------------------------------------------------------- 1 | // 2 | // Dismissable.h 3 | // Dismissable 4 | // 5 | // Created by Seungyoun Yi on 06/02/2019. 6 | // Copyright © 2019 Seungyoun Yi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Dismissable. 12 | FOUNDATION_EXPORT double DismissableVersionNumber; 13 | 14 | //! Project version string for Dismissable. 15 | FOUNDATION_EXPORT const unsigned char DismissableVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Dismissable/DismissableUsable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DismissableUIViewController.swift 3 | // Dismissable 4 | // 5 | // Created by Seungyoun Yi on 06/02/2019. 6 | // Copyright © 2019 Seungyoun Yi. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | public typealias DismissableViewController = (UIViewController & DismissableUsable) 12 | 13 | public protocol DismissableUsable { 14 | var percentThreshold: CGFloat { get } 15 | } 16 | 17 | public extension DismissableUsable { 18 | var percentThreshold: CGFloat { return 0.3 } 19 | } 20 | 21 | public extension DismissableUsable where Self: UIViewController { 22 | mutating func setup(_ dismissableVC: DismissTriggerViewController) { 23 | let dismissTriggerTransitioning = DismissTriggerTransitioningDelegate(rootViewController: dismissableVC) 24 | self.transitioningDelegate = dismissTriggerTransitioning 25 | self.dismissableTriggerTransitioning = dismissTriggerTransitioning 26 | self.dismissableInteractor = dismissableVC.dismissInteractor 27 | self.eventDispatcher = DismissableUsableEventDispatcher(rootViewController: self) 28 | } 29 | } 30 | 31 | final class DismissableUsableEventDispatcher: NSObject { 32 | private weak var rootViewController: DismissableViewController? 33 | private lazy var panGesture: UIPanGestureRecognizer = { 34 | let gesture = UIPanGestureRecognizer(target: self, action: #selector(onPanGesture(_:))) 35 | gesture.delegate = self 36 | return gesture 37 | }() 38 | 39 | init(rootViewController: DismissableViewController) { 40 | super.init() 41 | 42 | self.rootViewController = rootViewController 43 | rootViewController.view.addGestureRecognizer(self.panGesture) 44 | } 45 | 46 | // MARK: - Action 47 | @objc func onPanGesture(_ gesture: UIPanGestureRecognizer) { 48 | guard let rootViewController = rootViewController else { return } 49 | guard let interactor = rootViewController.dismissableInteractor else { return } 50 | 51 | switch gesture.state { 52 | case .began: 53 | interactor.hasStarted = true 54 | rootViewController.dismiss(animated: true, completion: nil) 55 | case .changed: 56 | let verticalMovement = Float(gesture.translation(in: rootViewController.view).y / rootViewController.view.bounds.height) 57 | let progress = CGFloat(fminf(fmaxf(verticalMovement, 0.0), 1.0)) 58 | 59 | interactor.shouldFinish = progress > rootViewController.percentThreshold 60 | interactor.update(progress) 61 | case .cancelled: 62 | interactor.hasStarted = false 63 | interactor.cancel() 64 | case .ended: 65 | interactor.hasStarted = false 66 | interactor.shouldFinish 67 | ? interactor.finish() 68 | : interactor.cancel() 69 | default: 70 | break 71 | } 72 | } 73 | 74 | var internalScrollView: UIScrollView? 75 | 76 | func scrollView(in view: UIView, location: CGPoint) { 77 | for subview in view.subviews { 78 | if let scrollView = view as? UIScrollView, view.frame.contains(location) { 79 | internalScrollView = scrollView 80 | break 81 | } else { 82 | _ = scrollView(in: subview, location: location) 83 | } 84 | } 85 | } 86 | } 87 | 88 | extension DismissableUsableEventDispatcher: UIGestureRecognizerDelegate { 89 | func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool { 90 | return true 91 | } 92 | 93 | func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool { 94 | guard let view = rootViewController?.view else { return false } 95 | self.scrollView(in: view, location: touch.location(in: rootViewController?.view)) 96 | guard let contentOffsetY = internalScrollView?.contentOffset.y else { return true } 97 | if contentOffsetY > CGFloat(20) { 98 | return false 99 | } 100 | return true 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /Dismissable/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /Dismissable/UIViewController+Dismissable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+Dismissable.swift 3 | // Dismissable 4 | // 5 | // Created by Taeun Kim on 08/02/2019. 6 | // Copyright © 2019 Seungyoun Yi. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import UIKit 11 | 12 | extension UIViewController { 13 | enum AssociatedKeys { 14 | static var eventDispatcher = "eventDispatcher" 15 | static var dismissableTriggerTransitioning = "dismissableTriggerTransitioning" 16 | static var dismissableInteractor = "dismissableInteractor" 17 | } 18 | 19 | var eventDispatcher: DismissableUsableEventDispatcher? { 20 | get { return objc_getAssociatedObject(self, &AssociatedKeys.eventDispatcher) as? DismissableUsableEventDispatcher } 21 | set { objc_setAssociatedObject(self, &AssociatedKeys.eventDispatcher, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) } 22 | } 23 | 24 | var dismissableTriggerTransitioning: DismissTriggerTransitioningDelegate? { 25 | get { return objc_getAssociatedObject(self, &AssociatedKeys.dismissableTriggerTransitioning) as? DismissTriggerTransitioningDelegate } 26 | set { objc_setAssociatedObject(self, &AssociatedKeys.dismissableTriggerTransitioning, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) } 27 | } 28 | 29 | var dismissableInteractor: DismissInteractor? { 30 | get { return objc_getAssociatedObject(self, &AssociatedKeys.dismissableInteractor) as? DismissInteractor } 31 | set { objc_setAssociatedObject(self, &AssociatedKeys.dismissableInteractor, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC) } 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Seungyoun Yi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dismissable 2 | [![Version](https://img.shields.io/cocoapods/v/Dismissable.svg?style=flat)](http://cocoapods.org/pods/Dismissable) 3 | [![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 4 | [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/younatics/Dismissable/blob/master/LICENSE) 5 | [![Platform](https://img.shields.io/cocoapods/p/Dismissable.svg?style=flat)](http://cocoapods.org/pods/Triangulation) 6 | [![Swift 4.0](https://img.shields.io/badge/Swift-4.2-orange.svg?style=flat)](https://developer.apple.com/swift/) 7 | 8 | ## Introduction 9 | ⚡️Pull to dismiss your modal view! `Dismissable` is super convenient to dismiss with gesture! 10 | 11 | ![demo](https://github.com/younatics/Dismissable/blob/master/image/Dismissable.gif) 12 | 13 | ## Requirements 14 | 15 | `Dismissable` is written in Swift 4.2. Compatible with iOS 9.0+ 16 | 17 | ## Installation 18 | 19 | ### Cocoapods 20 | 21 | Dismissable is available through [CocoaPods](http://cocoapods.org). To install 22 | it, simply add the following line to your Podfile: 23 | 24 | ```ruby 25 | pod 'Dismissable' 26 | ``` 27 | ### Carthage 28 | ``` 29 | github "younatics/Dismissable" 30 | ``` 31 | 32 | ## Usage 33 | 34 | Conform `DismissTriggerUsable` where present modal ViewController 35 | ```swift 36 | class ViewController: UIViewController, DismissTriggerUsable 37 | ``` 38 | Conform `DismissableUsable` in modal ViewController 39 | ```swift 40 | class DetailViewController: UIViewController, DismissableUsable 41 | ``` 42 | Add `dismissable` when prsent modal view 43 | ```swift 44 | let vc = UIStoryboard.init(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "detail") as! DetailViewController 45 | vc.setup(self) 46 | self.present(vc, animated: true, completion: nil) 47 | ``` 48 | 49 | Also you can customize dismiss animator 50 | ```swift 51 | var dismissAnimator: DismissAnimator = { 52 | let animator = DismissAnimator() 53 | animator.transitionDuration = 0.35 54 | animator.dimmedViewStartColor = UIColor.black.withAlphaComponent(0.4) 55 | animator.dimmedViewEndColor = UIColor.black.withAlphaComponent(0) 56 | return animator 57 | }() 58 | ``` 59 | 60 | ## References 61 | #### Please tell me or make pull request if you use this library in your application :) 62 | 63 | ## Author 64 | [younatics](https://twitter.com/younatics) 65 | Twitter 66 | 67 | ## License 68 | Dismissable is available under the MIT license. See the LICENSE file for more info. 69 | -------------------------------------------------------------------------------- /image/Dismissable.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/younatics/Dismissable/bfc49fc52228ffb2e2d1eaed6c76d600a69ee1d2/image/Dismissable.gif --------------------------------------------------------------------------------