├── Classes └── SegueAddition.swift ├── LICENSE ├── README.md ├── SegueAddition.podspec ├── SegueAddition.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── SegueAddition ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist └── ViewController.swift ├── SegueAdditionTests ├── Info.plist └── SegueAdditionTests.swift └── SegueAdditionUITests ├── Info.plist └── SegueAdditionUITests.swift /Classes/SegueAddition.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SegueAddition.swift 3 | // SegueAddition 4 | // 5 | // Created by kingkong999yhirose on 2016/04/18. 6 | // Copyright © 2016年 kingkong999yhirose. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | 12 | private class SegueEventHolder { 13 | let segueClosure:((UIStoryboardSegue) -> Void)? 14 | 15 | init(segueClosure: ((UIStoryboardSegue) -> Void)?) { 16 | self.segueClosure = segueClosure 17 | } 18 | } 19 | 20 | 21 | public extension UIViewController { 22 | fileprivate func swizzling() { 23 | let prepareForSegue = class_getInstanceMethod(type(of: self), #selector(UIViewController.prepare)) 24 | let _prepare = class_getInstanceMethod(type(of: self), #selector(UIViewController._prepare(segue:sender:))) 25 | method_exchangeImplementations(prepareForSegue!, _prepare!) 26 | } 27 | 28 | public func performSegue(_ withIdentifier: String, closure: ((UIStoryboardSegue) -> Void)? = nil) { 29 | swizzling() 30 | self.performSegue(withIdentifier: withIdentifier, sender: SegueEventHolder(segueClosure: closure)) 31 | swizzling() 32 | } 33 | 34 | @objc final func _prepare(segue: UIStoryboardSegue, sender: AnyObject?) { 35 | let event = sender as! SegueEventHolder 36 | event.segueClosure?(segue) 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Yudai hirose 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 | ## SegueAddition 2 | Easily way to write perfromSegue(withIdentifier:sender). 3 | 4 | ## Usage 5 | You can call `performSegue` with closure. 6 | 7 | ```swift 8 | let customString = "CustomString" 9 | performSegue("SegueIdentfiier") { segue in 10 | guard let toViewController = segue.destinationViewController as? CustomViewController else { 11 | fatalError() 12 | } 13 | toViewController.string = customString 14 | } 15 | ``` 16 | 17 | It has the same meaning. 18 | ```swift 19 | ... 20 | let customString = "CustomString" 21 | performSegueWithIdentifier("SegueIdentfiier", sender: customString) 22 | ... 23 | 24 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 25 | guard let toViewController = segue.destinationViewController as? CustomViewController, 26 | customString = sender as? String 27 | where segue.identifier == "SegueIdentfiier" 28 | else { 29 | fatalError() 30 | } 31 | toViewController.string = customString 32 | } 33 | ``` 34 | 35 | So, no need to write `prepare(for segue: UIStoryboardSegue, sender: Any?)` again. 36 | And, It is read and write easy for perform segue event and passing value to next view controller. 37 | 38 | ## LICENSE 39 | [SegueAddition](https://github.com/bannzai/SegueAddition) is released under the MIT license. See LICENSE for details. 40 | -------------------------------------------------------------------------------- /SegueAddition.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'SegueAddition' 3 | s.version = '1.3.0' 4 | s.license = 'MIT' 5 | s.homepage = 'https://github.com/bannzai/' 6 | s.summary = 'Easily way to write perfromSegueWithIdentifier.' 7 | s.authors = { 'bannzai' => 'kingkong999yhirose@gmail.com' } 8 | s.source = { :git => 'https://github.com/bannzai/SegueAddition.git', :tag => s.version } 9 | 10 | s.ios.deployment_target = '8.0' 11 | 12 | s.source_files = 'Classes/*.swift' 13 | end 14 | 15 | 16 | -------------------------------------------------------------------------------- /SegueAddition.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 9CC754101CC4EBCC00BA2703 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CC7540F1CC4EBCC00BA2703 /* AppDelegate.swift */; }; 11 | 9CC754121CC4EBCC00BA2703 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CC754111CC4EBCC00BA2703 /* ViewController.swift */; }; 12 | 9CC754151CC4EBCC00BA2703 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9CC754131CC4EBCC00BA2703 /* Main.storyboard */; }; 13 | 9CC754171CC4EBCC00BA2703 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9CC754161CC4EBCC00BA2703 /* Assets.xcassets */; }; 14 | 9CC7541A1CC4EBCC00BA2703 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9CC754181CC4EBCC00BA2703 /* LaunchScreen.storyboard */; }; 15 | 9CC754251CC4EBCD00BA2703 /* SegueAdditionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CC754241CC4EBCD00BA2703 /* SegueAdditionTests.swift */; }; 16 | 9CC754301CC4EBCD00BA2703 /* SegueAdditionUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CC7542F1CC4EBCD00BA2703 /* SegueAdditionUITests.swift */; }; 17 | 9CE69D721CC7B0FB0098C12A /* SegueAddition.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9CE69D711CC7B0FB0098C12A /* SegueAddition.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 9CC754211CC4EBCC00BA2703 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 9CC754041CC4EBCC00BA2703 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 9CC7540B1CC4EBCC00BA2703; 26 | remoteInfo = SegueAddition; 27 | }; 28 | 9CC7542C1CC4EBCD00BA2703 /* PBXContainerItemProxy */ = { 29 | isa = PBXContainerItemProxy; 30 | containerPortal = 9CC754041CC4EBCC00BA2703 /* Project object */; 31 | proxyType = 1; 32 | remoteGlobalIDString = 9CC7540B1CC4EBCC00BA2703; 33 | remoteInfo = SegueAddition; 34 | }; 35 | /* End PBXContainerItemProxy section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 9CC7540C1CC4EBCC00BA2703 /* SegueAddition.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SegueAddition.app; sourceTree = BUILT_PRODUCTS_DIR; }; 39 | 9CC7540F1CC4EBCC00BA2703 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 40 | 9CC754111CC4EBCC00BA2703 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 41 | 9CC754141CC4EBCC00BA2703 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 9CC754161CC4EBCC00BA2703 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 9CC754191CC4EBCC00BA2703 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 9CC7541B1CC4EBCC00BA2703 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | 9CC754201CC4EBCC00BA2703 /* SegueAdditionTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SegueAdditionTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 9CC754241CC4EBCD00BA2703 /* SegueAdditionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SegueAdditionTests.swift; sourceTree = ""; }; 47 | 9CC754261CC4EBCD00BA2703 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 48 | 9CC7542B1CC4EBCD00BA2703 /* SegueAdditionUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SegueAdditionUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 9CC7542F1CC4EBCD00BA2703 /* SegueAdditionUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SegueAdditionUITests.swift; sourceTree = ""; }; 50 | 9CC754311CC4EBCD00BA2703 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | 9CE69D711CC7B0FB0098C12A /* SegueAddition.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SegueAddition.swift; sourceTree = ""; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | 9CC754091CC4EBCC00BA2703 /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | 9CC7541D1CC4EBCC00BA2703 /* Frameworks */ = { 63 | isa = PBXFrameworksBuildPhase; 64 | buildActionMask = 2147483647; 65 | files = ( 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | 9CC754281CC4EBCD00BA2703 /* Frameworks */ = { 70 | isa = PBXFrameworksBuildPhase; 71 | buildActionMask = 2147483647; 72 | files = ( 73 | ); 74 | runOnlyForDeploymentPostprocessing = 0; 75 | }; 76 | /* End PBXFrameworksBuildPhase section */ 77 | 78 | /* Begin PBXGroup section */ 79 | 9CC754031CC4EBCC00BA2703 = { 80 | isa = PBXGroup; 81 | children = ( 82 | 9CE69D701CC7B0FB0098C12A /* Classes */, 83 | 9CC7540E1CC4EBCC00BA2703 /* SegueAddition */, 84 | 9CC754231CC4EBCD00BA2703 /* SegueAdditionTests */, 85 | 9CC7542E1CC4EBCD00BA2703 /* SegueAdditionUITests */, 86 | 9CC7540D1CC4EBCC00BA2703 /* Products */, 87 | ); 88 | sourceTree = ""; 89 | }; 90 | 9CC7540D1CC4EBCC00BA2703 /* Products */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 9CC7540C1CC4EBCC00BA2703 /* SegueAddition.app */, 94 | 9CC754201CC4EBCC00BA2703 /* SegueAdditionTests.xctest */, 95 | 9CC7542B1CC4EBCD00BA2703 /* SegueAdditionUITests.xctest */, 96 | ); 97 | name = Products; 98 | sourceTree = ""; 99 | }; 100 | 9CC7540E1CC4EBCC00BA2703 /* SegueAddition */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 9CC7540F1CC4EBCC00BA2703 /* AppDelegate.swift */, 104 | 9CC754111CC4EBCC00BA2703 /* ViewController.swift */, 105 | 9CC754131CC4EBCC00BA2703 /* Main.storyboard */, 106 | 9CC754161CC4EBCC00BA2703 /* Assets.xcassets */, 107 | 9CC754181CC4EBCC00BA2703 /* LaunchScreen.storyboard */, 108 | 9CC7541B1CC4EBCC00BA2703 /* Info.plist */, 109 | ); 110 | path = SegueAddition; 111 | sourceTree = ""; 112 | }; 113 | 9CC754231CC4EBCD00BA2703 /* SegueAdditionTests */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 9CC754241CC4EBCD00BA2703 /* SegueAdditionTests.swift */, 117 | 9CC754261CC4EBCD00BA2703 /* Info.plist */, 118 | ); 119 | path = SegueAdditionTests; 120 | sourceTree = ""; 121 | }; 122 | 9CC7542E1CC4EBCD00BA2703 /* SegueAdditionUITests */ = { 123 | isa = PBXGroup; 124 | children = ( 125 | 9CC7542F1CC4EBCD00BA2703 /* SegueAdditionUITests.swift */, 126 | 9CC754311CC4EBCD00BA2703 /* Info.plist */, 127 | ); 128 | path = SegueAdditionUITests; 129 | sourceTree = ""; 130 | }; 131 | 9CE69D701CC7B0FB0098C12A /* Classes */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 9CE69D711CC7B0FB0098C12A /* SegueAddition.swift */, 135 | ); 136 | path = Classes; 137 | sourceTree = ""; 138 | }; 139 | /* End PBXGroup section */ 140 | 141 | /* Begin PBXNativeTarget section */ 142 | 9CC7540B1CC4EBCC00BA2703 /* SegueAddition */ = { 143 | isa = PBXNativeTarget; 144 | buildConfigurationList = 9CC754341CC4EBCD00BA2703 /* Build configuration list for PBXNativeTarget "SegueAddition" */; 145 | buildPhases = ( 146 | 9CC754081CC4EBCC00BA2703 /* Sources */, 147 | 9CC754091CC4EBCC00BA2703 /* Frameworks */, 148 | 9CC7540A1CC4EBCC00BA2703 /* Resources */, 149 | ); 150 | buildRules = ( 151 | ); 152 | dependencies = ( 153 | ); 154 | name = SegueAddition; 155 | productName = SegueAddition; 156 | productReference = 9CC7540C1CC4EBCC00BA2703 /* SegueAddition.app */; 157 | productType = "com.apple.product-type.application"; 158 | }; 159 | 9CC7541F1CC4EBCC00BA2703 /* SegueAdditionTests */ = { 160 | isa = PBXNativeTarget; 161 | buildConfigurationList = 9CC754371CC4EBCD00BA2703 /* Build configuration list for PBXNativeTarget "SegueAdditionTests" */; 162 | buildPhases = ( 163 | 9CC7541C1CC4EBCC00BA2703 /* Sources */, 164 | 9CC7541D1CC4EBCC00BA2703 /* Frameworks */, 165 | 9CC7541E1CC4EBCC00BA2703 /* Resources */, 166 | ); 167 | buildRules = ( 168 | ); 169 | dependencies = ( 170 | 9CC754221CC4EBCC00BA2703 /* PBXTargetDependency */, 171 | ); 172 | name = SegueAdditionTests; 173 | productName = SegueAdditionTests; 174 | productReference = 9CC754201CC4EBCC00BA2703 /* SegueAdditionTests.xctest */; 175 | productType = "com.apple.product-type.bundle.unit-test"; 176 | }; 177 | 9CC7542A1CC4EBCD00BA2703 /* SegueAdditionUITests */ = { 178 | isa = PBXNativeTarget; 179 | buildConfigurationList = 9CC7543A1CC4EBCD00BA2703 /* Build configuration list for PBXNativeTarget "SegueAdditionUITests" */; 180 | buildPhases = ( 181 | 9CC754271CC4EBCD00BA2703 /* Sources */, 182 | 9CC754281CC4EBCD00BA2703 /* Frameworks */, 183 | 9CC754291CC4EBCD00BA2703 /* Resources */, 184 | ); 185 | buildRules = ( 186 | ); 187 | dependencies = ( 188 | 9CC7542D1CC4EBCD00BA2703 /* PBXTargetDependency */, 189 | ); 190 | name = SegueAdditionUITests; 191 | productName = SegueAdditionUITests; 192 | productReference = 9CC7542B1CC4EBCD00BA2703 /* SegueAdditionUITests.xctest */; 193 | productType = "com.apple.product-type.bundle.ui-testing"; 194 | }; 195 | /* End PBXNativeTarget section */ 196 | 197 | /* Begin PBXProject section */ 198 | 9CC754041CC4EBCC00BA2703 /* Project object */ = { 199 | isa = PBXProject; 200 | attributes = { 201 | LastSwiftUpdateCheck = 0730; 202 | LastUpgradeCheck = 0920; 203 | ORGANIZATIONNAME = kingkong999yhirose; 204 | TargetAttributes = { 205 | 9CC7540B1CC4EBCC00BA2703 = { 206 | CreatedOnToolsVersion = 7.3; 207 | DevelopmentTeam = YLA43D3B9F; 208 | LastSwiftMigration = 0920; 209 | }; 210 | 9CC7541F1CC4EBCC00BA2703 = { 211 | CreatedOnToolsVersion = 7.3; 212 | DevelopmentTeam = YLA43D3B9F; 213 | LastSwiftMigration = 0920; 214 | TestTargetID = 9CC7540B1CC4EBCC00BA2703; 215 | }; 216 | 9CC7542A1CC4EBCD00BA2703 = { 217 | CreatedOnToolsVersion = 7.3; 218 | DevelopmentTeam = YLA43D3B9F; 219 | LastSwiftMigration = 0920; 220 | ProvisioningStyle = Automatic; 221 | TestTargetID = 9CC7540B1CC4EBCC00BA2703; 222 | }; 223 | }; 224 | }; 225 | buildConfigurationList = 9CC754071CC4EBCC00BA2703 /* Build configuration list for PBXProject "SegueAddition" */; 226 | compatibilityVersion = "Xcode 3.2"; 227 | developmentRegion = English; 228 | hasScannedForEncodings = 0; 229 | knownRegions = ( 230 | en, 231 | Base, 232 | ); 233 | mainGroup = 9CC754031CC4EBCC00BA2703; 234 | productRefGroup = 9CC7540D1CC4EBCC00BA2703 /* Products */; 235 | projectDirPath = ""; 236 | projectRoot = ""; 237 | targets = ( 238 | 9CC7540B1CC4EBCC00BA2703 /* SegueAddition */, 239 | 9CC7541F1CC4EBCC00BA2703 /* SegueAdditionTests */, 240 | 9CC7542A1CC4EBCD00BA2703 /* SegueAdditionUITests */, 241 | ); 242 | }; 243 | /* End PBXProject section */ 244 | 245 | /* Begin PBXResourcesBuildPhase section */ 246 | 9CC7540A1CC4EBCC00BA2703 /* Resources */ = { 247 | isa = PBXResourcesBuildPhase; 248 | buildActionMask = 2147483647; 249 | files = ( 250 | 9CC7541A1CC4EBCC00BA2703 /* LaunchScreen.storyboard in Resources */, 251 | 9CC754171CC4EBCC00BA2703 /* Assets.xcassets in Resources */, 252 | 9CC754151CC4EBCC00BA2703 /* Main.storyboard in Resources */, 253 | ); 254 | runOnlyForDeploymentPostprocessing = 0; 255 | }; 256 | 9CC7541E1CC4EBCC00BA2703 /* Resources */ = { 257 | isa = PBXResourcesBuildPhase; 258 | buildActionMask = 2147483647; 259 | files = ( 260 | ); 261 | runOnlyForDeploymentPostprocessing = 0; 262 | }; 263 | 9CC754291CC4EBCD00BA2703 /* Resources */ = { 264 | isa = PBXResourcesBuildPhase; 265 | buildActionMask = 2147483647; 266 | files = ( 267 | ); 268 | runOnlyForDeploymentPostprocessing = 0; 269 | }; 270 | /* End PBXResourcesBuildPhase section */ 271 | 272 | /* Begin PBXSourcesBuildPhase section */ 273 | 9CC754081CC4EBCC00BA2703 /* Sources */ = { 274 | isa = PBXSourcesBuildPhase; 275 | buildActionMask = 2147483647; 276 | files = ( 277 | 9CC754121CC4EBCC00BA2703 /* ViewController.swift in Sources */, 278 | 9CC754101CC4EBCC00BA2703 /* AppDelegate.swift in Sources */, 279 | 9CE69D721CC7B0FB0098C12A /* SegueAddition.swift in Sources */, 280 | ); 281 | runOnlyForDeploymentPostprocessing = 0; 282 | }; 283 | 9CC7541C1CC4EBCC00BA2703 /* Sources */ = { 284 | isa = PBXSourcesBuildPhase; 285 | buildActionMask = 2147483647; 286 | files = ( 287 | 9CC754251CC4EBCD00BA2703 /* SegueAdditionTests.swift in Sources */, 288 | ); 289 | runOnlyForDeploymentPostprocessing = 0; 290 | }; 291 | 9CC754271CC4EBCD00BA2703 /* Sources */ = { 292 | isa = PBXSourcesBuildPhase; 293 | buildActionMask = 2147483647; 294 | files = ( 295 | 9CC754301CC4EBCD00BA2703 /* SegueAdditionUITests.swift in Sources */, 296 | ); 297 | runOnlyForDeploymentPostprocessing = 0; 298 | }; 299 | /* End PBXSourcesBuildPhase section */ 300 | 301 | /* Begin PBXTargetDependency section */ 302 | 9CC754221CC4EBCC00BA2703 /* PBXTargetDependency */ = { 303 | isa = PBXTargetDependency; 304 | target = 9CC7540B1CC4EBCC00BA2703 /* SegueAddition */; 305 | targetProxy = 9CC754211CC4EBCC00BA2703 /* PBXContainerItemProxy */; 306 | }; 307 | 9CC7542D1CC4EBCD00BA2703 /* PBXTargetDependency */ = { 308 | isa = PBXTargetDependency; 309 | target = 9CC7540B1CC4EBCC00BA2703 /* SegueAddition */; 310 | targetProxy = 9CC7542C1CC4EBCD00BA2703 /* PBXContainerItemProxy */; 311 | }; 312 | /* End PBXTargetDependency section */ 313 | 314 | /* Begin PBXVariantGroup section */ 315 | 9CC754131CC4EBCC00BA2703 /* Main.storyboard */ = { 316 | isa = PBXVariantGroup; 317 | children = ( 318 | 9CC754141CC4EBCC00BA2703 /* Base */, 319 | ); 320 | name = Main.storyboard; 321 | sourceTree = ""; 322 | }; 323 | 9CC754181CC4EBCC00BA2703 /* LaunchScreen.storyboard */ = { 324 | isa = PBXVariantGroup; 325 | children = ( 326 | 9CC754191CC4EBCC00BA2703 /* Base */, 327 | ); 328 | name = LaunchScreen.storyboard; 329 | sourceTree = ""; 330 | }; 331 | /* End PBXVariantGroup section */ 332 | 333 | /* Begin XCBuildConfiguration section */ 334 | 9CC754321CC4EBCD00BA2703 /* Debug */ = { 335 | isa = XCBuildConfiguration; 336 | buildSettings = { 337 | ALWAYS_SEARCH_USER_PATHS = NO; 338 | CLANG_ANALYZER_NONNULL = YES; 339 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 340 | CLANG_CXX_LIBRARY = "libc++"; 341 | CLANG_ENABLE_MODULES = YES; 342 | CLANG_ENABLE_OBJC_ARC = YES; 343 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 344 | CLANG_WARN_BOOL_CONVERSION = YES; 345 | CLANG_WARN_COMMA = YES; 346 | CLANG_WARN_CONSTANT_CONVERSION = YES; 347 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 348 | CLANG_WARN_EMPTY_BODY = YES; 349 | CLANG_WARN_ENUM_CONVERSION = YES; 350 | CLANG_WARN_INFINITE_RECURSION = YES; 351 | CLANG_WARN_INT_CONVERSION = YES; 352 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 353 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 354 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 355 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 356 | CLANG_WARN_STRICT_PROTOTYPES = YES; 357 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 358 | CLANG_WARN_UNREACHABLE_CODE = YES; 359 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 360 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 361 | COPY_PHASE_STRIP = NO; 362 | DEBUG_INFORMATION_FORMAT = dwarf; 363 | ENABLE_STRICT_OBJC_MSGSEND = YES; 364 | ENABLE_TESTABILITY = YES; 365 | GCC_C_LANGUAGE_STANDARD = gnu99; 366 | GCC_DYNAMIC_NO_PIC = NO; 367 | GCC_NO_COMMON_BLOCKS = YES; 368 | GCC_OPTIMIZATION_LEVEL = 0; 369 | GCC_PREPROCESSOR_DEFINITIONS = ( 370 | "DEBUG=1", 371 | "$(inherited)", 372 | ); 373 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 374 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 375 | GCC_WARN_UNDECLARED_SELECTOR = YES; 376 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 377 | GCC_WARN_UNUSED_FUNCTION = YES; 378 | GCC_WARN_UNUSED_VARIABLE = YES; 379 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 380 | MTL_ENABLE_DEBUG_INFO = YES; 381 | ONLY_ACTIVE_ARCH = YES; 382 | SDKROOT = iphoneos; 383 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 384 | }; 385 | name = Debug; 386 | }; 387 | 9CC754331CC4EBCD00BA2703 /* Release */ = { 388 | isa = XCBuildConfiguration; 389 | buildSettings = { 390 | ALWAYS_SEARCH_USER_PATHS = NO; 391 | CLANG_ANALYZER_NONNULL = YES; 392 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 393 | CLANG_CXX_LIBRARY = "libc++"; 394 | CLANG_ENABLE_MODULES = YES; 395 | CLANG_ENABLE_OBJC_ARC = YES; 396 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 397 | CLANG_WARN_BOOL_CONVERSION = YES; 398 | CLANG_WARN_COMMA = YES; 399 | CLANG_WARN_CONSTANT_CONVERSION = YES; 400 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 401 | CLANG_WARN_EMPTY_BODY = YES; 402 | CLANG_WARN_ENUM_CONVERSION = YES; 403 | CLANG_WARN_INFINITE_RECURSION = YES; 404 | CLANG_WARN_INT_CONVERSION = YES; 405 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 406 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 407 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 408 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 409 | CLANG_WARN_STRICT_PROTOTYPES = YES; 410 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 411 | CLANG_WARN_UNREACHABLE_CODE = YES; 412 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 413 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 414 | COPY_PHASE_STRIP = NO; 415 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 416 | ENABLE_NS_ASSERTIONS = NO; 417 | ENABLE_STRICT_OBJC_MSGSEND = YES; 418 | GCC_C_LANGUAGE_STANDARD = gnu99; 419 | GCC_NO_COMMON_BLOCKS = YES; 420 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 421 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 422 | GCC_WARN_UNDECLARED_SELECTOR = YES; 423 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 424 | GCC_WARN_UNUSED_FUNCTION = YES; 425 | GCC_WARN_UNUSED_VARIABLE = YES; 426 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 427 | MTL_ENABLE_DEBUG_INFO = NO; 428 | SDKROOT = iphoneos; 429 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 430 | VALIDATE_PRODUCT = YES; 431 | }; 432 | name = Release; 433 | }; 434 | 9CC754351CC4EBCD00BA2703 /* Debug */ = { 435 | isa = XCBuildConfiguration; 436 | buildSettings = { 437 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 438 | DEVELOPMENT_TEAM = YLA43D3B9F; 439 | INFOPLIST_FILE = SegueAddition/Info.plist; 440 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 441 | PRODUCT_BUNDLE_IDENTIFIER = com.sample.SegueAddition; 442 | PRODUCT_NAME = "$(TARGET_NAME)"; 443 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 444 | SWIFT_VERSION = 4.0; 445 | }; 446 | name = Debug; 447 | }; 448 | 9CC754361CC4EBCD00BA2703 /* Release */ = { 449 | isa = XCBuildConfiguration; 450 | buildSettings = { 451 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 452 | DEVELOPMENT_TEAM = YLA43D3B9F; 453 | INFOPLIST_FILE = SegueAddition/Info.plist; 454 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 455 | PRODUCT_BUNDLE_IDENTIFIER = com.sample.SegueAddition; 456 | PRODUCT_NAME = "$(TARGET_NAME)"; 457 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 458 | SWIFT_VERSION = 4.0; 459 | }; 460 | name = Release; 461 | }; 462 | 9CC754381CC4EBCD00BA2703 /* Debug */ = { 463 | isa = XCBuildConfiguration; 464 | buildSettings = { 465 | BUNDLE_LOADER = "$(TEST_HOST)"; 466 | DEVELOPMENT_TEAM = YLA43D3B9F; 467 | INFOPLIST_FILE = SegueAdditionTests/Info.plist; 468 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 469 | PRODUCT_BUNDLE_IDENTIFIER = com.sample.SegueAdditionTests; 470 | PRODUCT_NAME = "$(TARGET_NAME)"; 471 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 472 | SWIFT_VERSION = 4.0; 473 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SegueAddition.app/SegueAddition"; 474 | }; 475 | name = Debug; 476 | }; 477 | 9CC754391CC4EBCD00BA2703 /* Release */ = { 478 | isa = XCBuildConfiguration; 479 | buildSettings = { 480 | BUNDLE_LOADER = "$(TEST_HOST)"; 481 | DEVELOPMENT_TEAM = YLA43D3B9F; 482 | INFOPLIST_FILE = SegueAdditionTests/Info.plist; 483 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 484 | PRODUCT_BUNDLE_IDENTIFIER = com.sample.SegueAdditionTests; 485 | PRODUCT_NAME = "$(TARGET_NAME)"; 486 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 487 | SWIFT_VERSION = 4.0; 488 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SegueAddition.app/SegueAddition"; 489 | }; 490 | name = Release; 491 | }; 492 | 9CC7543B1CC4EBCD00BA2703 /* Debug */ = { 493 | isa = XCBuildConfiguration; 494 | buildSettings = { 495 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 496 | DEVELOPMENT_TEAM = YLA43D3B9F; 497 | INFOPLIST_FILE = SegueAdditionUITests/Info.plist; 498 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 499 | PRODUCT_BUNDLE_IDENTIFIER = com.sample.SegueAdditionUITests; 500 | PRODUCT_NAME = "$(TARGET_NAME)"; 501 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 502 | SWIFT_VERSION = 4.0; 503 | TEST_TARGET_NAME = SegueAddition; 504 | }; 505 | name = Debug; 506 | }; 507 | 9CC7543C1CC4EBCD00BA2703 /* Release */ = { 508 | isa = XCBuildConfiguration; 509 | buildSettings = { 510 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 511 | DEVELOPMENT_TEAM = YLA43D3B9F; 512 | INFOPLIST_FILE = SegueAdditionUITests/Info.plist; 513 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 514 | PRODUCT_BUNDLE_IDENTIFIER = com.sample.SegueAdditionUITests; 515 | PRODUCT_NAME = "$(TARGET_NAME)"; 516 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 517 | SWIFT_VERSION = 4.0; 518 | TEST_TARGET_NAME = SegueAddition; 519 | }; 520 | name = Release; 521 | }; 522 | /* End XCBuildConfiguration section */ 523 | 524 | /* Begin XCConfigurationList section */ 525 | 9CC754071CC4EBCC00BA2703 /* Build configuration list for PBXProject "SegueAddition" */ = { 526 | isa = XCConfigurationList; 527 | buildConfigurations = ( 528 | 9CC754321CC4EBCD00BA2703 /* Debug */, 529 | 9CC754331CC4EBCD00BA2703 /* Release */, 530 | ); 531 | defaultConfigurationIsVisible = 0; 532 | defaultConfigurationName = Release; 533 | }; 534 | 9CC754341CC4EBCD00BA2703 /* Build configuration list for PBXNativeTarget "SegueAddition" */ = { 535 | isa = XCConfigurationList; 536 | buildConfigurations = ( 537 | 9CC754351CC4EBCD00BA2703 /* Debug */, 538 | 9CC754361CC4EBCD00BA2703 /* Release */, 539 | ); 540 | defaultConfigurationIsVisible = 0; 541 | defaultConfigurationName = Release; 542 | }; 543 | 9CC754371CC4EBCD00BA2703 /* Build configuration list for PBXNativeTarget "SegueAdditionTests" */ = { 544 | isa = XCConfigurationList; 545 | buildConfigurations = ( 546 | 9CC754381CC4EBCD00BA2703 /* Debug */, 547 | 9CC754391CC4EBCD00BA2703 /* Release */, 548 | ); 549 | defaultConfigurationIsVisible = 0; 550 | defaultConfigurationName = Release; 551 | }; 552 | 9CC7543A1CC4EBCD00BA2703 /* Build configuration list for PBXNativeTarget "SegueAdditionUITests" */ = { 553 | isa = XCConfigurationList; 554 | buildConfigurations = ( 555 | 9CC7543B1CC4EBCD00BA2703 /* Debug */, 556 | 9CC7543C1CC4EBCD00BA2703 /* Release */, 557 | ); 558 | defaultConfigurationIsVisible = 0; 559 | defaultConfigurationName = Release; 560 | }; 561 | /* End XCConfigurationList section */ 562 | }; 563 | rootObject = 9CC754041CC4EBCC00BA2703 /* Project object */; 564 | } 565 | -------------------------------------------------------------------------------- /SegueAddition.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SegueAddition.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /SegueAddition/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // SegueAddition 4 | // 5 | // Created by kingkong999yhirose on 2016/04/18. 6 | // Copyright © 2016年 kingkong999yhirose. 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: [UIApplicationLaunchOptionsKey: 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 throttle down OpenGL ES frame rates. 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 inactive 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 | -------------------------------------------------------------------------------- /SegueAddition/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /SegueAddition/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 | 27 | 28 | -------------------------------------------------------------------------------- /SegueAddition/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 59 | 66 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 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 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | -------------------------------------------------------------------------------- /SegueAddition/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /SegueAddition/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // SegueAddition 4 | // 5 | // Created by kingkong999yhirose on 2016/04/18. 6 | // Copyright © 2016年 kingkong999yhirose. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController { 12 | 13 | } 14 | 15 | class CycleReferenceCheckViewController: UIViewController { 16 | var string = "" 17 | 18 | override func prepare(for segue: UIStoryboardSegue, sender: Any?) { 19 | 20 | guard let identifier = segue.identifier else { 21 | return 22 | } 23 | 24 | if identifier != "StandardSegue" { 25 | fatalError() 26 | } 27 | } 28 | 29 | @IBAction func standardSegue(_ sender: AnyObject) { 30 | self.performSegue(withIdentifier: "StandardSegue", sender: nil) 31 | } 32 | 33 | @IBAction func useSegueClosure(_ sender: AnyObject) { 34 | string = #function 35 | performSegue("UseSegueClosure") { segue in 36 | guard let viewController = segue.destination 37 | as? ManualSegueUseSegueClosureViewController 38 | else { 39 | fatalError() 40 | } 41 | viewController.debugString = self.string // Check Cycle Reference 42 | viewController.view.backgroundColor = UIColor.yellow 43 | } 44 | } 45 | deinit { 46 | print(#function) 47 | } 48 | } 49 | 50 | class SegueSettingStoryboardViewController: UIViewController { 51 | deinit { 52 | print(#function) 53 | } 54 | } 55 | 56 | class ManualSegueUseSegueClosureViewController: UIViewController { 57 | var debugString: String? 58 | 59 | override func viewDidLoad() { 60 | super.viewDidLoad() 61 | if debugString == nil { 62 | fatalError() 63 | } 64 | } 65 | deinit { 66 | print(#function) 67 | } 68 | } 69 | 70 | class ManualSegueUseStandardViewController: UIViewController { 71 | deinit { 72 | print(#function) 73 | } 74 | } 75 | 76 | -------------------------------------------------------------------------------- /SegueAdditionTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /SegueAdditionTests/SegueAdditionTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SegueAdditionTests.swift 3 | // SegueAdditionTests 4 | // 5 | // Created by kingkong999yhirose on 2016/04/18. 6 | // Copyright © 2016年 kingkong999yhirose. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import SegueAddition 11 | 12 | class SegueAdditionTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /SegueAdditionUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /SegueAdditionUITests/SegueAdditionUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SegueAdditionUITests.swift 3 | // SegueAdditionUITests 4 | // 5 | // Created by kingkong999yhirose on 2016/04/18. 6 | // Copyright © 2016年 kingkong999yhirose. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class SegueAdditionUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | 33 | let app = XCUIApplication() 34 | let toTestButton = app.buttons["To TEST"] 35 | toTestButton.tap() 36 | 37 | let manualSegueStandardButton = app.buttons["Manual Segue Standard"] 38 | manualSegueStandardButton.tap() 39 | 40 | let backButton = app.navigationBars["SegueAddition.ManualSegueUseStandardView"].children(matching: .button).matching(identifier: "Back").element(boundBy: 0) 41 | backButton.tap() 42 | 43 | let manualSegueUseSegueButton = app.buttons["Manual Segue Use Segue"] 44 | manualSegueUseSegueButton.tap() 45 | 46 | let backButton2 = app.navigationBars["SegueAddition.ManualSegueUseSegueClosureView"].children(matching: .button).matching(identifier: "Back").element(boundBy: 0) 47 | backButton2.tap() 48 | 49 | let segueSettingStoryboardButton = app.buttons["Segue Setting Storyboard"] 50 | segueSettingStoryboardButton.tap() 51 | 52 | let backButton3 = app.navigationBars["SegueAddition.SegueSettingStoryboardView"].children(matching: .button).matching(identifier: "Back").element(boundBy: 0) 53 | backButton3.tap() 54 | manualSegueStandardButton.tap() 55 | backButton.tap() 56 | manualSegueUseSegueButton.tap() 57 | backButton2.tap() 58 | segueSettingStoryboardButton.tap() 59 | backButton3.tap() 60 | 61 | let backButton4 = app.navigationBars["SegueAddition.CycleReferenceCheckView"].children(matching: .button).matching(identifier: "Back").element(boundBy: 0) 62 | backButton4.tap() 63 | toTestButton.tap() 64 | backButton4.tap() 65 | 66 | } 67 | 68 | } 69 | --------------------------------------------------------------------------------