Skip to content

Commit

Permalink
Merge branch 'feat/Settings' into Develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeonhui authored Nov 10, 2023
2 parents acb5e7d + bc4d598 commit 87a4ab1
Show file tree
Hide file tree
Showing 11 changed files with 175 additions and 91 deletions.
6 changes: 6 additions & 0 deletions Briefing.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@
A595F0352ABDAC09006543B2 /* url.plist in Resources */ = {isa = PBXBuildFile; fileRef = A595F0342ABDAC09006543B2 /* url.plist */; };
A595F0372ABDAC2D006543B2 /* url-debug.plist in Resources */ = {isa = PBXBuildFile; fileRef = A595F0362ABDAC2D006543B2 /* url-debug.plist */; };
A5AC45F92AF93B3F00E7C161 /* Briefing_Widget_Sub.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5AC45F82AF93B3F00E7C161 /* Briefing_Widget_Sub.swift */; };
A5AC45FB2AF949DE00E7C161 /* SettingTableViewSectionHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5AC45FA2AF949DE00E7C161 /* SettingTableViewSectionHeaderView.swift */; };
A5B3A7A62AB89D4700E1E2B6 /* TabBarItemViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5B3A7A52AB89D4700E1E2B6 /* TabBarItemViewController.swift */; };
A5C5E7852ACE357E0053E434 /* SettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5C5E7842ACE357E0053E434 /* SettingViewController.swift */; };
A5CA5EAF2AD17CE9003FBD99 /* SettingTableViewAuthCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5CA5EAE2AD17CE9003FBD99 /* SettingTableViewAuthCell.swift */; };
A5CA5EB12AD17CF6003FBD99 /* SettingTableViewDefaultCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5CA5EB02AD17CF6003FBD99 /* SettingTableViewDefaultCell.swift */; };
Expand Down Expand Up @@ -198,6 +200,8 @@
A595F0342ABDAC09006543B2 /* url.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = url.plist; sourceTree = "<group>"; };
A595F0362ABDAC2D006543B2 /* url-debug.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "url-debug.plist"; sourceTree = "<group>"; };
A5AC45F82AF93B3F00E7C161 /* Briefing_Widget_Sub.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Briefing_Widget_Sub.swift; sourceTree = "<group>"; };
A5AC45FA2AF949DE00E7C161 /* SettingTableViewSectionHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingTableViewSectionHeaderView.swift; sourceTree = "<group>"; };
A5B3A7A52AB89D4700E1E2B6 /* TabBarItemViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabBarItemViewController.swift; sourceTree = "<group>"; };
A5C5E7842ACE357E0053E434 /* SettingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingViewController.swift; sourceTree = "<group>"; };
A5CA5EAE2AD17CE9003FBD99 /* SettingTableViewAuthCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingTableViewAuthCell.swift; sourceTree = "<group>"; };
A5CA5EB02AD17CF6003FBD99 /* SettingTableViewDefaultCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingTableViewDefaultCell.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -517,6 +521,7 @@
A5CA5EB02AD17CF6003FBD99 /* SettingTableViewDefaultCell.swift */,
A5CA5EAE2AD17CE9003FBD99 /* SettingTableViewAuthCell.swift */,
A58F5DF02AD5168E006B4E85 /* SettingTimePickerViewController.swift */,
A5AC45FA2AF949DE00E7C161 /* SettingTableViewSectionHeaderView.swift */,
);
path = SettingScenes;
sourceTree = "<group>";
Expand Down Expand Up @@ -826,6 +831,7 @@
A5C5E7852ACE357E0053E434 /* SettingViewController.swift in Sources */,
EE5560BF2AD65C2C0024ABBA /* BriefingNotificationManager.swift in Sources */,
EE7ED40B2AB6E75400FC49C9 /* SignInViewController.swift in Sources */,
A5AC45FB2AF949DE00E7C161 /* SettingTableViewSectionHeaderView.swift in Sources */,
A5DA2F1A2ACBF32F00EFACB5 /* BriefingNetworkResult.swift in Sources */,
A5DA2F242ACC423C00EFACB5 /* HomeBriefingTableViewCell.swift in Sources */,
2443C5562A8FE88B009586C7 /* SceneDelegate.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "details_black.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"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.
6 changes: 5 additions & 1 deletion Briefing/Resources/en.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@

"settings" = "settings";

"notification" = "Notification";
"appInfo" = "App Information";
"support" = "Support";
"account" = "Account";

"notificationTimeSetting" = "Set notification time";
"setNotification" = "set";
"removeNotification" = "remove";
Expand Down Expand Up @@ -56,7 +61,6 @@
"privacyPolicyLink" = "https://sites.google.com/view/briefing-private/%ED%99%88";
"cautionLink" = "https://onve.notion.site/Briefing-e1cb17e2e7c54d3b9a7036b29ee9b11a?pvs=4";


"widget_displayName" = "Today's Briefings";
"widget_description" = "You can check out today's briefings!";
"widget_waitingData" = "The briefings haven't arrived yet.";
5 changes: 5 additions & 0 deletions Briefing/Resources/ko.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@

"settings" = "설정";

"notification" = "알림";
"appInfo" = "앱 정보";
"support" = "지원";
"account" = "로그인 / 로그아웃";

"notificationTimeSetting" = "알림 시간 설정";
"setNotification" = "알림 설정";
"removeNotification" = "알림 삭제";
Expand Down
15 changes: 7 additions & 8 deletions Briefing/Scenes/SettingScenes/SettingTableViewAuthCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ class SettingTableViewAuthCell: UITableViewCell {
}

func configure() {
self.preservesSuperviewLayoutMargins = false
self.separatorInset = UIEdgeInsets(top: 0, left: 24, bottom: 0, right: 24)
self.layoutMargins = UIEdgeInsets.zero
// self.preservesSuperviewLayoutMargins = false
// self.separatorInset = UIEdgeInsets(top: 0, left: 24, bottom: 0, right: 24)
// self.layoutMargins = UIEdgeInsets.zero
}

func addSubviews() {
Expand All @@ -53,22 +53,21 @@ class SettingTableViewAuthCell: UITableViewCell {
func makeConstraints() {
mainContainerView.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.leading.trailing.equalToSuperview().inset(24)
make.leading.trailing.equalToSuperview()
// make.leading.trailing.equalToSuperview().inset(24)
}

titleLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.leading.equalTo(mainContainerView.snp.leading).inset(18)
make.leading.equalTo(mainContainerView.snp.leading).inset(30)
make.trailing.equalTo(mainContainerView.snp.trailing).inset(18)
}
}

func setCellData(title: String,
color: UIColor,
cornerMaskEdge: UIRectEdge?) {
color: UIColor) {
titleLabel.text = title
titleLabel.textColor = color
mainContainerView.setCornerMask(cornerMaskEdge)
}

override func setHighlighted(_ highlighted: Bool, animated: Bool) {
Expand Down
40 changes: 12 additions & 28 deletions Briefing/Scenes/SettingScenes/SettingTableViewDefaultCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,10 @@ class SettingTableViewDefaultCell: UITableViewCell {
return view
}()

private var symbolImageView: UIImageView = {
let imageView = UIImageView()
imageView.tintColor = .briefingNavy
imageView.contentMode = .scaleAspectFit
return imageView
}()

private var titleLabel: UILabel = {
let label = UILabel()
label.font = .productSans(size: 18)
label.textColor = .briefingNavy
label.textColor = .black
return label
}()

Expand All @@ -42,7 +35,7 @@ class SettingTableViewDefaultCell: UITableViewCell {
private var nextIconImageView: UIImageView = {
let imageView = UIImageView()
imageView.image = BriefingImageCollection.nextIconImage
imageView.tintColor = .briefingNavy
imageView.tintColor = .black
imageView.contentMode = .scaleAspectFit
return imageView
}()
Expand All @@ -59,15 +52,15 @@ class SettingTableViewDefaultCell: UITableViewCell {
}

func configure() {
self.preservesSuperviewLayoutMargins = false
self.separatorInset = UIEdgeInsets(top: 0, left: 24, bottom: 0, right: 24)
self.layoutMargins = UIEdgeInsets.zero
// self.preservesSuperviewLayoutMargins = false
// self.separatorInset = UIEdgeInsets(top: 0, left: 24, bottom: 0, right: 24)
// self.layoutMargins = UIEdgeInsets.zero
}

func addSubviews() {
self.contentView.addSubview(mainContainerView)

let subViews: [UIView] = [symbolImageView, titleLabel]
let subViews: [UIView] = [titleLabel]
subViews.forEach { subView in
mainContainerView.addSubview(subView)
}
Expand All @@ -76,34 +69,25 @@ class SettingTableViewDefaultCell: UITableViewCell {
func makeConstraints() {
mainContainerView.snp.makeConstraints { make in
make.top.bottom.equalToSuperview()
make.leading.trailing.equalToSuperview().inset(24)
make.leading.trailing.equalToSuperview()
// make.leading.trailing.equalToSuperview().inset(24)
}

symbolImageView.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.leading.equalToSuperview().offset(18)
make.width.height.equalTo(20)
}


titleLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.leading.equalTo(symbolImageView.snp.trailing).offset(12)
make.leading.equalTo(mainContainerView.snp.leading).offset(30)
}
}

func setCellData(symbol: UIImage,
title: String,
type: SettingTableViewDefaultCellType,
cornerMaskEdge: UIRectEdge?) {
symbolImageView.image = symbol
func setCellData(title: String,
type: SettingTableViewDefaultCellType) {
titleLabel.text = title
switch type {
case let .text(text):
valueLabel.text = text
default: break
}
cellLayoutSetting(type: type)
mainContainerView.setCornerMask(cornerMaskEdge)
}

func cellLayoutSetting(type: SettingTableViewDefaultCellType){
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//
// SettingTableViewHeaderView.swift
// Briefing
//
// Created by 이전희 on 11/7/23.
//

import UIKit

final class SettingTableViewSectionHeaderView: UIView {
var title: String

private var mainView: UIView = {
let view = UIView()
view.backgroundColor = .clear
return view
}()

var titleLabel: UILabel = {
let label = UILabel()
label.font = .productSans(size: 18)
label.textColor = .black
return label
}()

init(title: String) {
self.title = title
super.init(frame: .zero)
configure()
addSubviews()
makeConstraints()
}

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

private func configure() {
self.titleLabel.text = title
}

private func addSubviews() {
addSubviews(mainView)
mainView.addSubviews(titleLabel)
}

private func makeConstraints() {
mainView.snp.makeConstraints{ make in
make.edges.equalToSuperview()
}

titleLabel.snp.makeConstraints { make in
make.leading.trailing.equalToSuperview().inset(30)
make.bottom.equalToSuperview().inset(6)
}
}

}
Loading

0 comments on commit 87a4ab1

Please sign in to comment.