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
8 changes: 8 additions & 0 deletions DailyQuest/DailyQuest.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
3449AD5D2922197000B87619 /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3449AD5C2922197000B87619 /* User.swift */; };
3449AD6029222B3900B87619 /* UserInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3449AD5F29222B3900B87619 /* UserInfoCell.swift */; };
34642AB62925D9E40052FA0E /* UserInfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34642AB52925D9E40052FA0E /* UserInfoView.swift */; };
347D258B292C60F40038FCA2 /* StatusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 347D258A292C60F40038FCA2 /* StatusView.swift */; };
347D258D292C6E220038FCA2 /* MessageBubble.swift in Sources */ = {isa = PBXBuildFile; fileRef = 347D258C292C6E220038FCA2 /* MessageBubble.swift */; };
34874AA0292509A4000570DF /* QuestViewHeader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34874A9F292509A4000570DF /* QuestViewHeader.swift */; };
34874AA229250C43000570DF /* UIButton+.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34874AA129250C43000570DF /* UIButton+.swift */; };
34874AA629252088000570DF /* AddQuestsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34874AA529252088000570DF /* AddQuestsViewController.swift */; };
Expand Down Expand Up @@ -105,6 +107,8 @@
3449AD5C2922197000B87619 /* User.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = User.swift; sourceTree = "<group>"; };
3449AD5F29222B3900B87619 /* UserInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserInfoCell.swift; sourceTree = "<group>"; };
34642AB52925D9E40052FA0E /* UserInfoView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserInfoView.swift; sourceTree = "<group>"; };
347D258A292C60F40038FCA2 /* StatusView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusView.swift; sourceTree = "<group>"; };
347D258C292C6E220038FCA2 /* MessageBubble.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageBubble.swift; sourceTree = "<group>"; };
34874A9F292509A4000570DF /* QuestViewHeader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuestViewHeader.swift; sourceTree = "<group>"; };
34874AA129250C43000570DF /* UIButton+.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIButton+.swift"; sourceTree = "<group>"; };
34874AA529252088000570DF /* AddQuestsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddQuestsViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -524,6 +528,8 @@
children = (
34EE6EB62924C674005AF583 /* QuestView.swift */,
34874A9F292509A4000570DF /* QuestViewHeader.swift */,
347D258A292C60F40038FCA2 /* StatusView.swift */,
347D258C292C6E220038FCA2 /* MessageBubble.swift */,
);
path = View;
sourceTree = "<group>";
Expand Down Expand Up @@ -808,6 +814,7 @@
34874AA229250C43000570DF /* UIButton+.swift in Sources */,
34A529E7292481E1001BAD34 /* BrowseCoordinator.swift in Sources */,
34A529D329247903001BAD34 /* TabCoordinator.swift in Sources */,
347D258D292C6E220038FCA2 /* MessageBubble.swift in Sources */,
34EE6EB92924CAA1005AF583 /* QuestViewModel.swift in Sources */,
34CAE318292B19A3007653AD /* QuestsRepository.swift in Sources */,
3449AD5D2922197000B87619 /* User.swift in Sources */,
Expand All @@ -822,6 +829,7 @@
34A529D529247932001BAD34 /* AppCoordinator.swift in Sources */,
B50078D629222F3F0070AFC4 /* CircleCheckView.swift in Sources */,
3499552729235D1E007AB99E /* BrowseItemViewModel.swift in Sources */,
347D258B292C60F40038FCA2 /* StatusView.swift in Sources */,
34874AA629252088000570DF /* AddQuestsViewController.swift in Sources */,
34642AB62925D9E40052FA0E /* UserInfoView.swift in Sources */,
349955292923600A007AB99E /* BrowseViewController.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Max 7.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions DailyQuest/DailyQuest/Presentation/Home/View/MessageBubble.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
//
// MessageBubble.swift
// DailyQuest
//
// Created by jinwoong Kim on 2022/11/22.
//

import UIKit

final class MessageBubbleLabel: UILabel {
private var topInset: CGFloat = 10.0
private var bottomInset: CGFloat = 10.0
private var leftInset: CGFloat = 15.0
private var rightInset: CGFloat = 10.0

override init(frame: CGRect) {
super.init(frame: frame)
text = "hello world!"
}

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

override func drawText(in rect: CGRect) {
let insets = UIEdgeInsets(top: topInset, left: leftInset, bottom: bottomInset, right: rightInset)

let bezierPath = UIBezierPath()
let width = rect.width
let height = rect.height

bezierPath.move(to: CGPoint(x: 4, y: 25))
bezierPath.addLine(to: CGPoint(x: 4, y: 20))
bezierPath.addCurve(to: CGPoint(x: 20, y: 0),
controlPoint1: CGPoint(x: 4, y: 8),
controlPoint2: CGPoint(x: 12, y: 0))

bezierPath.addLine(to: CGPoint(x: width - 20, y: 0))
bezierPath.addCurve(to: CGPoint(x: width, y: 20),
controlPoint1: CGPoint(x: width - 8, y: 0),
controlPoint2: CGPoint(x: width, y: 8))

bezierPath.addLine(to: CGPoint(x: width, y: height - 20))
bezierPath.addCurve(to: CGPoint(x: width - 20, y: height),
controlPoint1: CGPoint(x: width, y: height - 8),
controlPoint2: CGPoint(x: width - 8, y: height))

bezierPath.addLine(to: CGPoint(x: 20, y: height))
bezierPath.addCurve(to: CGPoint(x: 4, y: height - 4),
controlPoint1: CGPoint(x: 7, y: height),
controlPoint2: CGPoint(x: 5, y: height - 3))
bezierPath.addCurve(to: CGPoint(x: 0, y: height),
controlPoint1: CGPoint(x: 8, y: height - 3),
controlPoint2: CGPoint(x: 4, y: height - 2))


UIColor.maxYellow.setFill()
bezierPath.fill()
bezierPath.close()

super.drawText(in: rect.inset(by: insets))
}

override var intrinsicContentSize: CGSize {
let size = super.intrinsicContentSize
return CGSize(width: size.width + leftInset + rightInset,
height: size.height + topInset + bottomInset)
}
}

#if canImport(SwiftUI) && DEBUG
import SwiftUI

struct MessageBubblePreview: PreviewProvider{
static var previews: some View {
UIViewPreview {
let bubble = MessageBubbleLabel(frame: .zero)

return bubble
}
.previewLayout(.fixed(width: 350, height: 80))
}
}
#endif
25 changes: 25 additions & 0 deletions DailyQuest/DailyQuest/Presentation/Home/View/StatusView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// StatusView.swift
// DailyQuest
//
// Created by jinwoong Kim on 2022/11/22.
//

import UIKit

final class StatusView: UIView {

private lazy var iconContainer: UIImageView = {
let iconContainer = UIImageView()

return iconContainer
}()

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

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