diff --git a/Converter/AppDelegate.swift b/Converter/AppDelegate.swift index 5ea1fe3..03ca5ed 100644 --- a/Converter/AppDelegate.swift +++ b/Converter/AppDelegate.swift @@ -21,9 +21,9 @@ class AppDelegate: NSObject, NSApplicationDelegate { // Insert code here to tear down your application } - func applicationShouldTerminate(_ sender: NSApplication) -> NSApplicationTerminateReply { - guard isConverting else { return NSApplicationTerminateReply.terminateNow } - return NSApplicationTerminateReply.terminateCancel + func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply { + guard isConverting else { return NSApplication.TerminateReply.terminateNow } + return NSApplication.TerminateReply.terminateCancel } func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { diff --git a/Docsis Toolkit.xcodeproj/project.pbxproj b/Docsis Toolkit.xcodeproj/project.pbxproj index 30bf9cf..f2307f7 100644 --- a/Docsis Toolkit.xcodeproj/project.pbxproj +++ b/Docsis Toolkit.xcodeproj/project.pbxproj @@ -577,18 +577,19 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0830; - LastUpgradeCheck = 0830; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = "Kilian Hofmann"; TargetAttributes = { E220BF9B1EFB22D400DF5A97 = { CreatedOnToolsVersion = 8.3.3; DevelopmentTeam = 795KPDV76S; + LastSwiftMigration = 0900; ProvisioningStyle = Automatic; }; E2218C971EF2D345004298F6 = { CreatedOnToolsVersion = 8.3.3; DevelopmentTeam = 795KPDV76S; - LastSwiftMigration = 0830; + LastSwiftMigration = 0900; ProvisioningStyle = Automatic; }; E2218CE51EF2D577004298F6 = { @@ -599,6 +600,7 @@ E2218D281EF3271F004298F6 = { CreatedOnToolsVersion = 8.3.3; DevelopmentTeam = 795KPDV76S; + LastSwiftMigration = 0900; ProvisioningStyle = Automatic; }; E2218D3D1EF32803004298F6 = { @@ -755,7 +757,8 @@ PRODUCT_BUNDLE_IDENTIFIER = com.weebly.alikja.Converter; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -771,7 +774,8 @@ PRODUCT_BUNDLE_IDENTIFIER = com.weebly.alikja.Converter; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -785,7 +789,9 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -793,7 +799,11 @@ CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -823,6 +833,7 @@ SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_DISABLE_SAFETY_CHECKS = NO; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; }; name = Debug; }; @@ -836,7 +847,9 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; @@ -844,7 +857,11 @@ CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -866,6 +883,7 @@ SDKROOT = macosx; SWIFT_DISABLE_SAFETY_CHECKS = NO; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; }; name = Release; }; @@ -884,7 +902,8 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Logger4/Logger4-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -902,7 +921,8 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "Logger4/Logger4-Bridging-Header.h"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_VERSION = 4.0; }; name = Release; }; @@ -944,7 +964,8 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_DISABLE_SAFETY_CHECKS = NO; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -962,7 +983,8 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_DISABLE_SAFETY_CHECKS = YES; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/Docsis Toolkit.xcodeproj/xcshareddata/xcschemes/All.xcscheme b/Docsis Toolkit.xcodeproj/xcshareddata/xcschemes/All.xcscheme index c1f748e..d330ab3 100644 --- a/Docsis Toolkit.xcodeproj/xcshareddata/xcschemes/All.xcscheme +++ b/Docsis Toolkit.xcodeproj/xcshareddata/xcschemes/All.xcscheme @@ -1,6 +1,6 @@ @@ -73,6 +74,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/Converter.xcscheme b/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/Converter.xcscheme index 99e501b..93f24e7 100644 --- a/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/Converter.xcscheme +++ b/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/Converter.xcscheme @@ -1,6 +1,6 @@ @@ -26,13 +26,14 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" shouldUseLaunchSchemeArgsEnv = "YES"> @@ -45,6 +46,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" @@ -55,7 +57,7 @@ runnableDebuggingMode = "0"> @@ -74,7 +76,7 @@ runnableDebuggingMode = "0"> diff --git a/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/Graphic Analysis 2.xcscheme b/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/Graphic Analysis 2.xcscheme index 1276c65..0ab7997 100644 --- a/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/Graphic Analysis 2.xcscheme +++ b/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/Graphic Analysis 2.xcscheme @@ -1,6 +1,6 @@ @@ -45,6 +46,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/Logger4.xcscheme b/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/Logger4.xcscheme index d6237de..0b6f33e 100644 --- a/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/Logger4.xcscheme +++ b/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/Logger4.xcscheme @@ -1,6 +1,6 @@ @@ -45,6 +46,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/FileOperations.swift b/FileOperations.swift index ba14551..c6ec9c5 100644 --- a/FileOperations.swift +++ b/FileOperations.swift @@ -14,7 +14,7 @@ class FileOperations: NSObject { // 15 in threshold indicates some error static func encodeTimeStamp(stamp: String, threshold: String) -> UInt32 { - let mappingEncode: Dictionary = ["-" : 0, "62.81": 1, "58.21": 2, "57": 3, "59.81": 4, "55.21": 5, "54": 6, "56.18": 7, "52.21": 8, "51": 9] + let mappingEncode: Dictionary = ["-" : 0, "62.18": 1, "58.21": 2, "57": 3, "59.18": 4, "55.21": 5, "54": 6, "56.18": 7, "52.21": 8, "51": 9] let separated: Array = stamp.components(separatedBy: ":") let hours: UInt32 = UInt32(separated[0])! << 16 let minutes: UInt32 = UInt32(separated[1])! << 10 @@ -24,7 +24,7 @@ class FileOperations: NSObject { } static func decodeTimestamp(stamp: UInt32) -> (String, String) { - let mappingDecode: Dictionary = [0: "-", 1: "62.81", 2: "58.21", 3: "57", 4: "59.81", 5: "55.21", 6: "54", 7: "56.18", 8: "52.21", 9: "51", 15: "-"] + let mappingDecode: Dictionary = [0: "-", 1: "62.18", 2: "58.21", 3: "57", 4: "59.18", 5: "55.21", 6: "54", 7: "56.18", 8: "52.21", 9: "51", 15: "-"] let threshold: UInt32 = stamp & 0b1111 let seconds: UInt32 = (stamp >> 4) & 0b111111 let minutes: UInt32 = (stamp >> 10) & 0b111111 diff --git a/Graphic Analysis 2/CollectionViewMonth.swift b/Graphic Analysis 2/CollectionViewMonth.swift index 168c504..01305a6 100644 --- a/Graphic Analysis 2/CollectionViewMonth.swift +++ b/Graphic Analysis 2/CollectionViewMonth.swift @@ -33,7 +33,7 @@ extension CollectionViewMonth: NSCollectionViewDataSource { } func collectionView(_ itemForRepresentedObjectAtcollectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem { - let item = itemForRepresentedObjectAtcollectionView.makeItem(withIdentifier: "CollectionViewItemMonth", for: indexPath) + let item = itemForRepresentedObjectAtcollectionView.makeItem(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "CollectionViewItemMonth"), for: indexPath) guard let item2 = item as? CollectionViewItemMonth else { self.doc.progress.increment(by: 100/31) if self.doc.progress.doubleValue > 98 { diff --git a/Graphic Analysis 2/CollectionViewYear.swift b/Graphic Analysis 2/CollectionViewYear.swift index cd7b467..e97bd4c 100644 --- a/Graphic Analysis 2/CollectionViewYear.swift +++ b/Graphic Analysis 2/CollectionViewYear.swift @@ -34,7 +34,7 @@ extension CollectionViewYear: NSCollectionViewDataSource { } func collectionView(_ itemForRepresentedObjectAtcollectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem { - let item = itemForRepresentedObjectAtcollectionView.makeItem(withIdentifier: "CollectionViewItemYear", for: indexPath) + let item = itemForRepresentedObjectAtcollectionView.makeItem(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "CollectionViewItemYear"), for: indexPath) guard let item2 = item as? CollectionViewItemYear else { return item } if item2.isSelected { item2.view.layer?.borderColor = NSColor.gray.cgColor diff --git a/Graphic Analysis 2/Document.swift b/Graphic Analysis 2/Document.swift index e256e7b..17a0649 100644 --- a/Graphic Analysis 2/Document.swift +++ b/Graphic Analysis 2/Document.swift @@ -26,6 +26,10 @@ class Document: NSDocument { @IBOutlet var progress: NSProgressIndicator! @IBOutlet var exportProgress: NSProgressIndicator! + override class var autosavesInPlace: Bool { + return false; + } + override init() { super.init() for _ in 0..<12 { @@ -37,12 +41,8 @@ class Document: NSDocument { } } - override class func autosavesInPlace() -> Bool { - return false - } - - override var windowNibName: String? { - return "Document" + override var windowNibName: NSNib.Name? { + return NSNib.Name(rawValue: "Document") } override func read(from fileWrapper: FileWrapper, ofType typeName: String) throws { @@ -63,13 +63,13 @@ class Document: NSDocument { // Setup collection layout let flowLayout = NSCollectionViewFlowLayout() flowLayout.itemSize = NSSize(width: 228, height: 211) - flowLayout.sectionInset = EdgeInsets(top: 10, left: 0, bottom: 10, right: 0) + flowLayout.sectionInset = NSEdgeInsets(top: 10, left: 0, bottom: 10, right: 0) flowLayout.minimumInteritemSpacing = 10 flowLayout.minimumLineSpacing = 10 collectionViewYear.collectionViewLayout = flowLayout let flowLayout2 = NSCollectionViewFlowLayout() flowLayout2.itemSize = NSSize(width: 135, height: 132) - flowLayout2.sectionInset = EdgeInsets(top: 2, left: 2, bottom: 2, right: 2) + flowLayout2.sectionInset = NSEdgeInsets(top: 2, left: 2, bottom: 2, right: 2) flowLayout2.minimumInteritemSpacing = 2 flowLayout2.minimumLineSpacing = 2 collectionViewMonth.collectionViewLayout = flowLayout2 @@ -93,14 +93,14 @@ class Document: NSDocument { let alert = NSAlert() alert.messageText = "Warning" alert.informativeText = "PDF export active. Please wait until completed." - alert.alertStyle = NSAlertStyle.warning + alert.alertStyle = NSAlert.Style.warning alert.addButton(withTitle: "OK") alert.runModal() } pthread_mutex_unlock(&(NSApp.delegate as! AppDelegate).lock) } - override func printOperation(withSettings printSettings: [String : Any]) throws -> NSPrintOperation { + override func printOperation(withSettings printSettings: [NSPrintInfo.AttributeKey : Any]) throws -> NSPrintOperation { let printOperation: NSPrintOperation = NSPrintOperation(view: collectionViewMonth) printOperation.printInfo.orientation = .landscape printOperation.printInfo.horizontalPagination = .fitPagination @@ -119,7 +119,7 @@ class Document: NSDocument { savePanel.nameFieldStringValue = name savePanel.canCreateDirectories = true savePanel.beginSheetModal(for: windowController.window!) { result in - if result == NSFileHandlingPanelOKButton { + if result.rawValue == NSFileHandlingPanelOKButton { self.exportProgress.doubleValue = 0 self.exportProgress.isHidden = false let operationQueue: OperationQueue = OperationQueue() diff --git a/Graphic Analysis 2/FrequencyGraph.swift b/Graphic Analysis 2/FrequencyGraph.swift index 80bfca3..5ddafbb 100644 --- a/Graphic Analysis 2/FrequencyGraph.swift +++ b/Graphic Analysis 2/FrequencyGraph.swift @@ -57,7 +57,7 @@ class FrequencyGraph: NSView { override func draw(_ dirtyRect: NSRect) { NSColor.white.setFill() - NSRectFill(dirtyRect) + __NSRectFill(dirtyRect) threshold.lineWidth = 0.5 diff --git a/Graphic Analysis 2/GraphWindow.swift b/Graphic Analysis 2/GraphWindow.swift index 47ceae9..5df69d0 100644 --- a/Graphic Analysis 2/GraphWindow.swift +++ b/Graphic Analysis 2/GraphWindow.swift @@ -23,8 +23,8 @@ class GraphWindow: NSWindowController { let loadingQueue3: OperationQueue = OperationQueue() let loadingQueue4: OperationQueue = OperationQueue() - override var windowNibName: String! { - return "GraphWindow" + override var windowNibName: NSNib.Name? { + return NSNib.Name(rawValue: "GraphWindow") } required init?(coder: NSCoder) { @@ -103,7 +103,7 @@ class GraphWindow: NSWindowController { } extension GraphWindow: NSWindowDelegate { - func windowShouldClose(_ sender: Any) -> Bool { + func windowShouldClose(_ sender: NSWindow) -> Bool { for op in loadingQueue1.operations { if !op.isFinished { return false @@ -124,7 +124,7 @@ extension GraphWindow: NSWindowDelegate { return false } } - collectionViewItem.collectionView.deselectAll(self) + collectionViewItem.collectionView?.deselectAll(self) return true } } diff --git a/Graphic Analysis 2/Info.plist b/Graphic Analysis 2/Info.plist index d78f011..f761646 100644 --- a/Graphic Analysis 2/Info.plist +++ b/Graphic Analysis 2/Info.plist @@ -44,7 +44,7 @@ CFBundleShortVersionString 2.1 CFBundleVersion - 481 + 491 LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion diff --git a/Graphic Analysis 2/LossDistributionPie.swift b/Graphic Analysis 2/LossDistributionPie.swift index 4870f63..921690a 100644 --- a/Graphic Analysis 2/LossDistributionPie.swift +++ b/Graphic Analysis 2/LossDistributionPie.swift @@ -39,10 +39,10 @@ class LossDistributionPie: NSView { arc.move(to: center) arc.addArc(center: center, radius: 18, startAngle: startAngle - CGFloat(i)*increment, endAngle: startAngle - CGFloat(i+1)*increment, clockwise: true) arc.closeSubpath() - NSGraphicsContext.current()!.cgContext.addPath(arc) - NSGraphicsContext.current()!.cgContext.setFillColor(CGColor(red: 1, green: 0, blue: 0, alpha: CGFloat(distribution[i]) / 60)) - NSGraphicsContext.current()!.cgContext.setStrokeColor(NSColor.controlShadowColor.cgColor) - NSGraphicsContext.current()!.cgContext.drawPath(using: CGPathDrawingMode.fillStroke) + NSGraphicsContext.current!.cgContext.addPath(arc) + NSGraphicsContext.current!.cgContext.setFillColor(CGColor(red: 1, green: 0, blue: 0, alpha: CGFloat(distribution[i]) / 60)) + NSGraphicsContext.current!.cgContext.setStrokeColor(NSColor.controlShadowColor.cgColor) + NSGraphicsContext.current!.cgContext.drawPath(using: CGPathDrawingMode.fillStroke) } } } diff --git a/Graphic Analysis 2/PDFDraw.swift b/Graphic Analysis 2/PDFDraw.swift index 8ad1092..469757b 100644 --- a/Graphic Analysis 2/PDFDraw.swift +++ b/Graphic Analysis 2/PDFDraw.swift @@ -46,8 +46,9 @@ class PDFDraw: NSWindowController { var month: Int = 0 var days: [FileWrapper?] = [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil] - override var windowNibName: String! { - return "PDFDraw" + //override var windowNibName: NSNib.Name! { + override var windowNibName: NSNib.Name? { + return NSNib.Name(rawValue: "PDFDraw") } required init?(coder: NSCoder) diff --git a/Graphic Analysis 2/PDFItemViewController.swift b/Graphic Analysis 2/PDFItemViewController.swift index a0603cf..c439efa 100644 --- a/Graphic Analysis 2/PDFItemViewController.swift +++ b/Graphic Analysis 2/PDFItemViewController.swift @@ -25,14 +25,14 @@ class PDFItemViewController: NSViewController { } init(dayFW: FileWrapper?, day: Int, monthName: String) { - super.init(nibName: "PDFItemViewController", bundle: Bundle.main)! + super.init(nibName: NSNib.Name(rawValue: "PDFItemViewController"), bundle: Bundle.main) self.dayFW = dayFW self.dayI = day self.monthName = monthName } init(dayFW: FileWrapper?, day: Int) { - super.init(nibName: "PDFItemViewController", bundle: Bundle.main)! + super.init(nibName: NSNib.Name(rawValue: "PDFItemViewController"), bundle: Bundle.main) self.dayFW = dayFW self.dayI = day } diff --git a/Graphic Analysis 2/PDFTitle.swift b/Graphic Analysis 2/PDFTitle.swift index cbb05c4..fae7fef 100644 --- a/Graphic Analysis 2/PDFTitle.swift +++ b/Graphic Analysis 2/PDFTitle.swift @@ -30,8 +30,8 @@ class PDFTitle: NSWindowController { appName.stringValue = "Graphic Analysis 2 Version \(version())" } - override var windowNibName: String! { - return "PDFTitle" + override var windowNibName: NSNib.Name? { + return NSNib.Name(rawValue: "PDFTitle") } required init?(coder: NSCoder) diff --git a/Graphic Analysis 2/buildnum.ver b/Graphic Analysis 2/buildnum.ver index 60450e8..02fa561 100644 --- a/Graphic Analysis 2/buildnum.ver +++ b/Graphic Analysis 2/buildnum.ver @@ -1,2 +1,2 @@ version 2.1 -build 481 +build 491 diff --git a/Logger4/AppDelegate.swift b/Logger4/AppDelegate.swift index e3bbb45..8d20ada 100644 --- a/Logger4/AppDelegate.swift +++ b/Logger4/AppDelegate.swift @@ -24,7 +24,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { // URL Session for DOCSIS data and Internet check let urlSession: URLSession = URLSession(configuration: .default) // Preferences - let pref: NSWindowController = NSWindowController(windowNibName: "SettingsWindowController") + let pref: NSWindowController = NSWindowController(windowNibName: NSNib.Name(rawValue: "SettingsWindowController")) // Timers var timerFreqs: Timer = Timer() var timerFails: Timer = Timer() @@ -52,7 +52,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { justTime.locale = Locale(identifier: "de_DE") // Set status item - statusItem = NSStatusBar.system().statusItem(withLength: -2) + statusItem = NSStatusBar.system.statusItem(withLength: -2) statusItem.title = "AL" // Create status item menu let menu: NSMenu = NSMenu.init() @@ -60,7 +60,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { let menuAbout: NSMenuItem = NSMenuItem(title: "About Logger", action: #selector(NSApp.orderFrontStandardAboutPanel(_:)), keyEquivalent: "") let menuQuit: NSMenuItem = NSMenuItem.init(title: "Quit", action: #selector(NSApp.terminate(_:)), keyEquivalent: "q") let menuPref: NSMenuItem = NSMenuItem(title: "Preferences", action: #selector(self.preferences(_:)), keyEquivalent: "") - menuPref.image = NSImage(named: NSImageNameActionTemplate) + menuPref.image = NSImage(named: NSImage.Name.actionTemplate) // Layout menu menu.addItem(menuAbout) menu.addItem(NSMenuItem.separator()) @@ -97,26 +97,26 @@ class AppDelegate: NSObject, NSApplicationDelegate { } } - func applicationShouldTerminate(_ sender: NSApplication) -> NSApplicationTerminateReply { + func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply { urlSession.invalidateAndCancel() return .terminateNow } // MARK: - Logging Functions - func logFreqs(_: Timer) { + @objc func logFreqs(_: Timer) { let frequencyOperation: FrequencyOperation = FrequencyOperation() OperationQueue.main.addOperation(frequencyOperation) } - func logFails(_: Timer) { + @objc func logFails(_: Timer) { let connectionLossOperation: ConnectionLossOperation = ConnectionLossOperation() OperationQueue.main.addOperation(connectionLossOperation) } // MARK: - General functions - func preferences(_ sender: NSMenuItem) { + @objc func preferences(_ sender: NSMenuItem) { timerFreqs.invalidate() timerFails.invalidate() diff --git a/Logger4/Info.plist b/Logger4/Info.plist index 28f722b..da1c648 100644 --- a/Logger4/Info.plist +++ b/Logger4/Info.plist @@ -17,7 +17,7 @@ CFBundleShortVersionString 4.2 CFBundleVersion - 49 + 50 LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion diff --git a/Logger4/buildnum.ver b/Logger4/buildnum.ver index b79a0b5..ad85d96 100644 --- a/Logger4/buildnum.ver +++ b/Logger4/buildnum.ver @@ -1,2 +1,2 @@ version 4.2 -build 49 +build 50