Skip to content

Commit

Permalink
작업중
Browse files Browse the repository at this point in the history
  • Loading branch information
joseph704 committed Aug 12, 2024
1 parent 8935808 commit e257edc
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 54 deletions.
4 changes: 2 additions & 2 deletions StreetDrop/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ SPEC CHECKSUMS:
NMapsGeometry: 53c573ead66466681cf123f99f698dc8071a4b83
NMapsMap: aaa64717249b06ae82c3a3addb3a01f0e33100ab

PODFILE CHECKSUM: c1edcf3d49503875acf5f6e7bfd364191c925046
PODFILE CHECKSUM: a8c0902adb23412ed3e2bbd632c3c7f7846b9405

COCOAPODS: 1.15.2
COCOAPODS: 1.12.1
6 changes: 4 additions & 2 deletions StreetDrop/ShareExtension/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>GADApplicationIdentifier</key>
<string>ca-app-pub-7717835511859758~1784783942</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).ShareViewController</string>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<string>TRUEPREDICATE</string>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
</dict>
Expand Down
24 changes: 0 additions & 24 deletions StreetDrop/ShareExtension/View/Base.lproj/MainInterface.storyboard

This file was deleted.

46 changes: 33 additions & 13 deletions StreetDrop/ShareExtension/View/ShareViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,45 @@ import Social

import RxSwift

final class ShareViewController: SLComposeServiceViewController {
final class ShareViewController: UIViewController {
private let viewModel: ShareViewModel = .init()
private let disposeBag: DisposeBag = .init()

override func isContentValid() -> Bool {
return true
}

override func didSelectPost() {
extensionContext?.completeRequest(returningItems: [], completionHandler: nil)
}

override func configurationItems() -> [Any]! {
return []
}

override func viewDidLoad() {
super.viewDidLoad()
bindViewModel()
// 원하는 높이 지정
preferredContentSize = CGSize(width: view.bounds.width, height: 602)

view.backgroundColor = .white

let label = UILabel()
label.text = "Custom Share Extension"
label.textAlignment = .center
label.translatesAutoresizingMaskIntoConstraints = false

let button = UIButton(type: .system)
button.setTitle("Share", for: .normal)
button.addTarget(self, action: #selector(handleShare), for: .touchUpInside)
button.translatesAutoresizingMaskIntoConstraints = false

view.addSubview(label)
view.addSubview(button)

NSLayoutConstraint.activate([
label.centerXAnchor.constraint(equalTo: view.centerXAnchor),
label.centerYAnchor.constraint(equalTo: view.centerYAnchor),

button.topAnchor.constraint(equalTo: label.bottomAnchor, constant: 20),
button.centerXAnchor.constraint(equalTo: view.centerXAnchor)
])
}

@objc func handleShare() {
// 공유 처리 로직

// 작업 완료 후 종료
self.extensionContext?.completeRequest(returningItems: nil, completionHandler: nil)
}
}

Expand Down
26 changes: 26 additions & 0 deletions StreetDrop/ShareExtension/ViewModel/ShareViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ protocol ShareViewModelType {
final class ShareViewModel: NSObject, ShareViewModelType {
private let output: Output = .init()
private let locationManger: CLLocationManager = .init()
private let searchMusicUsecase: SearchMusicUsecase
private let disposeBag: DisposeBag = .init()

init(searchMusicUsecase: SearchMusicUsecase = DefaultSearchingMusicUsecase()) {
self.searchMusicUsecase = searchMusicUsecase
}

struct Input {
let viewDidLoadEvent: Observable<Void>
Expand All @@ -45,5 +51,25 @@ final class ShareViewModel: NSObject, ShareViewModelType {
}

extension ShareViewModel: CLLocationManagerDelegate {
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
guard let location = locations.last else { return }

searchMusicUsecase.getVillageName(
latitude: location.coordinate.latitude,
longitude: location.coordinate.longitude
)
.subscribe { villageName in

} onFailure: { error in

}
.disposed(by: disposeBag)

manager.stopUpdatingLocation()
}

func locationManager(_ manager: CLLocationManager, didFailWithError error: any Error) {
// TODO: 요셉, 에러메세지 띄우기
print("위치 정보를 가져오는데 실패했습니다: \(error.localizedDescription)")
}
}
45 changes: 33 additions & 12 deletions StreetDrop/StreetDrop.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
6AAFD9AD2BCE55A4001A6772 /* LevelPolicy.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AAFD9AC2BCE55A4001A6772 /* LevelPolicy.swift */; };
6AAFD9AF2BCE567A001A6772 /* FetchingLevelPolicyUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AAFD9AE2BCE567A001A6772 /* FetchingLevelPolicyUseCase.swift */; };
6AAFD9B12BCE56A6001A6772 /* DefaultFetchingLevelPolicyUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AAFD9B02BCE56A6001A6772 /* DefaultFetchingLevelPolicyUseCase.swift */; };
ADE9937EA437A957C3ABA1A1 /* libPods-ShareExtension.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 65CC40267A5C3004E2F36C6C /* libPods-ShareExtension.a */; };
B46578C32B00BC060024B066 /* LeftAlignedCollectionViewFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = B46578C22B00BC060024B066 /* LeftAlignedCollectionViewFlowLayout.swift */; };
B4B9EE842ADBDFFB000A6507 /* RecommendMusicSearchCollectionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4B9EE832ADBDFFB000A6507 /* RecommendMusicSearchCollectionView.swift */; };
B4B9EE862ADEB2AC000A6507 /* RecommendKeywordItemCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4B9EE852ADEB2AC000A6507 /* RecommendKeywordItemCell.swift */; };
Expand Down Expand Up @@ -191,7 +192,6 @@
C41BD2E92A38467A0090EF2B /* UIImageView+ImageCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = C41BD2E82A38467A0090EF2B /* UIImageView+ImageCache.swift */; };
C41BD2EC2A3848880090EF2B /* UIImage+loadURLImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C41BD2EB2A3848880090EF2B /* UIImage+loadURLImage.swift */; };
C41BD2ED2A3848880090EF2B /* UIImage+loadURLImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = C41BD2EB2A3848880090EF2B /* UIImage+loadURLImage.swift */; };
C42182C02C697F9700B73A99 /* Base in Resources */ = {isa = PBXBuildFile; fileRef = C42182BF2C697F9700B73A99 /* Base */; };
C42182C42C697F9700B73A99 /* ShareExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = C42182BA2C697F9700B73A99 /* ShareExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
C42361782B0CE8F800F61E3C /* RecommendMusic.swift in Sources */ = {isa = PBXBuildFile; fileRef = C42361772B0CE8F800F61E3C /* RecommendMusic.swift */; };
C432DE052C69D963003DBA18 /* RxCocoa in Frameworks */ = {isa = PBXBuildFile; productRef = C432DE042C69D963003DBA18 /* RxCocoa */; };
Expand Down Expand Up @@ -573,6 +573,7 @@
08F574572C46985300635B54 /* DefaultFetchingMyLikeListUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultFetchingMyLikeListUseCase.swift; sourceTree = "<group>"; };
08F5745A2C4698B300635B54 /* FetchingMyLevelUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchingMyLevelUseCase.swift; sourceTree = "<group>"; };
08F5745C2C46992500635B54 /* DefaultFetchingMyLevelUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultFetchingMyLevelUseCase.swift; sourceTree = "<group>"; };
13ACF3C8F07C1A2CFE303F4A /* Pods-ShareExtension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ShareExtension.debug.xcconfig"; path = "Target Support Files/Pods-ShareExtension/Pods-ShareExtension.debug.xcconfig"; sourceTree = "<group>"; };
1816ED3B2A680608005009FC /* MusicListSectionHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusicListSectionHeaderView.swift; sourceTree = "<group>"; };
1816ED3E2A68064E005009FC /* MyPageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageViewModel.swift; sourceTree = "<group>"; };
1816ED402A685704005009FC /* NicknameEditViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NicknameEditViewModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -654,6 +655,7 @@
41FF58F92A06B38800ABB871 /* NetworkManagerTest.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NetworkManagerTest.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
41FF58FB2A06B38800ABB871 /* NetworkManagerTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkManagerTest.swift; sourceTree = "<group>"; };
642A4AE13B198B9F5F5F76E4 /* libPods-StreetDrop.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-StreetDrop.a"; sourceTree = BUILT_PRODUCTS_DIR; };
65CC40267A5C3004E2F36C6C /* libPods-ShareExtension.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ShareExtension.a"; sourceTree = BUILT_PRODUCTS_DIR; };
6A1386AA2B4F8A5000E49BB5 /* String+Base64.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Base64.swift"; sourceTree = "<group>"; };
6A26BF312B33D1E40007B6B7 /* FetchingSingleMusicUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchingSingleMusicUseCase.swift; sourceTree = "<group>"; };
6A26BF332B33D2210007B6B7 /* DefaultFetchingSingleMusicUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultFetchingSingleMusicUseCase.swift; sourceTree = "<group>"; };
Expand All @@ -675,6 +677,7 @@
6AAFD9AC2BCE55A4001A6772 /* LevelPolicy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LevelPolicy.swift; sourceTree = "<group>"; };
6AAFD9AE2BCE567A001A6772 /* FetchingLevelPolicyUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FetchingLevelPolicyUseCase.swift; sourceTree = "<group>"; };
6AAFD9B02BCE56A6001A6772 /* DefaultFetchingLevelPolicyUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultFetchingLevelPolicyUseCase.swift; sourceTree = "<group>"; };
B20DBB514344BC89E684862A /* Pods-ShareExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ShareExtension.release.xcconfig"; path = "Target Support Files/Pods-ShareExtension/Pods-ShareExtension.release.xcconfig"; sourceTree = "<group>"; };
B46578C22B00BC060024B066 /* LeftAlignedCollectionViewFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LeftAlignedCollectionViewFlowLayout.swift; sourceTree = "<group>"; };
B4B9EE832ADBDFFB000A6507 /* RecommendMusicSearchCollectionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendMusicSearchCollectionView.swift; sourceTree = "<group>"; };
B4B9EE852ADEB2AC000A6507 /* RecommendKeywordItemCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecommendKeywordItemCell.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -704,7 +707,6 @@
C41BD2EB2A3848880090EF2B /* UIImage+loadURLImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImage+loadURLImage.swift"; sourceTree = "<group>"; };
C42182BA2C697F9700B73A99 /* ShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = ShareExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
C42182BC2C697F9700B73A99 /* ShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewController.swift; sourceTree = "<group>"; };
C42182BF2C697F9700B73A99 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = "<group>"; };
C42182C12C697F9700B73A99 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
C42182CB2C69C41800B73A99 /* ShareViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewModel.swift; sourceTree = "<group>"; };
C42361772B0CE8F800F61E3C /* RecommendMusic.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RecommendMusic.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -856,6 +858,7 @@
C4C9D5A82C69FBCB005D90C4 /* RxMoya in Frameworks */,
C432DE052C69D963003DBA18 /* RxCocoa in Frameworks */,
C4C9D5A62C69FBCB005D90C4 /* ReactiveMoya in Frameworks */,
ADE9937EA437A957C3ABA1A1 /* libPods-ShareExtension.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1723,6 +1726,7 @@
isa = PBXGroup;
children = (
642A4AE13B198B9F5F5F76E4 /* libPods-StreetDrop.a */,
65CC40267A5C3004E2F36C6C /* libPods-ShareExtension.a */,
);
name = Frameworks;
sourceTree = "<group>";
Expand All @@ -1749,7 +1753,6 @@
isa = PBXGroup;
children = (
C42182BC2C697F9700B73A99 /* ShareViewController.swift */,
C42182BE2C697F9700B73A99 /* MainInterface.storyboard */,
);
path = View;
sourceTree = "<group>";
Expand Down Expand Up @@ -2113,6 +2116,8 @@
children = (
33C6E9256EDABFB58F83B1C8 /* Pods-StreetDrop.debug.xcconfig */,
2611E7411DB7C5436A272A27 /* Pods-StreetDrop.release.xcconfig */,
13ACF3C8F07C1A2CFE303F4A /* Pods-ShareExtension.debug.xcconfig */,
B20DBB514344BC89E684862A /* Pods-ShareExtension.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
Expand Down Expand Up @@ -2243,6 +2248,7 @@
isa = PBXNativeTarget;
buildConfigurationList = C42182C82C697F9700B73A99 /* Build configuration list for PBXNativeTarget "ShareExtension" */;
buildPhases = (
7AC41A8E2B2F8DC531DD276C /* [CP] Check Pods Manifest.lock */,
C42182B62C697F9700B73A99 /* Sources */,
C42182B72C697F9700B73A99 /* Frameworks */,
C42182B82C697F9700B73A99 /* Resources */,
Expand Down Expand Up @@ -2355,7 +2361,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C42182C02C697F9700B73A99 /* Base in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -2382,6 +2387,28 @@
shellPath = /bin/sh;
shellScript = "\"${BUILD_DIR%Build/*}SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run\"\n";
};
7AC41A8E2B2F8DC531DD276C /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-ShareExtension-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
AAAD975E0D7F49C08E568D59 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -2931,14 +2958,6 @@
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
C42182BE2C697F9700B73A99 /* MainInterface.storyboard */ = {
isa = PBXVariantGroup;
children = (
C42182BF2C697F9700B73A99 /* Base */,
);
name = MainInterface.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
Expand Down Expand Up @@ -3195,6 +3214,7 @@
};
C42182C62C697F9700B73A99 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 13ACF3C8F07C1A2CFE303F4A /* Pods-ShareExtension.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CODE_SIGN_IDENTITY = "Apple Development";
Expand Down Expand Up @@ -3227,6 +3247,7 @@
};
C42182C72C697F9700B73A99 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = B20DBB514344BC89E684862A /* Pods-ShareExtension.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
CODE_SIGN_IDENTITY = "Apple Distribution";
Expand Down
4 changes: 3 additions & 1 deletion StreetDrop/StreetDrop/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ private extension AppDelegate {
func setupAppDependencies() {
FirebaseApp.configure()
NMFAuthManager.shared().clientId = Bundle.main.naverMapsClientID
GADMobileAds.sharedInstance().start(completionHandler: nil)
if Bundle.main.bundlePath.hasSuffix(".appex") == false {
GADMobileAds.sharedInstance().start(completionHandler: nil)
}
UNUserNotificationCenter.current().delegate = self
Messaging.messaging().delegate = self
}
Expand Down

0 comments on commit e257edc

Please sign in to comment.