Skip to content
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
1 change: 1 addition & 0 deletions Runnect-iOS/.swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ disabled_rules:
- type_name
- legacy_constructor
- unused_setter_value
- file_length

included:
- Runnect-iOS
Expand Down
4 changes: 4 additions & 0 deletions Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
CE9291252965C9FB0010959C /* CourseDetailInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE9291242965C9FB0010959C /* CourseDetailInfoView.swift */; };
CE9291272965D0ED0010959C /* StatsInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE9291262965D0ED0010959C /* StatsInfoView.swift */; };
CE9291292965E01D0010959C /* RNTimeFormatter.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE9291282965E01D0010959C /* RNTimeFormatter.swift */; };
CEB0BCBC29D123350048CCD5 /* GuideView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEB0BCBB29D123350048CCD5 /* GuideView.swift */; };
CEB8416E2962C45300BF8080 /* LocationSearchResultTVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEB8416D2962C45300BF8080 /* LocationSearchResultTVC.swift */; };
CEB841702963360800BF8080 /* CountDownVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEB8416F2963360800BF8080 /* CountDownVC.swift */; };
CEC2A6852961F92C00160BF7 /* CustomButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEC2A6842961F92C00160BF7 /* CustomButton.swift */; };
Expand Down Expand Up @@ -271,6 +272,7 @@
CE9291242965C9FB0010959C /* CourseDetailInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CourseDetailInfoView.swift; sourceTree = "<group>"; };
CE9291262965D0ED0010959C /* StatsInfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatsInfoView.swift; sourceTree = "<group>"; };
CE9291282965E01D0010959C /* RNTimeFormatter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNTimeFormatter.swift; sourceTree = "<group>"; };
CEB0BCBB29D123350048CCD5 /* GuideView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GuideView.swift; sourceTree = "<group>"; };
CEB8416D2962C45300BF8080 /* LocationSearchResultTVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationSearchResultTVC.swift; sourceTree = "<group>"; };
CEB8416F2963360800BF8080 /* CountDownVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CountDownVC.swift; sourceTree = "<group>"; };
CEC2A6842961F92C00160BF7 /* CustomButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomButton.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -997,6 +999,7 @@
CE9291242965C9FB0010959C /* CourseDetailInfoView.swift */,
CE9291262965D0ED0010959C /* StatsInfoView.swift */,
CE6B63D729673450003F900F /* ListEmptyView.swift */,
CEB0BCBB29D123350048CCD5 /* GuideView.swift */,
);
path = UIComponents;
sourceTree = "<group>";
Expand Down Expand Up @@ -1350,6 +1353,7 @@
CECA695C296E61D6002AF05C /* PrivateCourseNotUploadedResponseDto.swift in Sources */,
CE6655EC295D88D000C64E12 /* UITableView+.swift in Sources */,
CEEC6B3A2961C4F300D00E1E /* CourseDrawingHomeVC.swift in Sources */,
CEB0BCBC29D123350048CCD5 /* GuideView.swift in Sources */,
CEC2A6902962B06C00160BF7 /* convertLocationObject.swift in Sources */,
CEC2A6852961F92C00160BF7 /* CustomButton.swift in Sources */,
CE6B63D3296725E6003F900F /* CourseListCVC.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1410"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CE4545C4295D7AF4003201E1"
BuildableName = "Runnect-iOS.app"
BlueprintName = "Runnect-iOS"
ReferencedContainer = "container:Runnect-iOS.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CE4545C4295D7AF4003201E1"
BuildableName = "Runnect-iOS.app"
BlueprintName = "Runnect-iOS"
ReferencedContainer = "container:Runnect-iOS.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "CE4545C4295D7AF4003201E1"
BuildableName = "Runnect-iOS.app"
BlueprintName = "Runnect-iOS"
ReferencedContainer = "container:Runnect-iOS.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
31 changes: 31 additions & 0 deletions Runnect-iOS/Runnect-iOS/Global/Extension/UIKit+/UIImage+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,35 @@ extension UIImage {
UIGraphicsEndImageContext()
self.init(cgImage: (image?.cgImage)!)
}

static func imageFromView(view: UIView) -> UIImage? {
UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.isOpaque, 0.0)
view.drawHierarchy(in: view.bounds, afterScreenUpdates: true)
defer { UIGraphicsEndImageContext() }
guard let context = UIGraphicsGetCurrentContext() else { return nil }
view.layer.render(in: context)
let image = UIGraphicsGetImageFromCurrentImageContext()
return image
}

static func cropImage(_ inputImage: UIImage, toRect cropRect: CGRect, viewWidth: CGFloat, viewHeight: CGFloat) -> UIImage? {
let imageViewScale = max(inputImage.size.width / viewWidth,
inputImage.size.height / viewHeight)

// Scale cropRect to handle images larger than shown-on-screen size
let cropZone = CGRect(x: cropRect.origin.x * imageViewScale,
y: cropRect.origin.y * imageViewScale,
width: cropRect.size.width * imageViewScale,
height: cropRect.size.height * imageViewScale)

// Perform cropping in Core Graphics
guard let cutImageRef: CGImage = inputImage.cgImage?.cropping(to: cropZone)
else {
return nil
}

// Return image to UIImage
let croppedImage: UIImage = UIImage(cgImage: cutImageRef)
return croppedImage
}
}
1 change: 1 addition & 0 deletions Runnect-iOS/Runnect-iOS/Global/Literal/ImageLiterals.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ enum ImageLiterals {
static var icLocationPoint: UIImage { .load(named: "ic_location_point") }
static var icAlert: UIImage { .load(named: "ic_alert") }
static var icLocationOverlay: UIImage { .load(named: "ic_location_overlay") }
static var icLogoCircle: UIImage { .load(named: "ic_logo_circle") }

// img
static var imgBackground: UIImage { .load(named: "img_background") }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"images" : [
{
"filename" : "runnect logo-01 1 1.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "runnect logo-01 1 1@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "runnect logo-01 1 1@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "original"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 86 additions & 0 deletions Runnect-iOS/Runnect-iOS/Global/UIComponents/GuideView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
//
// GuideView.swift
// Runnect-iOS
//
// Created by sejin on 2023/03/27.
//

import UIKit

final class GuideView: UIView {

// MARK: - UI Components

private let logoImageView = UIImageView().then {
$0.image = ImageLiterals.imgAppIcon
$0.backgroundColor = .gray
$0.contentMode = .scaleAspectFit
$0.layer.cornerRadius = 22
$0.clipsToBounds = true
}

private let titleContainerView = UIView().then {
$0.backgroundColor = .clear
}

private let titleLabel = UILabel().then {
$0.textColor = .black
$0.font = .b6
$0.numberOfLines = 1
$0.adjustsFontSizeToFitWidth = true
$0.minimumScaleFactor = 0.7
$0.textAlignment = .center
}

// MARK: - initialization

init(title: String) {
super.init(frame: .zero)
setUI()
setLayout()
setTitle(title: title)
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

}

// MARK: - Methods

extension GuideView {
private func setUI() {
self.backgroundColor = .white
self.layer.cornerRadius = 22
self.clipsToBounds = true
self.layer.applyShadow(color: .black, alpha: 0.12, x: 0, y: 2, blur: 11, spread: 0)
}

private func setLayout() {
self.addSubviews(logoImageView, titleContainerView)
titleContainerView.addSubviews(titleLabel)

self.snp.makeConstraints { make in
make.width.greaterThanOrEqualTo(200)
}

logoImageView.snp.makeConstraints { make in
make.leading.top.bottom.equalToSuperview()
make.width.height.equalTo(44)
}

titleContainerView.snp.makeConstraints { make in
make.leading.equalTo(logoImageView.snp.centerX)
make.top.bottom.trailing.equalToSuperview()
}

titleLabel.snp.makeConstraints { make in
make.center.equalToSuperview()
}
}

func setTitle(title: String) {
self.titleLabel.text = title
}
}
Loading