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
20 changes: 1 addition & 19 deletions ShareExtension/ShareViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,7 @@ class CustomShareViewController: UIViewController {
self.extensionContext?.completeRequest(returningItems: nil, completionHandler: nil)
})
}

@IBAction func save() {
if dataURL != "" {
let sharedData = dataURL
print(sharedData)
} else {
print("저장에 실패하였습니다.")
}

self.hideExtensionWithCompletionHandler(completion: { _ in
self.extensionContext?.completeRequest(returningItems: nil, completionHandler: nil)
})
}



@objc func openURL(_ url: URL) -> Bool {
self.hideExtensionWithCompletionHandler(completion: { _ in
self.extensionContext?.completeRequest(returningItems: nil, completionHandler: nil)
Expand Down Expand Up @@ -110,10 +96,6 @@ extension CustomShareViewController: ShareExtensionBackGroundViewDelegate {
cancel()
}

func didTapSave() {
save()
}

func didTapOpenApp() {
let sharedData = dataURL
let url = URL(string: "iBox://\(sharedData)")!
Expand Down
22 changes: 0 additions & 22 deletions ShareExtension/View/ShareExtensionBackGroundView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import SnapKit

protocol ShareExtensionBackGroundViewDelegate: AnyObject {
func didTapCancel()
func didTapSave()
func didTapOpenApp()
}

Expand Down Expand Up @@ -49,16 +48,6 @@ class ShareExtensionBackGroundView: UIView {
return button
}()

lazy var saveButton: UIButton = {
let button = UIButton()
button.configuration = .plain()
button.configuration?.attributedTitle = .init(
"Save",
attributes: .init([.font: UIFont.boldSystemFont(ofSize: 14)])
)
return button
}()

lazy var openAppButton: UIButton = {
let button = UIButton()
button.configuration = .plain()
Expand Down Expand Up @@ -89,7 +78,6 @@ class ShareExtensionBackGroundView: UIView {
addSubview(label)
addSubview(linkLabel)
addSubview(cancelButton)
addSubview(saveButton)
addSubview(openAppButton)
}

Expand All @@ -108,11 +96,6 @@ class ShareExtensionBackGroundView: UIView {
}

cancelButton.snp.makeConstraints {
$0.trailing.equalTo(saveButton.snp.leading).offset(-20)
$0.centerY.equalTo(openAppButton.snp.centerY)
}

saveButton.snp.makeConstraints {
$0.trailing.equalTo(openAppButton.snp.leading).offset(-20)
$0.centerY.equalTo(openAppButton.snp.centerY)
}
Expand All @@ -124,7 +107,6 @@ class ShareExtensionBackGroundView: UIView {

private func setupButtonAction() {
cancelButton.addTarget(self, action: #selector(cancelButtonTapped), for: .touchUpInside)
saveButton.addTarget(self, action: #selector(saveButtonTapped), for: .touchUpInside)
openAppButton.addTarget(self, action: #selector(openAppButtonTapped), for: .touchUpInside)
}

Expand All @@ -138,10 +120,6 @@ class ShareExtensionBackGroundView: UIView {
delegate?.didTapCancel()
}

@objc func saveButtonTapped() {
delegate?.didTapSave()
}

@objc func openAppButtonTapped() {
delegate?.didTapOpenApp()
}
Expand Down