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

Feature/addarticle selectsentence #11

Merged
merged 13 commits into from
Aug 30, 2023
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
35 changes: 22 additions & 13 deletions Particle/Particle.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 55;
objectVersion = 56;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -38,6 +38,7 @@
3520EF442A74DDA700A53B34 /* YdestreetB.otf in Resources */ = {isa = PBXBuildFile; fileRef = 3520EF422A74DDA700A53B34 /* YdestreetB.otf */; };
3520EF452A74DDA700A53B34 /* YdestreetL.otf in Resources */ = {isa = PBXBuildFile; fileRef = 3520EF432A74DDA700A53B34 /* YdestreetL.otf */; };
3520EF472A74DFBD00A53B34 /* UIFont+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3520EF462A74DFBD00A53B34 /* UIFont+.swift */; };
AF0D09DB2A823001003EE03D /* UIView+.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF0D09DA2A823001003EE03D /* UIView+.swift */; };
AF0D71C52A5BE6A200157758 /* AppComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF0D71C42A5BE6A200157758 /* AppComponent.swift */; };
AF0D71CB2A5BE9B600157758 /* RootRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF0D71C72A5BE9B600157758 /* RootRouter.swift */; };
AF0D71CC2A5BE9B600157758 /* RootViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF0D71C82A5BE9B600157758 /* RootViewController.swift */; };
Expand Down Expand Up @@ -65,6 +66,7 @@
AF1D32B02A680CC700980F14 /* PhotoPickerInteractor.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF1D32AC2A680CC700980F14 /* PhotoPickerInteractor.swift */; };
AF4A19112A6A1E4B00932372 /* PhotoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF4A19102A6A1E4B00932372 /* PhotoCell.swift */; };
AF4A19132A6A59BB00932372 /* UIImageView+.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF4A19122A6A59BA00932372 /* UIImageView+.swift */; };
AF6059F92A75FEA600FE1565 /* SelectedPhotoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = AF6059F82A75FEA600FE1565 /* SelectedPhotoCell.swift */; };
AFB4BDC52A4093DC008BA9E0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFB4BDC42A4093DC008BA9E0 /* AppDelegate.swift */; };
AFB4BDC72A4093DC008BA9E0 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFB4BDC62A4093DC008BA9E0 /* SceneDelegate.swift */; };
AFB4BDCE2A4093DD008BA9E0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = AFB4BDCD2A4093DD008BA9E0 /* Assets.xcassets */; };
Expand Down Expand Up @@ -137,6 +139,7 @@
3520EF422A74DDA700A53B34 /* YdestreetB.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = YdestreetB.otf; sourceTree = "<group>"; };
3520EF432A74DDA700A53B34 /* YdestreetL.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = YdestreetL.otf; sourceTree = "<group>"; };
3520EF462A74DFBD00A53B34 /* UIFont+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIFont+.swift"; sourceTree = "<group>"; };
AF0D09DA2A823001003EE03D /* UIView+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+.swift"; sourceTree = "<group>"; };
AF0D71C42A5BE6A200157758 /* AppComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppComponent.swift; sourceTree = "<group>"; };
AF0D71C72A5BE9B600157758 /* RootRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootRouter.swift; sourceTree = "<group>"; };
AF0D71C82A5BE9B600157758 /* RootViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -164,6 +167,7 @@
AF1D32AC2A680CC700980F14 /* PhotoPickerInteractor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhotoPickerInteractor.swift; sourceTree = "<group>"; };
AF4A19102A6A1E4B00932372 /* PhotoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhotoCell.swift; sourceTree = "<group>"; };
AF4A19122A6A59BA00932372 /* UIImageView+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIImageView+.swift"; sourceTree = "<group>"; };
AF6059F82A75FEA600FE1565 /* SelectedPhotoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectedPhotoCell.swift; sourceTree = "<group>"; };
AFB4BDC12A4093DC008BA9E0 /* Particle.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Particle.app; sourceTree = BUILT_PRODUCTS_DIR; };
AFB4BDC42A4093DC008BA9E0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
AFB4BDC62A4093DC008BA9E0 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -278,13 +282,6 @@
path = Utils;
sourceTree = "<group>";
};
3520EF242A5FB7E400A53B34 /* AddArticleNavigation */ = {
isa = PBXGroup;
children = (
);
path = AddArticleNavigation;
sourceTree = "<group>";
};
3520EF272A74DADE00A53B34 /* Fonts */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -423,6 +420,14 @@
path = View;
sourceTree = "<group>";
};
AF6059F72A75FE9100FE1565 /* View */ = {
isa = PBXGroup;
children = (
AF6059F82A75FEA600FE1565 /* SelectedPhotoCell.swift */,
);
path = View;
sourceTree = "<group>";
};
AF86D82C2A4E6030009F1E9D /* Entry */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -526,6 +531,7 @@
AFBB5F6E2A66B60D002416DA /* SelectSentence */ = {
isa = PBXGroup;
children = (
AF6059F72A75FE9100FE1565 /* View */,
AFBB5F702A66B65D002416DA /* SelectSentenceRouter.swift */,
AFBB5F712A66B65D002416DA /* SelectSentenceViewController.swift */,
AFBB5F722A66B65D002416DA /* SelectSentenceBuilder.swift */,
Expand Down Expand Up @@ -555,6 +561,7 @@
3520EF462A74DFBD00A53B34 /* UIFont+.swift */,
AFBB5F6C2A66B5C1002416DA /* UIViewController+.swift */,
AF4A19122A6A59BA00932372 /* UIImageView+.swift */,
AF0D09DA2A823001003EE03D /* UIView+.swift */,
);
path = Extension;
sourceTree = "<group>";
Expand Down Expand Up @@ -597,7 +604,7 @@
};
};
buildConfigurationList = AFB4BDBC2A4093DC008BA9E0 /* Build configuration list for PBXProject "Particle" */;
compatibilityVersion = "Xcode 13.0";
compatibilityVersion = "Xcode 14.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
Expand Down Expand Up @@ -714,6 +721,7 @@
AFBB5F772A66B65D002416DA /* SelectSentenceInteractor.swift in Sources */,
3520EF192A5E91A900A53B34 /* SetAdditionalInformationInteractor.swift in Sources */,
AF1945172A5C407500B9FFA1 /* Constant.swift in Sources */,
AF6059F92A75FEA600FE1565 /* SelectedPhotoCell.swift in Sources */,
AF4A19112A6A1E4B00932372 /* PhotoCell.swift in Sources */,
AF0D71DA2A5BEEAD00157758 /* RootComponent+LoggedOut.swift in Sources */,
AFBB5F752A66B65D002416DA /* SelectSentenceViewController.swift in Sources */,
Expand Down Expand Up @@ -743,6 +751,7 @@
3520EF082A5E8F3400A53B34 /* UIImage+ParticleImage.swift in Sources */,
AFBD9BC52A715FBC0076A404 /* UIColor+ParticleColor.swift in Sources */,
AFB4BDC52A4093DC008BA9E0 /* AppDelegate.swift in Sources */,
AF0D09DB2A823001003EE03D /* UIView+.swift in Sources */,
3520EF042A5E6F9C00A53B34 /* OrganizingSentenceRepository.swift in Sources */,
AF0D71CE2A5BE9B600157758 /* RootInteractor.swift in Sources */,
3520EEF52A5CD3C000A53B34 /* OrganizingSentenceInteractor.swift in Sources */,
Expand Down Expand Up @@ -831,7 +840,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -885,7 +894,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand All @@ -911,7 +920,7 @@
INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -941,7 +950,7 @@
INFOPLIST_KEY_UIStatusBarStyle = UIStatusBarStyleLightContent;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
IPHONEOS_DEPLOYMENT_TARGET = 16.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
2 changes: 2 additions & 0 deletions Particle/Particle/Entry/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
return
}
}

UserDefaults.standard.set(false, forKey: "ShowSwipeGuide")

return true
}
Expand Down
11 changes: 6 additions & 5 deletions Particle/Particle/Extension/UIImageView+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Photos

extension UIImageView {

func fetchImage(asset: PHAsset, contentMode: PHImageContentMode, targetSize: CGSize) {
func fetchImage(asset: PHAsset, contentMode: PHImageContentMode, targetSize: CGSize, _ completion: ((CGFloat) -> Void)? = nil) {
let options = PHImageRequestOptions()
options.version = .original
options.deliveryMode = .opportunistic
Expand All @@ -21,11 +21,12 @@ extension UIImageView {
targetSize: targetSize,
contentMode: contentMode,
options: options) { image, info in
if image == nil {
Console.error(#function)
print(info ?? #function)
} else {

if let image = image {
self.image = image
completion?(image.size.height / image.size.width)
} else {
Console.error("\(#function) image 가 존재하지 않습니다.")
}
}
}
Expand Down
23 changes: 23 additions & 0 deletions Particle/Particle/Extension/UIView+.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// UIView+.swift
// Particle
//
// Created by 이원빈 on 2023/08/08.
//

import UIKit

extension UIView {

func addRoundedCorner(corners: UIRectCorner, radius: CGFloat) {
let maskPath = UIBezierPath(
roundedRect: bounds,
byRoundingCorners: corners,
cornerRadii: CGSize(width: radius, height: radius)
)

let maskLayer = CAShapeLayer()
maskLayer.path = maskPath.cgPath
layer.mask = maskLayer
}
}
14 changes: 4 additions & 10 deletions Particle/Particle/LoggedIn/LoggedInBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@
import RIBs

protocol LoggedInDependency: Dependency {
// TODO: Make sure to convert the variable into lower-camelcase.
var LoggedInViewController: LoggedInViewControllable { get }
var organizingSentenceRepository: OrganizingSentenceRepository { get }
var loggedInViewController: LoggedInViewControllable { get }
}

final class LoggedInComponent: Component<LoggedInDependency>, MainDependency {

// TODO: Make sure to convert the variable into lower-camelcase.
fileprivate var LoggedInViewController: LoggedInViewControllable {
return dependency.LoggedInViewController
}
var organizingSentenceRepository: OrganizingSentenceRepository {
return dependency.organizingSentenceRepository
fileprivate var loggedInViewController: LoggedInViewControllable {
return dependency.loggedInViewController
}
}

Expand All @@ -43,7 +37,7 @@ final class LoggedInBuilder: Builder<LoggedInDependency>, LoggedInBuildable {
let mainBuilder = MainBuilder(dependency: component)
return LoggedInRouter(
interactor: interactor,
viewController: component.LoggedInViewController,
viewController: component.loggedInViewController,
mainBuilder: mainBuilder
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ public protocol OrganizingSentenceRepository {
}

public final class OrganizingSentenceRepositoryImp: OrganizingSentenceRepository {
public var sentenceFile: RxSwift.BehaviorSubject<[String]> {
sentenceSubject
}

public var sentenceFile: BehaviorSubject<[String]> = .init(value: [])

private let sentenceSubject = BehaviorSubject<[String]>(value: [
"그렇게 쓴 글은 매일 사회관계망서비스(SNS)에 남기기도 하고, 모아서 책으로 내기도 한다.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,15 @@
import RIBs

protocol AddArticleDependency: Dependency {
// TODO: Make sure to convert the variable into lower-camelcase.
var addArticleViewController: ViewControllable { get }
// TODO: Declare the set of dependencies required by this RIB, but won't be
// created by this RIB.
}

final class AddArticleComponent: Component<AddArticleDependency> {

// TODO: Make sure to convert the variable into lower-camelcase.
var repository = OrganizingSentenceRepositoryImp()

fileprivate var addArticleViewController: ViewControllable {
return dependency.addArticleViewController
}

// TODO: Declare 'fileprivate' dependencies that are only used by this RIB.
}

// MARK: - Builder
Expand All @@ -31,13 +26,15 @@ protocol AddArticleBuildable: Buildable {
}

final class AddArticleBuilder: Builder<AddArticleDependency>, AddArticleBuildable {


override init(dependency: AddArticleDependency) {
super.init(dependency: dependency)
}

func build(withListener listener: AddArticleListener) -> AddArticleRouting {
let component = AddArticleComponent(dependency: dependency)

let interactor = AddArticleInteractor()
interactor.listener = listener

Expand All @@ -63,6 +60,6 @@ extension AddArticleComponent: PhotoPickerDependency,
SetAdditionalInformationDependency {

var organizingSentenceRepository: OrganizingSentenceRepository {
return OrganizingSentenceRepositoryImp() //FIXME: ??
return repository
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,14 @@ protocol AddArticleRouting: Routing {
func detachSetAdditionalInformation()
}

protocol AddArticleListener: AnyObject {
// TODO: Declare methods the interactor can invoke to communicate with other RIBs.
}
protocol AddArticleListener: AnyObject { }

final class AddArticleInteractor: Interactor, AddArticleInteractable {

weak var router: AddArticleRouting?
weak var listener: AddArticleListener?

// TODO: Add additional dependencies to constructor. Do not perform any logic
// in constructor.
override init() {
}
override init() { }

override func didBecomeActive() {
super.didBecomeActive()
Expand All @@ -48,7 +43,6 @@ final class AddArticleInteractor: Interactor, AddArticleInteractable {
super.willResignActive()

router?.cleanupViews()
// TODO: Pause any business logic.
}

// MARK: - PhotoPickerListener
Expand All @@ -71,7 +65,6 @@ final class AddArticleInteractor: Interactor, AddArticleInteractable {
router?.attachOrganizingSentence()
}


// MARK: - OrganizingSentenceListener

func organizingSentenceNextButtonTapped() {
Expand Down
Loading