-
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.
✨#297: 다른 앱에서 Share Extension으로 가져온 ExtensionItem값이 없는 경우, 음악 정보 불러오지…
… 못했다는 UI 렌더링
- Loading branch information
Showing
9 changed files
with
188 additions
and
12 deletions.
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 |
---|---|---|
|
@@ -25,4 +25,4 @@ SPEC CHECKSUMS: | |
|
||
PODFILE CHECKSUM: a8c0902adb23412ed3e2bbd632c3c7f7846b9405 | ||
|
||
COCOAPODS: 1.12.1 | ||
COCOAPODS: 1.15.2 |
105 changes: 105 additions & 0 deletions
105
StreetDrop/ShareExtension/View/FailedLoadingMusicView/FailedLoadingMusicView.swift
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,105 @@ | ||
// | ||
// FailedLoadingMusicView.swift | ||
// ShareExtension | ||
// | ||
// Created by 차요셉 on 8/20/24. | ||
// | ||
|
||
import UIKit | ||
|
||
import RxSwift | ||
import RxRelay | ||
import SnapKit | ||
|
||
final class FailedLoadingMusicView: UIView { | ||
private let searchingMusicButtonEventRelay: PublishRelay<Void> = .init() | ||
var searchingMusicButtonEvent: Observable<Void> { | ||
searchingMusicButtonEventRelay.asObservable() | ||
} | ||
|
||
private let disposeBag: DisposeBag = .init() | ||
|
||
override init(frame: CGRect) { | ||
super.init(frame: frame) | ||
bindAction() | ||
configureUI() | ||
} | ||
|
||
@available(*, unavailable) | ||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
private let warningImageView: UIImageView = { | ||
let imageView: UIImageView = .init(image: .init(named: "warning")) | ||
|
||
return imageView | ||
}() | ||
|
||
private let guidingLabel: UILabel = { | ||
let label: UILabel = .init() | ||
label.text = "음악 정보를 불러오지 못했어요" | ||
label.font = .pretendard(size: 18, weight: 700) | ||
label.textColor = .white | ||
label.setLineHeight(lineHeight: 28) | ||
|
||
return label | ||
}() | ||
|
||
private let searchingMusicButton: UIButton = { | ||
let button = UIButton(type: .system) | ||
button.setTitle("음악 검색하기", for: .normal) | ||
button.setTitleColor(.gray900, for: .normal) | ||
button.titleLabel?.font = .pretendard(size: 16, weight: 700) | ||
button.layer.cornerRadius = 12 | ||
button.backgroundColor = .primary400 | ||
|
||
return button | ||
}() | ||
} | ||
|
||
private extension FailedLoadingMusicView { | ||
func bindAction() { | ||
searchingMusicButton.rx.tap | ||
.bind(to: searchingMusicButtonEventRelay) | ||
.disposed(by: disposeBag) | ||
} | ||
|
||
func configureUI() { | ||
layer.cornerRadius = 20 | ||
layer.borderWidth = 1 | ||
layer.borderColor = UIColor.gray600.cgColor | ||
|
||
backgroundColor = .gray800 | ||
|
||
snp.makeConstraints { | ||
$0.height.equalTo(192) | ||
} | ||
|
||
[ | ||
warningImageView, | ||
guidingLabel, | ||
searchingMusicButton | ||
].forEach { | ||
addSubview($0) | ||
} | ||
|
||
warningImageView.snp.makeConstraints { | ||
$0.width.height.equalTo(32) | ||
$0.top.equalToSuperview().inset(20) | ||
$0.leading.equalToSuperview().inset(24) | ||
} | ||
|
||
guidingLabel.snp.makeConstraints { | ||
$0.height.equalTo(32) | ||
$0.top.equalToSuperview().inset(20) | ||
$0.leading.equalTo(warningImageView.snp.trailing) | ||
} | ||
|
||
searchingMusicButton.snp.makeConstraints { | ||
$0.height.equalTo(56) | ||
$0.horizontalEdges.equalToSuperview().inset(24) | ||
$0.bottom.equalToSuperview().inset(48) | ||
} | ||
} | ||
} |
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
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
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
23 changes: 23 additions & 0 deletions
23
StreetDrop/StreetDrop/Resource/Assets.xcassets/warning.imageset/Contents.json
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,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "warning.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "[email protected]", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+632 Bytes
StreetDrop/StreetDrop/Resource/Assets.xcassets/warning.imageset/warning.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.08 KB
StreetDrop/StreetDrop/Resource/Assets.xcassets/warning.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.51 KB
StreetDrop/StreetDrop/Resource/Assets.xcassets/warning.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.