Skip to content

Commit

Permalink
타이틀 표시 코드를 추가하였습니다
Browse files Browse the repository at this point in the history
  • Loading branch information
min-uuu committed Dec 25, 2020
1 parent 10d9771 commit 740d189
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Binary file not shown.
7 changes: 5 additions & 2 deletions For_0416/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import Cocoa
class AppDelegate: NSObject, NSApplicationDelegate {

// 메뉴 바 생성
// let statusItem = NSStatusBar.system.statusItem(withLength:NSStatusItem.squareLength)
let statusItem = NSStatusBar.system.statusItem(withLength:NSStatusItem.variableLength)

func applicationDidFinishLaunching(_ aNotification: Notification) {
Expand All @@ -23,11 +22,15 @@ class AppDelegate: NSObject, NSApplicationDelegate {
let startDate = dateFormatter.date(from: "2014-04-16")!
let currentDate = Date()
let dday = Calendar.current.dateComponents([.day], from: startDate, to: currentDate).day!

if let button = statusItem.button {
button.image = NSImage(named:NSImage.Name("StatusBarButtonImage"))
button.imagePosition = NSControl.ImagePosition.imageLeft
button.title = "+\(dday)"

// 타이틀 표시 코드
// button.title = "For_0416"

button.action = #selector(togglePopover(_:))
}

Expand Down

0 comments on commit 740d189

Please sign in to comment.