-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
309 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>NSExtension</key> | ||
<dict> | ||
<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> | ||
</dict> | ||
</plist> |
24 changes: 24 additions & 0 deletions
24
StreetDrop/ShareExtension/View/Base.lproj/MainInterface.storyboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="j1y-V4-xli"> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<scenes> | ||
<!--Share View Controller--> | ||
<scene sceneID="ceB-am-kn3"> | ||
<objects> | ||
<viewController id="j1y-V4-xli" customClass="ShareViewController" customModuleProvider="target" sceneMemberID="viewController"> | ||
<view key="view" opaque="NO" contentMode="scaleToFill" id="wbc-yd-nQP"> | ||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<color key="backgroundColor" red="0.0" green="0.0" blue="0.0" alpha="0.0" colorSpace="custom" customColorSpace="sRGB"/> | ||
<viewLayoutGuide key="safeArea" id="1Xd-am-t49"/> | ||
</view> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="CEy-Cv-SGf" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
</scene> | ||
</scenes> | ||
</document> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// ShareViewController.swift | ||
// ShareExtension | ||
// | ||
// Created by 차요셉 on 8/12/24. | ||
// | ||
|
||
import UIKit | ||
import Social | ||
|
||
final class ShareViewController: SLComposeServiceViewController { | ||
|
||
|
||
override func isContentValid() -> Bool { | ||
return true | ||
} | ||
|
||
override func didSelectPost() { | ||
extensionContext?.completeRequest(returningItems: [], completionHandler: nil) | ||
} | ||
|
||
override func configurationItems() -> [Any]! { | ||
return [] | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// | ||
// ShareViewModel.swift | ||
// ShareExtension | ||
// | ||
// Created by 차요셉 on 8/12/24. | ||
// | ||
|
||
import CoreLocation | ||
import Foundation | ||
|
||
import RxSwift | ||
import RxRelay | ||
|
||
protocol ShareViewModelType { | ||
associatedtype Input | ||
associatedtype Output | ||
|
||
func convert(input: Input, disposedBag: DisposeBag) -> Output | ||
} | ||
|
||
final class ShareViewModel: NSObject, ShareViewModelType { | ||
private let output: Output = .init() | ||
private let locationManger: CLLocationManager = .init() | ||
|
||
struct Input { | ||
let viewDidLoadEvent: Observable<Void> | ||
} | ||
|
||
struct Output { | ||
|
||
} | ||
|
||
func convert(input: Input, disposedBag: DisposeBag) -> Output { | ||
input.viewDidLoadEvent | ||
.subscribe(with: self) { owner, _ in | ||
owner.locationManger.delegate = self | ||
owner.locationManger.requestWhenInUseAuthorization() | ||
owner.locationManger.startUpdatingLocation() | ||
} | ||
.disposed(by: disposedBag) | ||
|
||
|
||
return output | ||
} | ||
} | ||
|
||
extension ShareViewModel: CLLocationManagerDelegate { | ||
|
||
} |
Oops, something went wrong.