Skip to content

Commit

Permalink
Merge pull request #1 from ypjun100/develop
Browse files Browse the repository at this point in the history
Develop branch to main pull request
  • Loading branch information
ypjun100 authored Jun 22, 2023
2 parents 7d1c953 + a4243f4 commit ceccf9c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 19 deletions.
8 changes: 4 additions & 4 deletions NoticeBoard.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@
CODE_SIGN_ENTITLEMENTS = "NoticeBoard/Supporting Files/NoticeBoard.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 5;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = J2V5PFX4TX;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -454,7 +454,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.0.3;
MARKETING_VERSION = 1.0.4;
PRODUCT_BUNDLE_IDENTIFIER = com.junyoung.NoticeBoard;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -470,7 +470,7 @@
CODE_SIGN_ENTITLEMENTS = "NoticeBoard/Supporting Files/NoticeBoard.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 4;
CURRENT_PROJECT_VERSION = 5;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = J2V5PFX4TX;
ENABLE_HARDENED_RUNTIME = YES;
Expand All @@ -484,7 +484,7 @@
"$(inherited)",
"@executable_path/../Frameworks",
);
MARKETING_VERSION = 1.0.3;
MARKETING_VERSION = 1.0.4;
PRODUCT_BUNDLE_IDENTIFIER = com.junyoung.NoticeBoard;
PRODUCT_NAME = NoticeBoard;
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down
4 changes: 4 additions & 0 deletions NoticeBoard/Controllers/Main/Main+NSTableView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ extension MainController: NSTableViewDataSource, NSTableViewDelegate {
cell.noticeTitle.stringValue = notice.title
cell.noticeTitle.textColor = .textColor

// tooltip
cell.noticeType.toolTip = "작성날짜 : " + notice.date
cell.noticeTitle.toolTip = "작성날짜 : " + notice.date

// 만약 방문한 게시글 매니저에서 현재 게시판 ID가 포함되어 있는지 확인
if(visitedNoticeManagers[currentBoardSelectionIndex].contains(noticeId: notice.id)) {
cell.noticeType.textColor = .gray
Expand Down
1 change: 1 addition & 0 deletions NoticeBoard/Models/Notice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ struct Notice: Codable {
var id: Int
var type: Int
var title: String
var date: String
var url: String
}
28 changes: 14 additions & 14 deletions NoticeBoard/Resources/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6Vr-ul-fgu">
<rect key="frame" x="209" y="-7" width="58" height="32"/>
<rect key="frame" x="210" y="-7" width="57" height="32"/>
<buttonCell key="cell" type="push" title="삭제" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="lyT-oJ-wHC">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
Expand Down Expand Up @@ -148,7 +148,7 @@
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="DQK-qX-oHv">
<rect key="frame" x="209" y="-7" width="58" height="32"/>
<rect key="frame" x="210" y="-7" width="57" height="32"/>
<buttonCell key="cell" type="push" title="삭제" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="SMf-Dw-Vjk">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
Expand Down Expand Up @@ -208,7 +208,7 @@
<rect key="frame" x="378" y="8" width="48" height="9"/>
<subviews>
<button horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="IsP-dM-nz3">
<rect key="frame" x="0.0" y="-3" width="15" height="15"/>
<rect key="frame" x="0.0" y="-2.5" width="16.5" height="15"/>
<buttonCell key="cell" type="bevel" bezelStyle="rounded" image="magnifyingglass" catalog="system" imagePosition="only" alignment="center" controlSize="large" imageScaling="proportionallyDown" inset="2" id="uGV-0D-y44">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
Expand All @@ -218,7 +218,7 @@
</connections>
</button>
<button translatesAutoresizingMaskIntoConstraints="NO" id="RVK-mA-qwh">
<rect key="frame" x="30" y="-3" width="18" height="16"/>
<rect key="frame" x="31" y="-3" width="17.5" height="16"/>
<buttonCell key="cell" type="bevel" bezelStyle="regularSquare" image="star.square.on.square" catalog="system" imagePosition="only" alignment="center" controlSize="large" imageScaling="proportionallyUpOrDown" inset="2" id="5Rq-uo-dvr">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
Expand Down Expand Up @@ -254,7 +254,7 @@
<rect key="frame" x="0.0" y="554" width="466" height="49"/>
<subviews>
<button translatesAutoresizingMaskIntoConstraints="NO" id="FDj-Sb-u1p">
<rect key="frame" x="20" y="3" width="15" height="43"/>
<rect key="frame" x="20" y="3.5" width="14.5" height="43"/>
<buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="xmark" catalog="system" imagePosition="only" alignment="center" controlSize="large" imageScaling="proportionallyUpOrDown" inset="2" id="1PV-bg-vE6">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
Expand All @@ -264,7 +264,7 @@
</connections>
</button>
<searchField wantsLayer="YES" verticalHuggingPriority="750" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PQb-4X-ThL">
<rect key="frame" x="45" y="5" width="401" height="39"/>
<rect key="frame" x="44" y="5" width="402" height="39"/>
<searchFieldCell key="cell" controlSize="large" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" alignment="left" placeholderString="검색할 키워드를 입력하세요." usesSingleLineMode="YES" bezelStyle="round" id="ZwX-q3-VZE">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
Expand Down Expand Up @@ -454,11 +454,11 @@
<stackView distribution="equalSpacing" orientation="horizontal" alignment="centerY" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Hvd-Fp-ahG">
<rect key="frame" x="20" y="560" width="426" height="24"/>
<subviews>
<stackView distribution="fill" orientation="horizontal" alignment="centerY" spacing="15" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7L7-ce-57w">
<rect key="frame" x="0.0" y="0.0" width="83" height="24"/>
<stackView distribution="fill" orientation="horizontal" alignment="centerY" spacing="7" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7L7-ce-57w">
<rect key="frame" x="0.0" y="0.0" width="74" height="24"/>
<subviews>
<button translatesAutoresizingMaskIntoConstraints="NO" id="Dd7-BG-BvA">
<rect key="frame" x="0.0" y="7" width="16" height="12"/>
<rect key="frame" x="0.0" y="6.5" width="15" height="12"/>
<buttonCell key="cell" type="bevel" bezelStyle="regularSquare" image="arrow.backward" catalog="system" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="zPc-VJ-0t1">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
Expand All @@ -468,7 +468,7 @@
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="rHJ-uA-Sf6">
<rect key="frame" x="29" y="0.0" width="56" height="24"/>
<rect key="frame" x="20" y="0.0" width="56" height="24"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="left" title="북마크" id="k0b-LL-3f8">
<font key="font" size="20" name="AppleSDGothicNeo-Bold"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
Expand Down Expand Up @@ -624,9 +624,9 @@
</scenes>
<resources>
<image name="NSTouchBarDeleteTemplate" width="18" height="21"/>
<image name="arrow.backward" catalog="system" width="16" height="12"/>
<image name="magnifyingglass" catalog="system" width="15" height="15"/>
<image name="star.square.on.square" catalog="system" width="18" height="16"/>
<image name="xmark" catalog="system" width="15" height="13"/>
<image name="arrow.backward" catalog="system" width="15" height="12"/>
<image name="magnifyingglass" catalog="system" width="16" height="15"/>
<image name="star.square.on.square" catalog="system" width="17" height="16"/>
<image name="xmark" catalog="system" width="14" height="13"/>
</resources>
</document>
3 changes: 3 additions & 0 deletions NoticeBoard/Utils/BoardParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,12 @@ class BoardParser {
let title = try element.select(".subject > a")
try title.select("span").remove() // a 태그 내의 span 태그 삭제

let date = try element.select(".date").text().components(separatedBy: " ")[1]

notices.append(Notice(id: noticeId == "공지" ? -1 : Int(noticeId)!,
type: noticeId == "공지" ? 0 : 1,
title: try title.text(),
date: date,
url: url + String(try element.select(".subject > a").attr("href"))))
}
completion(notices)
Expand Down
2 changes: 1 addition & 1 deletion NoticeBoard/Utils/BookmarkedNoticeManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class BookmarkedNoticeManager {

// 북마크 한 게시글 데이터를 불러옴
func getNotices() -> [Notice] {
return bookmarkedNotices
return bookmarkedNotices.reversed() // 최신 북마크 게시글을 가장 위에 표시하기 위해 reversed 진행
}

// 북마크한 게시글 추가
Expand Down

0 comments on commit ceccf9c

Please sign in to comment.