Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

자잘한 버그 수정 및 리팩토링 #93

Merged
merged 4 commits into from
Dec 8, 2022
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
4 changes: 4 additions & 0 deletions SpaceCapsule/SpaceCapsule.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
4A1D1BBF2940286B00F47ACB /* CapsuleSettingsCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A1D1BBE2940286B00F47ACB /* CapsuleSettingsCoordinator.swift */; };
4A1D1BC12940292A00F47ACB /* CapsuleSettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A1D1BC02940292A00F47ACB /* CapsuleSettingsViewModel.swift */; };
4A1D1BC3294033C200F47ACB /* CapsuleSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A1D1BC2294033C200F47ACB /* CapsuleSettingsView.swift */; };
4A1D1BC62941F3C500F47ACB /* BlurEffectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A1D1BC52941F3C500F47ACB /* BlurEffectView.swift */; };
4A1FEFF8292F1F1200A935BB /* CustomAnnotation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A1FEFF7292F1F1200A935BB /* CustomAnnotation.swift */; };
4A2449D129360669000EE58C /* DetailImageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A2449D029360669000EE58C /* DetailImageCell.swift */; };
4A9E9147292A2A5A00B7CC5C /* CLLocationManager+Rx.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A9E9146292A2A5A00B7CC5C /* CLLocationManager+Rx.swift */; };
Expand Down Expand Up @@ -320,6 +321,7 @@
4A1D1BBE2940286B00F47ACB /* CapsuleSettingsCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CapsuleSettingsCoordinator.swift; sourceTree = "<group>"; };
4A1D1BC02940292A00F47ACB /* CapsuleSettingsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CapsuleSettingsViewModel.swift; sourceTree = "<group>"; };
4A1D1BC2294033C200F47ACB /* CapsuleSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CapsuleSettingsView.swift; sourceTree = "<group>"; };
4A1D1BC52941F3C500F47ACB /* BlurEffectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlurEffectView.swift; sourceTree = "<group>"; };
4A1FEFF7292F1F1200A935BB /* CustomAnnotation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomAnnotation.swift; sourceTree = "<group>"; };
4A2449D029360669000EE58C /* DetailImageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailImageCell.swift; sourceTree = "<group>"; };
4A9E9146292A2A5A00B7CC5C /* CLLocationManager+Rx.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CLLocationManager+Rx.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -387,6 +389,7 @@
0DFF50DE2940587600079FA6 /* RefreshButton.swift */,
0DFF50DC29402E3100079FA6 /* EmptyView.swift */,
0DD83D12292F51960020F15C /* LoadingIndicatorView.swift */,
4A1D1BC52941F3C500F47ACB /* BlurEffectView.swift */,
0D9A834C293788A300D00303 /* Map */,
0DCB22942924CE61002CB095 /* Theme */,
);
Expand Down Expand Up @@ -1228,6 +1231,7 @@
0D6CA337292216A300E02393 /* SceneDelegate.swift in Sources */,
59D8CFBA293609E000FD9CF6 /* HomeCapsuleCellItem.swift in Sources */,
599C1A4D292CC99A00517E93 /* DiskImageCache.swift in Sources */,
4A1D1BC62941F3C500F47ACB /* BlurEffectView.swift in Sources */,
0D90DAEF29238B77000DCC84 /* CapsuleLocateView.swift in Sources */,
28C8C97C292DC360005615BB /* SortPolicySelectionViewController.swift in Sources */,
4A2449D129360669000EE58C /* DetailImageCell.swift in Sources */,
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,75 +1,9 @@
{
"images" : [
{
"filename" : "40.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "60.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "29.png",
"idiom" : "iphone",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "58.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "87.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "80.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "120.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "57.png",
"idiom" : "iphone",
"scale" : "1x",
"size" : "57x57"
},
{
"filename" : "114.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "57x57"
},
{
"filename" : "120.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "180.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "1024.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
Expand Down
26 changes: 26 additions & 0 deletions SpaceCapsule/SpaceCapsule/Components/BlurEffectView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
//
// BlurEffectView.swift
// SpaceCapsule
//
// Created by jisu on 2022/12/08.
//

import UIKit

final class CapsuleBlurEffectView: UIVisualEffectView {
init() {
super.init(effect: UIBlurEffect(style: .systemUltraThinMaterialDark))
self.layer.cornerRadius = FrameResource.listCapsuleCellWidth / 2
self.clipsToBounds = true
}

@available(*, unavailable)
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

func changeStyle(to newStyle: UIBlurEffect.Style) {
let effect = UIBlurEffect(style: newStyle)
self.effect = effect
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class CustomNavigationController: UINavigationController {

override func viewDidLoad() {
super.viewDidLoad()

applyThemeStyle()
}

Expand All @@ -23,6 +23,7 @@ final class CustomNavigationController: UINavigationController {

navigationBar.titleTextAttributes = [.font: UIFont.themeFont(ofSize: 25) as Any]
navigationBar.tintColor = .themeBlack
navigationBar.topItem?.backButtonTitle = ""
}

func addIndicatorView() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,3 @@ class ProfileButton: UIControl {
}
}
}

2 changes: 1 addition & 1 deletion SpaceCapsule/SpaceCapsule/Manager/LocationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import RxSwift

final class LocationManager {
static let shared = LocationManager()
static let openableRange = 10000.0
static let openableRange = 100.0

private init() {}

Expand Down
2 changes: 1 addition & 1 deletion SpaceCapsule/SpaceCapsule/Resources/FrameResource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ enum FrameResource {
static let detailMapHeight: CGFloat = 200.0
static let userTrackingButtonSize: CGFloat = 50.0

static let blurEffectAlpha: CGFloat = 0.5
static let blurEffectAlpha: CGFloat = 0.8

static let profileImageWidth: CGFloat = 100.0
static let profileButtonHeight: CGFloat = 40.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,10 @@ final class CapsuleDetailCoordinator: Coordinator {
let capsuleDetailViewModel = CapsuleDetailViewModel()
capsuleDetailViewModel.coordinator = self
capsuleDetailViewController.viewModel = capsuleDetailViewModel

navigationController?.pushViewController(capsuleDetailViewController, animated: true)


if let rootVC = navigationController?.viewControllers.first {
navigationController?.viewControllers = [rootVC, capsuleDetailViewController]
navigationController?.setViewControllers([rootVC, capsuleDetailViewController], animated: true)
}

setupNavigationItem()
}

func showCapsuleSettings() {
Expand Down Expand Up @@ -72,10 +68,4 @@ final class CapsuleDetailCoordinator: Coordinator {

parent.hideTabBar()
}

private func setupNavigationItem() {
let backButtonItem = UIBarButtonItem()
backButtonItem.title = "목록"
navigationController?.navigationBar.topItem?.backBarButtonItem = backButtonItem
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,7 @@ final class CapsuleOpenView: UIView, BaseView, UnOpenable {
return label
}()

lazy var blurEffectView = {
let blurEffect = UIBlurEffect(style: .dark)
let blurEffectView = UIVisualEffectView(effect: blurEffect)
blurEffectView.layer.cornerRadius = FrameResource.listCapsuleCellWidth / 2
blurEffectView.clipsToBounds = true
blurEffectView.alpha = FrameResource.blurEffectAlpha
return blurEffectView
}()
let blurEffectView = CapsuleBlurEffectView()

lazy var lockImageView = {
let lockImageView = UIImageView()
Expand Down Expand Up @@ -56,6 +49,7 @@ final class CapsuleOpenView: UIView, BaseView, UnOpenable {

override init(frame: CGRect) {
super.init(frame: frame)

configure()
addSubViews()
makeConstraints()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,7 @@ final class CapsuleCloseView: UIView, BaseView {
return view
}()

private let blurEffectView: UIVisualEffectView = {
let blurEffect = UIBlurEffect(style: .dark)
let blurEffectView = UIVisualEffectView(effect: blurEffect)
blurEffectView.layer.cornerRadius = FrameResource.capsuleThumbnailWidth / 2
blurEffectView.clipsToBounds = true
blurEffectView.alpha = FrameResource.blurEffectAlpha
return blurEffectView
}()
private let blurEffectView = CapsuleBlurEffectView()

private let closedImageView: UIImageView = {
let imageView = UIImageView()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,7 @@ final class ListCapsuleCell: UICollectionViewCell, UnOpenable {
return label
}()

lazy var blurEffectView = {
let blurEffect = UIBlurEffect(style: .dark)
let blurEffectView = UIVisualEffectView(effect: blurEffect)
blurEffectView.layer.cornerRadius = FrameResource.listCapsuleCellWidth / 2
blurEffectView.clipsToBounds = true
blurEffectView.alpha = FrameResource.blurEffectAlpha
return blurEffectView
}()
var blurEffectView = CapsuleBlurEffectView()

lazy var lockImageView = {
let lockImageView = UIImageView()
Expand All @@ -42,6 +35,7 @@ final class ListCapsuleCell: UICollectionViewCell, UnOpenable {

override init(frame: CGRect) {
super.init(frame: frame)

addSubviews()
makeConstraints()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import UIKit

protocol UnOpenable: UIView {
var thumbnailImageView: ThemeThumbnailImageView { get }
var blurEffectView: UIVisualEffectView { get }
var blurEffectView: CapsuleBlurEffectView { get }
var lockImageView: UIImageView { get }
var dateLabel: ThemeLabel {get}
func applyUnOpenableEffect()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ final class DetailImageViewController: UIViewController {
viewModel?.output.imageSources
.subscribe(onNext: { [weak self] imageData in
let index = imageData.index
print(index)
self?.applySnapshot(items: imageData.sources)

self?.mainView.itemCount = imageData.sources.count
Expand Down Expand Up @@ -69,12 +68,11 @@ extension DetailImageViewController {
switch item {
case let .data(value):
cell.configure(data: value)

case let .url(value):
cell.configrue(url: value)
}



return cell
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import SnapKit
import UIKit

final class HomeCapsuleCell: UICollectionViewCell, UnOpenable {
final class HomeCapsuleCell: UICollectionViewCell, UnOpenable {
var uuid: String?

var thumbnailImageView = ThemeThumbnailImageView(frame: .zero, width: FrameResource.homeCapsuleCellWidth)
Expand All @@ -33,14 +33,7 @@ final class HomeCapsuleCell: UICollectionViewCell, UnOpenable {
return dateLabel
}()

var blurEffectView = {
let blurEffect = UIBlurEffect(style: .dark)
let blurEffectView = UIVisualEffectView(effect: blurEffect)
blurEffectView.layer.cornerRadius = FrameResource.listCapsuleCellWidth / 2
blurEffectView.clipsToBounds = true
blurEffectView.alpha = FrameResource.blurEffectAlpha
return blurEffectView
}()
var blurEffectView = CapsuleBlurEffectView()

var lockImageView = {
let lockImageView = UIImageView()
Expand All @@ -51,6 +44,7 @@ final class HomeCapsuleCell: UICollectionViewCell, UnOpenable {

override init(frame: CGRect) {
super.init(frame: frame)

addSubviews()
makeConstraints()
}
Expand Down