Skip to content
This repository was archived by the owner on Feb 2, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
Expand Down Expand Up @@ -50,7 +51,7 @@ Carthage/

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode8.2
osx_image: xcode9
xcode_sdk: macosx
branches:
only:
Expand Down
4 changes: 2 additions & 2 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "shpakovski/MASShortcut" "2.3.6"
github "ZipArchive/ZipArchive" "v1.7"
github "ZipArchive/ZipArchive" "v1.8.1"
github "nodes-ios/model-generator" "1.0.2"
github "shpakovski/MASShortcut" "2.3.6"
30 changes: 23 additions & 7 deletions Model Boiler.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -268,16 +268,16 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0810;
LastUpgradeCheck = 0900;
ORGANIZATIONNAME = Nodes;
TargetAttributes = {
01ECF0FF1C43FDD700C23397 = {
CreatedOnToolsVersion = 7.2;
LastSwiftMigration = 0810;
LastSwiftMigration = 0900;
};
3092679B1B77EBE700DFE5A1 = {
CreatedOnToolsVersion = 7.0;
LastSwiftMigration = 0810;
LastSwiftMigration = 0900;
};
};
};
Expand Down Expand Up @@ -354,7 +354,8 @@
buildSettings = {
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand All @@ -370,7 +371,8 @@
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = On;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -382,14 +384,20 @@
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_EMPTY_BODY = YES;
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;
Expand Down Expand Up @@ -436,7 +444,8 @@
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = "com.nodes.Model-Boiler";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Debug;
};
Expand All @@ -448,14 +457,20 @@
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_EMPTY_BODY = YES;
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;
Expand Down Expand Up @@ -499,7 +514,8 @@
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = "com.nodes.Model-Boiler";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 3.0;
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
SWIFT_VERSION = 4.0;
};
name = Release;
};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0810"
LastUpgradeVersion = "0900"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,6 +26,7 @@
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -45,6 +46,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
2 changes: 1 addition & 1 deletion Model Boiler/Classes/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Cocoa
@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {

let mainController = StatusBarController()
@objc let mainController = StatusBarController()

func applicationDidFinishLaunching(_ aNotification: Notification) {
// Stop already running instances
Expand Down
12 changes: 6 additions & 6 deletions Model Boiler/Classes/Helpers/KeyCommandManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct KeyCommandManager {

static func setDefaultKeyCommand() {
let key = "§"
let mask = NSEventModifierFlags.command
let mask = NSEvent.ModifierFlags.command

do {
try KeyCommandManager.updateKeyCommand(key, modifierMask: mask)
Expand All @@ -25,15 +25,15 @@ struct KeyCommandManager {

// MARK: - Key Command -

static func currentKeyCommand() -> (command: String, modifierMask: NSEventModifierFlags)? {
static func currentKeyCommand() -> (command: String, modifierMask: NSEvent.ModifierFlags)? {
if let keyCommandString = UserDefaults.standard.string(forKey: settingsKey) {
return keyCommandForString(keyCommandString)
}

return nil
}

static func updateKeyCommand(_ command: String, modifierMask: NSEventModifierFlags) throws {
static func updateKeyCommand(_ command: String, modifierMask: NSEvent.ModifierFlags) throws {
let bundle = Bundle.main

guard let appServices = (bundle.infoDictionary?["NSServices"] as AnyObject).firstObject as? [String: AnyObject],
Expand Down Expand Up @@ -81,7 +81,7 @@ struct KeyCommandManager {

// MARK: - Helpers -

static func stringForKeyCommand(_ command: String, modifierMask: NSEventModifierFlags) -> String {
static func stringForKeyCommand(_ command: String, modifierMask: NSEvent.ModifierFlags) -> String {
var key = ""

if modifierMask.contains(.command) { key += "@" }
Expand All @@ -92,8 +92,8 @@ struct KeyCommandManager {
}


static func keyCommandForString(_ string: String) -> (command: String, modifierMask: NSEventModifierFlags) {
var returnValue = (command: "", modifierMask: NSEventModifierFlags(rawValue: 0))
static func keyCommandForString(_ string: String) -> (command: String, modifierMask: NSEvent.ModifierFlags) {
var returnValue = (command: "", modifierMask: NSEvent.ModifierFlags(rawValue: 0))
if string.characters.count == 0 { return returnValue }

switch string.characters.first! {
Expand Down
20 changes: 10 additions & 10 deletions Model Boiler/Classes/Helpers/UpdateManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,38 @@ import ZipArchive

open class UpdateManager: NSObject {

static let sharedInstance = UpdateManager()
@objc static let sharedInstance = UpdateManager()

let repoPath = "repos/nodes-ios/ModelBoiler/"
let downloadName = "Model.Boiler.app.zip"
@objc let repoPath = "repos/nodes-ios/ModelBoiler/"
@objc let downloadName = "Model.Boiler.app.zip"

var updateTimer: Timer?
@objc var updateTimer: Timer?
fileprivate override init() { }

open static func start() {
@objc open static func start() {
sharedInstance.start()
}

open func start() {
@objc open func start() {
// Schedule update timer for every hour
checkForUpdates()
updateTimer = Timer.scheduledTimer(timeInterval: 3600, target: self, selector: #selector(UpdateManager.autoUpdateTimerFired), userInfo: nil, repeats: true)
}

open static func stop() {
@objc open static func stop() {
sharedInstance.stop()
}

open func stop() {
@objc open func stop() {
updateTimer?.invalidate()
updateTimer = nil
}

func autoUpdateTimerFired() {
@objc func autoUpdateTimerFired() {
checkForUpdates(showAlerts: false)
}

open func checkForUpdates(showAlerts: Bool = true) {
@objc open func checkForUpdates(showAlerts: Bool = true) {
guard let request = URLRequest.requestForGithubWithPath(repoPath + "releases") else {
return
}
Expand Down
Loading