Skip to content

Commit

Permalink
[Optimize] Migrate to use Settings & SwiftUI (#212)
Browse files Browse the repository at this point in the history
* Add AboutVC and PrivacyVC in SwiftUI

* Add SwiftUI life cycle support for macOS 13+

* Update Localizable.xcstrings

* Add GeneralTab so that user can switch back to old mode

* Add more menu item

* Fix hideMenuBar on new app

* Disable the toggle UI on non-Debug env
  • Loading branch information
Kyle-Ye authored Dec 29, 2023
1 parent c209856 commit 89bc797
Show file tree
Hide file tree
Showing 16 changed files with 615 additions and 35 deletions.
80 changes: 76 additions & 4 deletions Easydict.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
039F5508294B6E29004AB940 /* EZAboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 039F5503294B6E29004AB940 /* EZAboutViewController.m */; };
03B022E629231FA6001C7E63 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 03B0221D29231FA6001C7E63 /* Assets.xcassets */; };
03B022E729231FA6001C7E63 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 03B0221F29231FA6001C7E63 /* Main.storyboard */; };
03B022E829231FA6001C7E63 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 03B0222129231FA6001C7E63 /* main.m */; };
03B022E829231FA6001C7E63 /* entry.m in Sources */ = {isa = PBXBuildFile; fileRef = 03B0222129231FA6001C7E63 /* entry.m */; };
03B022E929231FA6001C7E63 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 03B0222329231FA6001C7E63 /* AppDelegate.m */; };
03B022EC29231FA6001C7E63 /* baidu-translate-sign.js in Resources */ = {isa = PBXBuildFile; fileRef = 03B0222F29231FA6001C7E63 /* baidu-translate-sign.js */; };
03B022F029231FA6001C7E63 /* google-translate-sign.js in Resources */ = {isa = PBXBuildFile; fileRef = 03B0223529231FA6001C7E63 /* google-translate-sign.js */; };
Expand Down Expand Up @@ -222,8 +222,15 @@
17BCAEF82B0DFF9000A7D372 /* EZNiuTransTranslate.m in Sources */ = {isa = PBXBuildFile; fileRef = 17BCAEF62B0DFF9000A7D372 /* EZNiuTransTranslate.m */; };
2721E4D02AFE920700A059AC /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = 2721E4CF2AFE920700A059AC /* Alamofire */; };
2746AEC12AF95138005FE0A1 /* CaiyunService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2746AEC02AF95138005FE0A1 /* CaiyunService.swift */; };
276742082B3DC230002A2C75 /* PrivacyTab.swift in Sources */ = {isa = PBXBuildFile; fileRef = 276742042B3DC230002A2C75 /* PrivacyTab.swift */; };
276742092B3DC230002A2C75 /* AboutTab.swift in Sources */ = {isa = PBXBuildFile; fileRef = 276742052B3DC230002A2C75 /* AboutTab.swift */; };
278322602B0FB0EA0026644C /* CaiyunResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2783225F2B0FB0EA0026644C /* CaiyunResponse.swift */; };
278322622B0FB8EF0026644C /* CaiyunTranslateType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 278322612B0FB8EF0026644C /* CaiyunTranslateType.swift */; };
278540342B3DE04F004E9488 /* GeneralTab.swift in Sources */ = {isa = PBXBuildFile; fileRef = 278540332B3DE04F004E9488 /* GeneralTab.swift */; };
27FE95272B3DC55F000AD654 /* EasydictApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FE95262B3DC55F000AD654 /* EasydictApp.swift */; };
27FE98052B3DCB09000AD654 /* NewAppManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FE98042B3DCB09000AD654 /* NewAppManager.swift */; };
27FE98092B3DD536000AD654 /* SettingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FE98082B3DD536000AD654 /* SettingView.swift */; };
27FE980B2B3DD5D1000AD654 /* MenuItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FE980A2B3DD5D1000AD654 /* MenuItemView.swift */; };
6220AD5B2A82812300BBFB52 /* EZBingService.m in Sources */ = {isa = PBXBuildFile; fileRef = 6220AD5A2A82812300BBFB52 /* EZBingService.m */; };
6295DE312A84D82E006145F4 /* EZBingTranslateModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6295DE302A84D82E006145F4 /* EZBingTranslateModel.m */; };
6295DE342A84EF76006145F4 /* EZBingLookupModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6295DE332A84EF76006145F4 /* EZBingLookupModel.m */; };
Expand Down Expand Up @@ -443,7 +450,7 @@
03B0221D29231FA6001C7E63 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
03B0221E29231FA6001C7E63 /* Easydict.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Easydict.entitlements; sourceTree = "<group>"; };
03B0222029231FA6001C7E63 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
03B0222129231FA6001C7E63 /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
03B0222129231FA6001C7E63 /* entry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = entry.m; sourceTree = "<group>"; };
03B0222229231FA6001C7E63 /* EZConst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EZConst.h; sourceTree = "<group>"; };
03B0222329231FA6001C7E63 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
03B0222F29231FA6001C7E63 /* baidu-translate-sign.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "baidu-translate-sign.js"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -668,11 +675,19 @@
17BCAEF52B0DFF9000A7D372 /* EZNiuTransTranslateResponse.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZNiuTransTranslateResponse.m; sourceTree = "<group>"; };
17BCAEF62B0DFF9000A7D372 /* EZNiuTransTranslate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EZNiuTransTranslate.m; sourceTree = "<group>"; };
2746AEC02AF95138005FE0A1 /* CaiyunService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CaiyunService.swift; sourceTree = "<group>"; };
276742042B3DC230002A2C75 /* PrivacyTab.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PrivacyTab.swift; sourceTree = "<group>"; };
276742052B3DC230002A2C75 /* AboutTab.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AboutTab.swift; sourceTree = "<group>"; };
2783225F2B0FB0EA0026644C /* CaiyunResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CaiyunResponse.swift; sourceTree = "<group>"; };
278322612B0FB8EF0026644C /* CaiyunTranslateType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CaiyunTranslateType.swift; sourceTree = "<group>"; };
278540332B3DE04F004E9488 /* GeneralTab.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GeneralTab.swift; sourceTree = "<group>"; };
27B7919C2AEC36A1006E07C6 /* Easydict.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Easydict.xcconfig; sourceTree = "<group>"; };
27B7919D2AEC36A1006E07C6 /* Easydict-debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "Easydict-debug.xcconfig"; sourceTree = "<group>"; };
27B791A02AEC3A5C006E07C6 /* Easydict-debug.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = "Easydict-debug.entitlements"; sourceTree = "<group>"; };
27FE95262B3DC55F000AD654 /* EasydictApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EasydictApp.swift; sourceTree = "<group>"; };
27FE95282B3DC666000AD654 /* entry.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = entry.h; sourceTree = "<group>"; };
27FE98042B3DCB09000AD654 /* NewAppManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewAppManager.swift; sourceTree = "<group>"; };
27FE98082B3DD536000AD654 /* SettingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingView.swift; sourceTree = "<group>"; };
27FE980A2B3DD5D1000AD654 /* MenuItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuItemView.swift; sourceTree = "<group>"; };
357E179B303EF855EF4561FB /* Pods-EasydictTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-EasydictTests.release.xcconfig"; path = "Target Support Files/Pods-EasydictTests/Pods-EasydictTests.release.xcconfig"; sourceTree = "<group>"; };
378E73A7EA8FC8FB9C975A63 /* Pods_EasydictTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_EasydictTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6220AD592A82812300BBFB52 /* EZBingService.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EZBingService.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1010,7 +1025,8 @@
03B0221D29231FA6001C7E63 /* Assets.xcassets */,
03B0221E29231FA6001C7E63 /* Easydict.entitlements */,
27B791A02AEC3A5C006E07C6 /* Easydict-debug.entitlements */,
03B0222129231FA6001C7E63 /* main.m */,
27FE95282B3DC666000AD654 /* entry.h */,
03B0222129231FA6001C7E63 /* entry.m */,
03B0222229231FA6001C7E63 /* EZConst.h */,
03B0221C29231FA6001C7E63 /* AppDelegate.h */,
03B0222329231FA6001C7E63 /* AppDelegate.m */,
Expand Down Expand Up @@ -1168,6 +1184,7 @@
03B0221829231FA6001C7E63 /* Easydict */ = {
isa = PBXGroup;
children = (
27FE98032B3DCA9F000AD654 /* NewApp */,
03B0222429231FA6001C7E63 /* Feature */,
0376AB59294F5EEC00E2E2A4 /* App */,
);
Expand All @@ -1177,6 +1194,7 @@
03B0222429231FA6001C7E63 /* Feature */ = {
isa = PBXGroup;
children = (
276742012B3DC230002A2C75 /* SettingsWindow */,
03B0224F29231FA6001C7E63 /* ViewController */,
03B0222B29231FA6001C7E63 /* Service */,
03E02A2329250CED00A10260 /* EventMonitor */,
Expand Down Expand Up @@ -1933,6 +1951,51 @@
path = Caiyun;
sourceTree = "<group>";
};
276742012B3DC230002A2C75 /* SettingsWindow */ = {
isa = PBXGroup;
children = (
);
path = SettingsWindow;
sourceTree = "<group>";
};
27FE98032B3DCA9F000AD654 /* NewApp */ = {
isa = PBXGroup;
children = (
27FE95262B3DC55F000AD654 /* EasydictApp.swift */,
27FE98042B3DCB09000AD654 /* NewAppManager.swift */,
27FE98062B3DD525000AD654 /* View */,
);
path = NewApp;
sourceTree = "<group>";
};
27FE98062B3DD525000AD654 /* View */ = {
isa = PBXGroup;
children = (
27FE980A2B3DD5D1000AD654 /* MenuItemView.swift */,
27FE98072B3DD52B000AD654 /* SettingView */,
);
path = View;
sourceTree = "<group>";
};
27FE98072B3DD52B000AD654 /* SettingView */ = {
isa = PBXGroup;
children = (
27FE98082B3DD536000AD654 /* SettingView.swift */,
27FE980C2B3DD749000AD654 /* Tabs */,
);
path = SettingView;
sourceTree = "<group>";
};
27FE980C2B3DD749000AD654 /* Tabs */ = {
isa = PBXGroup;
children = (
278540332B3DE04F004E9488 /* GeneralTab.swift */,
276742042B3DC230002A2C75 /* PrivacyTab.swift */,
276742052B3DC230002A2C75 /* AboutTab.swift */,
);
path = Tabs;
sourceTree = "<group>";
};
6220AD582A8280E800BBFB52 /* Bing */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -2394,6 +2457,7 @@
03008B2B2940D3230062B821 /* EZDeepLTranslate.m in Sources */,
03991166292A8A4400E1B06D /* EZTitleBarMoveView.m in Sources */,
03542A582937CC3200C34C33 /* EZConfiguration.m in Sources */,
27FE98092B3DD536000AD654 /* SettingView.swift in Sources */,
035E37E72A0953120061DFAF /* EZToast.m in Sources */,
03542A492937B5CF00C34C33 /* EZGoogleTranslate.m in Sources */,
03D0435A2928C4C800E7559E /* EZWindowManager.m in Sources */,
Expand Down Expand Up @@ -2427,8 +2491,11 @@
03BD2825294875AE00F5891A /* EZMyLabel.m in Sources */,
03B0233029231FA6001C7E63 /* MMCrashUncaughtExceptionHandler.m in Sources */,
03D5FCFF2A5EF4E400AD26BE /* EZDeviceSystemInfo.m in Sources */,
27FE95272B3DC55F000AD654 /* EasydictApp.swift in Sources */,
03882F9129D95044005B5A52 /* CTCommon.m in Sources */,
276742082B3DC230002A2C75 /* PrivacyTab.swift in Sources */,
03882F8F29D95044005B5A52 /* CTScreen.m in Sources */,
27FE980B2B3DD5D1000AD654 /* MenuItemView.swift in Sources */,
03DC7C6A2A3CA852000BF7C9 /* EZAppCell.m in Sources */,
0399C6AC29A860AA00B4AFCC /* EZOpenAIService.m in Sources */,
03542A432937B45E00C34C33 /* EZBaiduTranslate.m in Sources */,
Expand All @@ -2439,6 +2506,7 @@
03CF88632B137F650030C199 /* Array+Convenience.swift in Sources */,
03B0231229231FA6001C7E63 /* NSObject+DarkMode.m in Sources */,
03B0233829231FA6001C7E63 /* MMOrderedDictionary.m in Sources */,
278540342B3DE04F004E9488 /* GeneralTab.swift in Sources */,
03BDA7BC2A26DA280079D04F /* XPMArgumentSignature.m in Sources */,
03B0230229231FA6001C7E63 /* EZWordResultView.m in Sources */,
0399C6A529A747E600B4AFCC /* EZDeepLTranslateResponse.m in Sources */,
Expand Down Expand Up @@ -2510,6 +2578,7 @@
03BB2DE329F5772F00447EDD /* EZAudioButton.m in Sources */,
03262C2529EFE97B00EFECA0 /* NSViewController+EZWindow.m in Sources */,
03008B2729408BF50062B821 /* NSObject+EZDarkMode.m in Sources */,
27FE98052B3DCB09000AD654 /* NewAppManager.swift in Sources */,
0399116A292AA2EF00E1B06D /* EZLayoutManager.m in Sources */,
0320C5872B29F35700861B3D /* QueryServiceRecord.swift in Sources */,
03B022FA29231FA6001C7E63 /* EZServiceTypes.m in Sources */,
Expand Down Expand Up @@ -2545,6 +2614,7 @@
039F5508294B6E29004AB940 /* EZAboutViewController.m in Sources */,
03D8A6592A42A1A300D9A968 /* EZAppModel.m in Sources */,
036E7D7B293F4FC8002675DF /* EZOpenLinkButton.m in Sources */,
276742092B3DC230002A2C75 /* AboutTab.swift in Sources */,
03008B2E2941956D0062B821 /* EZURLSchemeHandler.m in Sources */,
DC6D9C872B352EBC0055EFFC /* FontSizeHintView.swift in Sources */,
03B0232429231FA6001C7E63 /* NSUserDefaults+MM.m in Sources */,
Expand All @@ -2553,7 +2623,7 @@
03D2A3E329F4C6F50035CED4 /* EZNetworkManager.m in Sources */,
0309E1ED292B439A00AFB76A /* EZTextView.m in Sources */,
03B0232B29231FA6001C7E63 /* NSMutableAttributedString+MM.m in Sources */,
03B022E829231FA6001C7E63 /* main.m in Sources */,
03B022E829231FA6001C7E63 /* entry.m in Sources */,
039F5504294B6E29004AB940 /* EZPreferencesWindowController.m in Sources */,
03008B3F29444B0A0062B821 /* NSView+EZAnimatedHidden.m in Sources */,
03B022FD29231FA6001C7E63 /* EZFixedQueryWindow.m in Sources */,
Expand Down Expand Up @@ -2916,6 +2986,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.izual.Easydict-debug";
PRODUCT_MODULE_NAME = Easydict;
PRODUCT_NAME = "Easydict-debug";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "Easydict/App/Easydict-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand Down Expand Up @@ -2954,6 +3025,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.izual.Easydict;
PRODUCT_MODULE_NAME = Easydict;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited)";
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_OBJC_BRIDGING_HEADER = "Easydict/App/Easydict-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand Down
6 changes: 5 additions & 1 deletion Easydict/App/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#import "AppDelegate+EZURLScheme.h"
#import <Sparkle/SPUUpdaterDelegate.h>
#import <Sparkle/SPUStandardUserDriverDelegate.h>
#import "Easydict-Swift.h"

@interface AppDelegate () <SPUUpdaterDelegate, SPUStandardUserDriverDelegate>

Expand All @@ -35,7 +36,10 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {

[self setupAppLanguage];

[EZMenuItemManager.shared setup];
if (!EasydictNewAppManager.shared.enable) {
[EZMenuItemManager.shared setup];
}

[EZShortcut setup];

[EZWindowManager.shared showMainWindowIfNedded];
Expand Down
15 changes: 14 additions & 1 deletion Easydict/App/Easydict-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,21 @@
//

#import "MMLog.h"

#import "EZQueryService.h"
#import "EZConstKey.h"
#import "NSString+EZChineseText.h"
#import "EZError.h"
#import "EZConst.h"
#import "EZSettingViewController.h"
#import "EZAboutViewController.h"
#import "EZServiceViewController.h"
#import "EZPrivacyViewController.h"
#import "EZDisableAutoSelectTextViewController.h"

#import "EZMenuItemManager.h"
#import "NSImage+MM.h"
#import "NSColor+MyColors.h"

#import "entry.h"
#import "AppDelegate.h"
#import "EZConfiguration.h"
69 changes: 69 additions & 0 deletions Easydict/App/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,16 @@
}
}
},
"beta_new_app" : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "[Beta] SwiftUI App模式"
}
}
}
},
"bing_translate" : {
"localizations" : {
"en" : {
Expand Down Expand Up @@ -464,6 +474,16 @@
}
}
},
"check_updates" : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "检查更新"
}
}
}
},
"chinese_phonetic" : {
"localizations" : {
"en" : {
Expand Down Expand Up @@ -782,6 +802,22 @@
}
}
},
"Easydict" : {

},
"Easydict 🍃" : {

},
"enable_beta_new_app" : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "以 SwiftUI App模式启动,重启App生效"
}
}
}
},
"equal_first_and_second_language" : {
"localizations" : {
"en" : {
Expand Down Expand Up @@ -1657,6 +1693,16 @@
}
}
},
"other" : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "其他"
}
}
}
},
"Parameter Error" : {
"comment" : "Error description",
"localizations" : {
Expand Down Expand Up @@ -1909,6 +1955,16 @@
}
}
},
"quit" : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "退出"
}
}
}
},
"replace_text" : {
"localizations" : {
"en" : {
Expand Down Expand Up @@ -2022,6 +2078,16 @@
}
}
},
"Settings..." : {
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
"state" : "translated",
"value" : "设置..."
}
}
}
},
"shortcut_select_translate_window_type" : {
"localizations" : {
"en" : {
Expand Down Expand Up @@ -2291,6 +2357,9 @@
}
}
}
},
"Tisfeng" : {

},
"toggle_languages" : {
"localizations" : {
Expand Down
9 changes: 9 additions & 0 deletions Easydict/App/entry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//
// entry.h
// Easydict
//
// Created by Kyle on 2023/12/28.
// Copyright © 2023 izual. All rights reserved.
//

void parseArmguments(void);
24 changes: 0 additions & 24 deletions Easydict/App/main.m → Easydict/App/entry.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,27 +72,3 @@ void parseArmguments(void) {
printf(" %s Query text\n", [[queryTextSig descriptionForHelpWithIndent:2 terminalWidth:(NSUInteger)ws.ws_col] UTF8String]);
}
}

int main(int argc, const char *argv[]) {
@autoreleasepool {
// Setup code that might create autoreleased objects goes here.

NSMutableArray<NSString *> *arguments = [NSMutableArray array];

// easydict -query
for (int i = 0; i < argc; i++) {
NSString *argument = [NSString stringWithUTF8String:argv[i]];
[arguments addObject:argument];
// printf("Argument %d: %s\n", i, argv[i]);
}

NSLog(@"arguments: %@", arguments);

// MyArgumentParser *argumentParser = [[MyArgumentParser alloc] init];
// [argumentParser runAndReturnError:nil];

parseArmguments();
}

return NSApplicationMain(argc, argv);
}
Loading

0 comments on commit 89bc797

Please sign in to comment.