Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ let package = Package(
resources: [
.process("Resources/Views"),
.process("Resources/Resource.bundle"),
.copy("Resources/Assets.xcassets")
.process("Resources/Assets.xcassets")
]
)
]
Expand Down
12 changes: 6 additions & 6 deletions Sources/Views/CardFormViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,11 @@ public class CardFormViewController: UIViewController {
createToken()
}

@objc private func handleKeyboardShow(notification: Notification) {
@objc private func textFieldDidBeginEditing(notification: Notification) {
submitButton.isHidden = true
}

@objc private func handleKeyboardHide(notification: Notification) {
@objc private func textFieldDidEndEditing(notification: Notification) {
submitButton.isHidden = false
}

Expand Down Expand Up @@ -273,12 +273,12 @@ public class CardFormViewController: UIViewController {

private func setupKeyboardNotification() {
NotificationCenter.default.addObserver(self,
selector: #selector(handleKeyboardShow),
name: UIResponder.keyboardWillShowNotification,
selector: #selector(textFieldDidBeginEditing),
name: UITextField.textDidBeginEditingNotification,
object: nil)
NotificationCenter.default.addObserver(self,
selector: #selector(handleKeyboardHide),
name: UIResponder.keyboardWillHideNotification,
selector: #selector(textFieldDidEndEditing),
name: UITextField.textDidEndEditingNotification,
object: nil)
NotificationCenter.default.addObserver(self,
selector: #selector(keyboardWillChangeFrame),
Expand Down
21 changes: 19 additions & 2 deletions example-swift/example-swift-carthage-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,27 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
Expand Down
18 changes: 12 additions & 6 deletions example-swift/example-swift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
3219F14C26B1087400D2AE00 /* CardFormViewWith3DSViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3219F14B26B1087400D2AE00 /* CardFormViewWith3DSViewController.swift */; };
32B471E024C6AD180061579C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32B471DF24C6AD180061579C /* AppDelegate.swift */; };
32B471E224C6AD180061579C /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32B471E124C6AD180061579C /* SceneDelegate.swift */; };
07A2FE022F8B0F0000000002 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07A2FE012F8B0F0000000001 /* SceneDelegate.swift */; };
07A2FE032F8B0F0000000003 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 07A2FE012F8B0F0000000001 /* SceneDelegate.swift */; };
32B471E424C6AD180061579C /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32B471E324C6AD180061579C /* ContentView.swift */; };
32B471E624C6AD1B0061579C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 32B471E524C6AD1B0061579C /* Assets.xcassets */; };
32B471E924C6AD1B0061579C /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 32B471E824C6AD1B0061579C /* Preview Assets.xcassets */; };
Expand Down Expand Up @@ -101,6 +103,7 @@
32B471ED24C6AD1B0061579C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
32CB11241FDA7E3D007AD8F5 /* example-swift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "example-swift.app"; sourceTree = BUILT_PRODUCTS_DIR; };
32CB11271FDA7E3D007AD8F5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
07A2FE012F8B0F0000000001 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
32CB11291FDA7E3D007AD8F5 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
32CB112C1FDA7E3D007AD8F5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
32CB112E1FDA7E3D007AD8F5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
Expand Down Expand Up @@ -195,6 +198,7 @@
isa = PBXGroup;
children = (
32CB11271FDA7E3D007AD8F5 /* AppDelegate.swift */,
07A2FE012F8B0F0000000001 /* SceneDelegate.swift */,
32CB112E1FDA7E3D007AD8F5 /* Assets.xcassets */,
ED50839223278BB800C64A7F /* CardFormViewExampleViewController.swift */,
ED5085BC232A0FE300C64A7F /* CardFormViewScrollViewController.swift */,
Expand Down Expand Up @@ -442,6 +446,7 @@
32CB112A1FDA7E3D007AD8F5 /* ViewController.swift in Sources */,
ED50839323278BB800C64A7F /* CardFormViewExampleViewController.swift in Sources */,
32CB11281FDA7E3D007AD8F5 /* AppDelegate.swift in Sources */,
07A2FE022F8B0F0000000002 /* SceneDelegate.swift in Sources */,
EDADA266238CBE780057FDF3 /* SampleService.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -458,6 +463,7 @@
710E2C342F71AA480063E80D /* ViewController.swift in Sources */,
710E2C352F71AA480063E80D /* CardFormViewExampleViewController.swift in Sources */,
710E2C362F71AA480063E80D /* AppDelegate.swift in Sources */,
07A2FE032F8B0F0000000003 /* SceneDelegate.swift in Sources */,
710E2C372F71AA480063E80D /* SampleService.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -677,7 +683,7 @@
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "example-swift/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -698,7 +704,7 @@
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "example-swift/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -719,7 +725,7 @@
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "example-swift-carthage-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -740,7 +746,7 @@
DEVELOPMENT_TEAM = "";
FRAMEWORK_SEARCH_PATHS = "$(inherited)";
INFOPLIST_FILE = "example-swift-carthage-Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -796,11 +802,11 @@
/* Begin XCLocalSwiftPackageReference section */
710E2C2A2F71A9F20063E80D /* XCLocalSwiftPackageReference ".." */ = {
isa = XCLocalSwiftPackageReference;
relativePath = "..";
relativePath = ..;
};
71BF9BC62F7D292400A6E267 /* XCLocalSwiftPackageReference ".." */ = {
isa = XCLocalSwiftPackageReference;
relativePath = "..";
relativePath = ..;
};
/* End XCLocalSwiftPackageReference section */

Expand Down
26 changes: 7 additions & 19 deletions example-swift/example-swift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ let App3DSRedirectURLKey = "swift-app"
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
Expand All @@ -32,26 +30,16 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return true
}

func application(_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {

return ThreeDSecureProcessHandler.shared.completeThreeDSecureProcess(url: url)
}

func applicationWillResignActive(_ application: UIApplication) {
}

func applicationDidEnterBackground(_ application: UIApplication) {
}

func applicationWillEnterForeground(_ application: UIApplication) {
}
// MARK: UISceneSession Lifecycle

func applicationDidBecomeActive(_ application: UIApplication) {
func application(_ application: UIApplication,
configurationForConnecting connectingSceneSession: UISceneSession,
options: UIScene.ConnectionOptions) -> UISceneConfiguration {
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}

func applicationWillTerminate(_ application: UIApplication) {
func application(_ application: UIApplication,
didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
}

}
21 changes: 19 additions & 2 deletions example-swift/example-swift/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,27 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand Down
46 changes: 46 additions & 0 deletions example-swift/example-swift/SceneDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//
// SceneDelegate.swift
// example-swift
//
// Copyright © 2026 PAY, Inc. All rights reserved.
//

import UIKit
import PAYJP

@available(iOS 13.0, *)
class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?

func scene(_ scene: UIScene,
willConnectTo session: UISceneSession,
options connectionOptions: UIScene.ConnectionOptions) {
guard scene is UIWindowScene else { return }

if let urlContext = connectionOptions.urlContexts.first {
ThreeDSecureProcessHandler.shared.completeThreeDSecureProcess(url: urlContext.url)
}
}

func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
guard let urlContext = URLContexts.first else { return }
ThreeDSecureProcessHandler.shared.completeThreeDSecureProcess(url: urlContext.url)
}

func sceneDidDisconnect(_ scene: UIScene) {
}

func sceneDidBecomeActive(_ scene: UIScene) {
}

func sceneWillResignActive(_ scene: UIScene) {
}

func sceneWillEnterForeground(_ scene: UIScene) {
}

func sceneDidEnterBackground(_ scene: UIScene) {
}

}