Browse Source

Removing unneccesary @objc annotations.

pull/92/head
Abhishek 5 years ago
parent
commit
40b3a5a146
  1. 12
      Clocker/Clocker/LocationController.swift
  2. 2
      Clocker/Events and Reminders/EventCenter.swift
  3. 2
      Clocker/Menu Bar/MenubarHandler.swift
  4. 2
      Clocker/Menu Bar/StatusItemHandler.swift
  5. 4
      Clocker/Overall App/DataStore.swift
  6. 14
      Clocker/Overall App/DateFormatterManager.swift
  7. 2
      Clocker/Overall App/Logger.swift
  8. 2
      Clocker/Overall App/NetworkManager.swift
  9. 4
      Clocker/Panel/Data Layer/TimezoneDataOperations.swift
  10. 2
      Clocker/Panel/FloatingWindowController.swift
  11. 4
      Clocker/Panel/Notes Popover/NotesPopover.swift
  12. 8
      Clocker/Panel/PanelController.swift
  13. 2
      Clocker/Panel/ParentPanelController.swift
  14. 2
      Clocker/Panel/UI/BackgroundPanelView.swift
  15. 2
      Clocker/Preferences/App Feedback/AppFeedbackWindowController.swift

12
Clocker/Clocker/LocationController.swift

@ -12,7 +12,7 @@ class LocationController: NSObject {
return locationManager
}()
@objc class func sharedController() -> LocationController {
class func sharedController() -> LocationController {
return sharedInstance
}
@ -20,23 +20,23 @@ class LocationController: NSObject {
return CLLocationManager.authorizationStatus()
}
@objc func locationAccessNotDetermined() -> Bool {
func locationAccessNotDetermined() -> Bool {
return CLLocationManager.authorizationStatus() == .notDetermined
}
@objc func locationAccessGranted() -> Bool {
func locationAccessGranted() -> Bool {
return CLLocationManager.authorizationStatus() == .authorizedAlways || CLLocationManager.authorizationStatus() == .authorized
}
@objc func locationAccessDenied() -> Bool {
func locationAccessDenied() -> Bool {
return CLLocationManager.authorizationStatus() == .restricted || CLLocationManager.authorizationStatus() == .denied
}
@objc func setDelegate() {
func setDelegate() {
locationManager.delegate = self
}
@objc func determineAndRequestLocationAuthorization() {
func determineAndRequestLocationAuthorization() {
setDelegate()
if CLLocationManager.locationServicesEnabled() {

2
Clocker/Events and Reminders/EventCenter.swift

@ -16,7 +16,7 @@ class EventCenter: NSObject {
var filteredEvents: [Date: [EventInfo]] = [:]
@discardableResult @objc class func sharedCenter() -> EventCenter {
@discardableResult class func sharedCenter() -> EventCenter {
return shared
}

2
Clocker/Menu Bar/MenubarHandler.swift

@ -4,7 +4,7 @@ import Cocoa
import EventKit
class MenubarHandler: NSObject {
@objc func titleForMenubar() -> String? {
func titleForMenubar() -> String? {
if let nextEvent = checkForUpcomingEvents() {
return nextEvent
}

2
Clocker/Menu Bar/StatusItemHandler.swift

@ -273,7 +273,7 @@ class StatusItemHandler: NSObject {
updateMenubar()
}
@objc func invalidateTimer(showIcon show: Bool, isSyncing sync: Bool) {
func invalidateTimer(showIcon show: Bool, isSyncing sync: Bool) {
// Check if user is not showing
// 1. Timezones
// 2. Upcoming Event

4
Clocker/Overall App/DataStore.swift

@ -24,7 +24,7 @@ class DataStore: NSObject {
// Since this pref can accessed every second, let's cache this
private var shouldDisplayDateInMenubar: Bool = false
@objc class func shared() -> DataStore {
class func shared() -> DataStore {
return sharedStore
}
@ -34,7 +34,7 @@ class DataStore: NSObject {
shouldDisplayDateInMenubar = shouldDisplay(.dayInMenubar)
}
@objc func timezones() -> [Data] {
func timezones() -> [Data] {
guard let preferences = userDefaults.object(forKey: CLDefaultPreferenceKey) as? [Data] else {
return []
}

14
Clocker/Overall App/DateFormatterManager.swift

@ -14,7 +14,7 @@ class DateFormatterManager: NSObject {
private static var gregorianCalendar = Calendar(identifier: Calendar.Identifier.gregorian)
private static var USLocale = Locale(identifier: "en_US")
@objc class func dateFormatter(with style: DateFormatter.Style, for timezoneIdentifier: String) -> DateFormatter {
class func dateFormatter(with style: DateFormatter.Style, for timezoneIdentifier: String) -> DateFormatter {
dateFormatter.dateStyle = style
dateFormatter.timeStyle = style
dateFormatter.locale = USLocale
@ -22,7 +22,7 @@ class DateFormatterManager: NSObject {
return dateFormatter
}
@objc class func dateFormatterWithCalendar(with style: DateFormatter.Style) -> DateFormatter {
class func dateFormatterWithCalendar(with style: DateFormatter.Style) -> DateFormatter {
calendarDateFormatter.dateStyle = style
calendarDateFormatter.timeStyle = style
calendarDateFormatter.locale = USLocale
@ -30,14 +30,14 @@ class DateFormatterManager: NSObject {
return calendarDateFormatter
}
@objc class func simpleFormatter(with style: DateFormatter.Style) -> DateFormatter {
class func simpleFormatter(with style: DateFormatter.Style) -> DateFormatter {
simpleFormatter.dateStyle = style
simpleFormatter.timeStyle = style
simpleFormatter.locale = USLocale
return simpleFormatter
}
@objc class func dateFormatterWithFormat(with style: DateFormatter.Style, format: String, timezoneIdentifier: String, locale: Locale = Locale(identifier: "en_US")) -> DateFormatter {
class func dateFormatterWithFormat(with style: DateFormatter.Style, format: String, timezoneIdentifier: String, locale: Locale = Locale(identifier: "en_US")) -> DateFormatter {
specializedFormatter.dateStyle = style
specializedFormatter.timeStyle = style
specializedFormatter.dateFormat = format
@ -46,7 +46,7 @@ class DateFormatterManager: NSObject {
return specializedFormatter
}
@objc class func localizedFormatter(with format: String, for timezoneIdentifier: String, locale _: Locale = Locale.autoupdatingCurrent) -> DateFormatter {
class func localizedFormatter(with format: String, for timezoneIdentifier: String, locale _: Locale = Locale.autoupdatingCurrent) -> DateFormatter {
dateFormatter.dateStyle = .none
dateFormatter.timeStyle = .none
dateFormatter.locale = Locale.autoupdatingCurrent
@ -55,7 +55,7 @@ class DateFormatterManager: NSObject {
return dateFormatter
}
@objc class func localizedCalendaricalDateFormatter(with format: String) -> DateFormatter {
class func localizedCalendaricalDateFormatter(with format: String) -> DateFormatter {
calendarDateFormatter.dateStyle = .none
calendarDateFormatter.timeStyle = .none
calendarDateFormatter.locale = Locale.autoupdatingCurrent
@ -64,7 +64,7 @@ class DateFormatterManager: NSObject {
return calendarDateFormatter
}
@objc class func localizedSimpleFormatter(_ format: String) -> DateFormatter {
class func localizedSimpleFormatter(_ format: String) -> DateFormatter {
localizedSimpleFormatter.dateStyle = .none
localizedSimpleFormatter.timeStyle = .none
localizedSimpleFormatter.dateFormat = format

2
Clocker/Overall App/Logger.swift

@ -6,7 +6,7 @@ import os.log
import os.signpost
class Logger: NSObject {
@objc class func log(object: [String: Any], for key: NSString) {
class func log(object: [String: Any], for key: NSString) {
Answers.logCustomEvent(withName: key as String,
customAttributes: object)
}

2
Clocker/Overall App/NetworkManager.swift

@ -32,7 +32,7 @@ class NetworkManager: NSObject {
}()
}
@objc extension NetworkManager {
extension NetworkManager {
@discardableResult
class func task(with path: String, completionHandler: @escaping (_ response: Data?, _ error: NSError?) -> Void) -> URLSessionDataTask? {
let configuration = URLSessionConfiguration.default

4
Clocker/Panel/Data Layer/TimezoneDataOperations.swift

@ -9,7 +9,7 @@ class TimezoneDataOperations: NSObject {
private static var gregorianCalendar = NSCalendar(calendarIdentifier: NSCalendar.Identifier.gregorian)
private static var swiftyCalendar = Calendar(identifier: .gregorian)
@objc init(with timezone: TimezoneData) {
init(with timezone: TimezoneData) {
dataObject = timezone
}
}
@ -318,7 +318,7 @@ extension TimezoneDataOperations {
return dateFormatter.string(from: Date())
}
@objc func saveObject(at index: Int = -1) {
func saveObject(at index: Int = -1) {
var defaults = DataStore.shared().timezones()
let encodedObject = NSKeyedArchiver.archivedData(withRootObject: dataObject as Any)
index == -1 ? defaults.append(encodedObject) : defaults.insert(encodedObject, at: index)

2
Clocker/Panel/FloatingWindowController.swift

@ -123,7 +123,7 @@ class FloatingWindowController: ParentPanelController {
window?.backgroundColor = NSColor.clear
}
@objc func startWindowTimer() {
func startWindowTimer() {
repeater = Repeater(interval: .seconds(1), mode: .infinite) { _ in
OperationQueue.main.addOperation {
self.updateTime()

4
Clocker/Panel/Notes Popover/NotesPopover.swift

@ -449,7 +449,7 @@ class NotesPopover: NSViewController {
}
}
@objc extension NotesPopover {
extension NotesPopover {
func setRow(row: Int) {
currentRow = row
}
@ -462,7 +462,7 @@ class NotesPopover: NSViewController {
self.popover = popover
}
func themeChanged() {
@objc func themeChanged() {
notesTextView.textColor = Themer.shared().mainTextColor()
customLabel.textColor = Themer.shared().mainTextColor()
reminderPicker.textColor = Themer.shared().mainTextColor()

8
Clocker/Panel/PanelController.swift

@ -13,7 +13,7 @@ class PanelController: ParentPanelController {
super.windowDidLoad()
}
@objc class func shared() -> PanelController {
class func shared() -> PanelController {
return sharedWindow
}
@ -49,7 +49,7 @@ class PanelController: ParentPanelController {
}
}
@objc override func updateDefaultPreferences() {
override func updateDefaultPreferences() {
super.updateDefaultPreferences()
}
@ -264,7 +264,7 @@ class PanelController: ParentPanelController {
setActivePanel(newValue: false)
}
@objc func hasActivePanelGetter() -> Bool {
func hasActivePanelGetter() -> Bool {
return hasActivePanel
}
@ -294,7 +294,7 @@ class PanelController: ParentPanelController {
datasource = nil
}
@objc func setActivePanel(newValue: Bool) {
func setActivePanel(newValue: Bool) {
hasActivePanel = newValue
hasActivePanel ? open() : minimize()
}

2
Clocker/Panel/ParentPanelController.swift

@ -407,7 +407,7 @@ class ParentPanelController: NSWindowController {
}
}
@objc func updateDefaultPreferences() {
func updateDefaultPreferences() {
if #available(OSX 10.14, *) {
PerfLogger.startMarker("Update Default Preferences")
}

2
Clocker/Panel/UI/BackgroundPanelView.swift

@ -57,7 +57,7 @@ class BackgroundPanelView: NSView {
return true
}
@objc func setArrowX(value: CGFloat) {
func setArrowX(value: CGFloat) {
arrowX = value
setNeedsDisplay(bounds)
}

2
Clocker/Preferences/App Feedback/AppFeedbackWindowController.swift

@ -83,7 +83,7 @@ class AppFeedbackWindowController: NSWindowController {
}
}
@objc class func shared() -> AppFeedbackWindowController {
class func shared() -> AppFeedbackWindowController {
return sharedWindow
}

Loading…
Cancel
Save