From f763b901a51f900f849bfe6db08bcd7d9774b18c Mon Sep 17 00:00:00 2001 From: Pankaj Date: Wed, 27 Apr 2022 18:25:38 +0530 Subject: [PATCH 1/7] Updated Code to replace UIWebView with WkWebView Signed-off-by: Pankaj --- EvernoteSDK.podspec | 2 +- EvernoteSDK/Info.plist | 15 + .../project.pbxproj | 58 +++- .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../3rdparty/SVProgressHUD/SVProgressHUD.m | 16 +- .../EvernoteSDKSample/AppDelegate.m | 3 +- .../AppIcon.appiconset/Contents.json | 43 +-- .../EvernoteSDKSample/CommonUtils.m | 7 +- .../EvernoteSDKSample.entitlements | 10 + .../EvernoteSDKSample/Info.plist | 4 + .../EvernoteSDKSample/MainViewController.m | 20 +- .../NoteDetailViewController.m | 25 +- .../NoteListResultViewController.m | 8 +- .../NotebooksViewController.m | 14 +- .../SaveActivityViewController.m | 5 +- .../TagsInfoViewController.m | 16 +- README.md | 2 +- evernote-cloud-sdk-ios.podspec | 2 +- evernote-sdk-ios.xcodeproj/project.pbxproj | 50 ++- .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../ENSDK/Advanced/ENNoteStoreClient.h | 6 +- .../ENSDK/Advanced/ENNoteStoreClient.m | 6 +- .../ENSDK/Advanced/ENUserStoreClient.h | 2 +- .../ENSDK/Advanced/ENUserStoreClient.m | 2 +- .../Utilities/ENMLWriter/ENMIMEUtils.m | 4 - evernote-sdk-ios/ENSDK/ENCommonUtils.h | 4 +- evernote-sdk-ios/ENSDK/ENNote.h | 11 +- evernote-sdk-ios/ENSDK/ENNote.m | 4 +- evernote-sdk-ios/ENSDK/ENNoteContent.h | 2 +- .../ENSDK/Private/ENOAuthViewController.h | 1 + .../ENSDK/Private/ENOAuthViewController.m | 44 ++- .../ENSDK/Private/ENStoreClient.h | 8 +- .../ENSDK/Private/ENWebClipNoteBuilder.h | 3 +- .../ENSDK/Private/ENWebClipNoteBuilder.m | 286 +++++++++--------- .../ENSaveToEvernoteViewController.h | 1 + .../ENSaveToEvernoteViewController.m | 6 +- 36 files changed, 424 insertions(+), 282 deletions(-) create mode 100644 EvernoteSDKSample/EvernoteSDKSample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 EvernoteSDKSample/EvernoteSDKSample/EvernoteSDKSample.entitlements create mode 100644 evernote-sdk-ios.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/EvernoteSDK.podspec b/EvernoteSDK.podspec index cce9a8e..2538212 100644 --- a/EvernoteSDK.podspec +++ b/EvernoteSDK.podspec @@ -14,6 +14,6 @@ Pod::Spec.new do |spec| spec.resource = "ENSDKResources.bundle" spec.requires_arc = true - spec.framework = "MobileCoreServices", "CoreGraphics", "Foundation", "UIKit" + spec.framework = "CoreServices", "CoreGraphics", "Foundation", "UIKit", "WebKit" spec.library = "xml2" end diff --git a/EvernoteSDK/Info.plist b/EvernoteSDK/Info.plist index fbe1e6b..d4dafec 100644 --- a/EvernoteSDK/Info.plist +++ b/EvernoteSDK/Info.plist @@ -20,5 +20,20 @@ $(CURRENT_PROJECT_VERSION) NSPrincipalClass + CFBundleURLTypes + + + CFBundleURLName + + CFBundleURLSchemes + + en-msinghal-2705 + + + + LSApplicationQueriesSchemes + + en + diff --git a/EvernoteSDKSample/EvernoteSDKSample.xcodeproj/project.pbxproj b/EvernoteSDKSample/EvernoteSDKSample.xcodeproj/project.pbxproj index 1833433..177f17f 100644 --- a/EvernoteSDKSample/EvernoteSDKSample.xcodeproj/project.pbxproj +++ b/EvernoteSDKSample/EvernoteSDKSample.xcodeproj/project.pbxproj @@ -11,7 +11,6 @@ 030DA2F81E27BCF700FD4BDB /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 030DA2F71E27BCF700FD4BDB /* AppDelegate.m */; }; 030DA3001E27BCF700FD4BDB /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 030DA2FF1E27BCF700FD4BDB /* Assets.xcassets */; }; 030DA3031E27BCF700FD4BDB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 030DA3011E27BCF700FD4BDB /* LaunchScreen.storyboard */; }; - 030DA3211E27BD4700FD4BDB /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 030DA3201E27BD4700FD4BDB /* MobileCoreServices.framework */; }; 030DA3231E27BD5100FD4BDB /* libxml2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 030DA3221E27BD5100FD4BDB /* libxml2.tbd */; }; 030DA3361E27BDB700FD4BDB /* CommonUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 030DA3251E27BDB700FD4BDB /* CommonUtils.m */; }; 030DA3371E27BDB700FD4BDB /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 030DA3271E27BDB700FD4BDB /* MainViewController.m */; }; @@ -26,6 +25,8 @@ 030DA3461E27BEEE00FD4BDB /* LICENSE.txt in Resources */ = {isa = PBXBuildFile; fileRef = 030DA3421E27BEEE00FD4BDB /* LICENSE.txt */; }; 030DA3471E27BEEE00FD4BDB /* SVProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = 030DA3441E27BEEE00FD4BDB /* SVProgressHUD.m */; }; 038EE1E11E27C1A800595956 /* EvernoteSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 038EE1E01E27C18800595956 /* EvernoteSDK.framework */; }; + 27F202F82433958F00A535EA /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27F202F72433958F00A535EA /* CoreServices.framework */; }; + 4E6D597A28056D6700634EC4 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E6D597628056D6700634EC4 /* WebKit.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -60,7 +61,6 @@ 030DA2FF1E27BCF700FD4BDB /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 030DA3021E27BCF700FD4BDB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 030DA3041E27BCF700FD4BDB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 030DA3201E27BD4700FD4BDB /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; 030DA3221E27BD5100FD4BDB /* libxml2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libxml2.tbd; path = usr/lib/libxml2.tbd; sourceTree = SDKROOT; }; 030DA3241E27BDB700FD4BDB /* CommonUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonUtils.h; sourceTree = ""; }; 030DA3251E27BDB700FD4BDB /* CommonUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommonUtils.m; sourceTree = ""; }; @@ -85,6 +85,9 @@ 030DA3431E27BEEE00FD4BDB /* SVProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVProgressHUD.h; sourceTree = ""; }; 030DA3441E27BEEE00FD4BDB /* SVProgressHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SVProgressHUD.m; sourceTree = ""; }; 038EE1D51E27C18800595956 /* evernote-sdk-ios.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "evernote-sdk-ios.xcodeproj"; path = "../../evernote-sdk-ios.xcodeproj"; sourceTree = ""; }; + 27F202F72433958F00A535EA /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; }; + 4E6D597628056D6700634EC4 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; }; + 4EE007B0281192F3007E4A1B /* EvernoteSDKSample.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = EvernoteSDKSample.entitlements; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -92,8 +95,9 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 4E6D597A28056D6700634EC4 /* WebKit.framework in Frameworks */, 038EE1E11E27C1A800595956 /* EvernoteSDK.framework in Frameworks */, - 030DA3211E27BD4700FD4BDB /* MobileCoreServices.framework in Frameworks */, + 27F202F82433958F00A535EA /* CoreServices.framework in Frameworks */, 030DA3231E27BD5100FD4BDB /* libxml2.tbd in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -121,6 +125,7 @@ 030DA2F21E27BCF700FD4BDB /* EvernoteSDKSample */ = { isa = PBXGroup; children = ( + 4EE007B0281192F3007E4A1B /* EvernoteSDKSample.entitlements */, 038EE1D51E27C18800595956 /* evernote-sdk-ios.xcodeproj */, 030DA33F1E27BEEE00FD4BDB /* 3rdparty */, 030DA2F61E27BCF700FD4BDB /* AppDelegate.h */, @@ -162,8 +167,9 @@ 030DA31F1E27BD4700FD4BDB /* Frameworks */ = { isa = PBXGroup; children = ( + 4E6D597628056D6700634EC4 /* WebKit.framework */, + 27F202F72433958F00A535EA /* CoreServices.framework */, 030DA3221E27BD5100FD4BDB /* libxml2.tbd */, - 030DA3201E27BD4700FD4BDB /* MobileCoreServices.framework */, ); name = Frameworks; sourceTree = ""; @@ -223,19 +229,19 @@ 030DA2E81E27BCF700FD4BDB /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0820; + LastUpgradeCheck = 1330; ORGANIZATIONNAME = Evernote; TargetAttributes = { 030DA2EF1E27BCF700FD4BDB = { CreatedOnToolsVersion = 8.2; - DevelopmentTeam = Q79WDW8YH9; + DevelopmentTeam = 35CHVC8T8P; ProvisioningStyle = Automatic; }; }; }; buildConfigurationList = 030DA2EB1E27BCF700FD4BDB /* Build configuration list for PBXProject "EvernoteSDKSample" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -333,20 +339,30 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 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_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 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_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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; @@ -369,7 +385,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.2; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -380,20 +396,30 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 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_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 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_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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; @@ -410,7 +436,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.2; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; @@ -421,11 +447,16 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = Q79WDW8YH9; + CODE_SIGN_ENTITLEMENTS = EvernoteSDKSample/EvernoteSDKSample.entitlements; + CODE_SIGN_IDENTITY = "Apple Development: msinghal@evernote.com (6C9PM75963)"; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; + DEVELOPMENT_TEAM = 35CHVC8T8P; INFOPLIST_FILE = EvernoteSDKSample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.evernote.EvernoteSDKSample; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTS_MACCATALYST = NO; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; @@ -433,11 +464,16 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = Q79WDW8YH9; + CODE_SIGN_ENTITLEMENTS = EvernoteSDKSample/EvernoteSDKSample.entitlements; + CODE_SIGN_IDENTITY = "Apple Development: msinghal@evernote.com (6C9PM75963)"; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; + DEVELOPMENT_TEAM = 35CHVC8T8P; INFOPLIST_FILE = EvernoteSDKSample/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.evernote.EvernoteSDKSample; PRODUCT_NAME = "$(TARGET_NAME)"; + SUPPORTS_MACCATALYST = NO; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; diff --git a/EvernoteSDKSample/EvernoteSDKSample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/EvernoteSDKSample/EvernoteSDKSample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/EvernoteSDKSample/EvernoteSDKSample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/EvernoteSDKSample/EvernoteSDKSample/3rdparty/SVProgressHUD/SVProgressHUD.m b/EvernoteSDKSample/EvernoteSDKSample/3rdparty/SVProgressHUD/SVProgressHUD.m index b2b62ae..cb32554 100755 --- a/EvernoteSDKSample/EvernoteSDKSample/3rdparty/SVProgressHUD/SVProgressHUD.m +++ b/EvernoteSDKSample/EvernoteSDKSample/3rdparty/SVProgressHUD/SVProgressHUD.m @@ -53,7 +53,6 @@ @interface SVProgressHUD () @property (nonatomic, readonly) CGFloat visibleKeyboardHeight; @property (nonatomic, assign) UIOffset offsetFromCenter; - - (void)showProgress:(float)progress status:(NSString*)string maskType:(SVProgressHUDMaskType)hudMaskType; @@ -331,7 +330,7 @@ - (void)setStatus:(NSString *)string { - (void)setFadeOutTimer:(NSTimer *)newTimer { if(_fadeOutTimer) - [_fadeOutTimer invalidate], _fadeOutTimer = nil; + (void)([_fadeOutTimer invalidate]), _fadeOutTimer = nil; if(newTimer) _fadeOutTimer = newTimer; @@ -611,14 +610,14 @@ - (void)dismiss { [[NSNotificationCenter defaultCenter] removeObserver:self]; [self cancelRingLayerAnimation]; - [_hudView removeFromSuperview]; - _hudView = nil; + [self->_hudView removeFromSuperview]; + self->_hudView = nil; - [_overlayView removeFromSuperview]; - _overlayView = nil; + [self->_overlayView removeFromSuperview]; + self->_overlayView = nil; - [_indefiniteAnimatedLayer removeFromSuperlayer]; - _indefiniteAnimatedLayer = nil; + [self->_indefiniteAnimatedLayer removeFromSuperlayer]; + self->_indefiniteAnimatedLayer = nil; UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, nil); @@ -767,6 +766,7 @@ - (CAShapeLayer *)createRingLayerWithCenter:(CGPoint)center radius:(CGFloat)radi #pragma mark - Utilities + (BOOL)isVisible { + //DispatchQueue.main.async { return ([self sharedView].alpha == 1); } diff --git a/EvernoteSDKSample/EvernoteSDKSample/AppDelegate.m b/EvernoteSDKSample/EvernoteSDKSample/AppDelegate.m index 8bf0ef9..867b4a9 100644 --- a/EvernoteSDKSample/EvernoteSDKSample/AppDelegate.m +++ b/EvernoteSDKSample/EvernoteSDKSample/AppDelegate.m @@ -22,6 +22,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( #warning Add Consumer Key and Consumer Secret, but also modify your app's Info.plist according to documentation! #warning Remove these warnings once done with it. + // Set shared session key information. [ENSession setSharedSessionConsumerKey:@"your_consumer_key" consumerSecret:@"your_consumer_secret" @@ -38,7 +39,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( return YES; } -- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation +- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary *)options { return [[ENSession sharedSession] handleOpenURL:url]; } diff --git a/EvernoteSDKSample/EvernoteSDKSample/Assets.xcassets/AppIcon.appiconset/Contents.json b/EvernoteSDKSample/EvernoteSDKSample/Assets.xcassets/AppIcon.appiconset/Contents.json index b8236c6..8121323 100644 --- a/EvernoteSDKSample/EvernoteSDKSample/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/EvernoteSDKSample/EvernoteSDKSample/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -2,47 +2,52 @@ "images" : [ { "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" + "scale" : "2x", + "size" : "20x20" }, { "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" + "scale" : "3x", + "size" : "20x20" }, { "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" + "scale" : "2x", + "size" : "29x29" }, { "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" + "scale" : "3x", + "size" : "29x29" }, { "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" + "scale" : "2x", + "size" : "40x40" }, { "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" + "scale" : "3x", + "size" : "40x40" }, { "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" + "scale" : "2x", + "size" : "60x60" }, { "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/EvernoteSDKSample/EvernoteSDKSample/CommonUtils.m b/EvernoteSDKSample/EvernoteSDKSample/CommonUtils.m index acde1e1..05441e2 100644 --- a/EvernoteSDKSample/EvernoteSDKSample/CommonUtils.m +++ b/EvernoteSDKSample/EvernoteSDKSample/CommonUtils.m @@ -12,12 +12,15 @@ @implementation CommonUtils + (void)showSimpleAlertWithMessage:(NSString *)message { - UIAlertView * alert = [[UIAlertView alloc] initWithTitle:nil + UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:message preferredStyle:UIAlertControllerStyleAlert]; + [alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]]; + [[[UIApplication sharedApplication] keyWindow].rootViewController presentViewController:alert animated:YES completion:nil]; + /*UIAlertView * alert = [[UIAlertView alloc] initWithTitle:nil message:message delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", nil]; - [alert show]; + [alert show];*/ } @end diff --git a/EvernoteSDKSample/EvernoteSDKSample/EvernoteSDKSample.entitlements b/EvernoteSDKSample/EvernoteSDKSample/EvernoteSDKSample.entitlements new file mode 100644 index 0000000..ee95ab7 --- /dev/null +++ b/EvernoteSDKSample/EvernoteSDKSample/EvernoteSDKSample.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + + diff --git a/EvernoteSDKSample/EvernoteSDKSample/Info.plist b/EvernoteSDKSample/EvernoteSDKSample/Info.plist index b8901ee..cb568bd 100644 --- a/EvernoteSDKSample/EvernoteSDKSample/Info.plist +++ b/EvernoteSDKSample/EvernoteSDKSample/Info.plist @@ -4,6 +4,8 @@ CFBundleDevelopmentRegion en + CFBundleDisplayName + EvernoteSDKSample CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -18,6 +20,8 @@ 1.0 CFBundleVersion 1 + LSApplicationCategoryType + public.app-category.business LSRequiresIPhoneOS UILaunchStoryboardName diff --git a/EvernoteSDKSample/EvernoteSDKSample/MainViewController.m b/EvernoteSDKSample/EvernoteSDKSample/MainViewController.m index 4464eba..689d185 100644 --- a/EvernoteSDKSample/EvernoteSDKSample/MainViewController.m +++ b/EvernoteSDKSample/EvernoteSDKSample/MainViewController.m @@ -31,9 +31,10 @@ kSampleFunctionsMaxValue }; -@interface MainViewController () +@interface MainViewController () + @property (nonatomic, strong) UITableView * tableView; -@property (nonatomic, strong) UIWebView * webView; +@property (nonatomic, strong) WKWebView * webView; @property (nonatomic, strong) UIBarButtonItem * loginItem; @end @@ -236,7 +237,8 @@ - (void)showAlertToClipWebPage { UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]; [clipController addAction:clipAction]; [clipController addAction:dismissAction]; - [self presentViewController:clipController animated:YES completion:nil]; + [[[UIApplication sharedApplication] keyWindow].rootViewController presentViewController:clipController animated:YES completion:nil]; + //[self presentViewController:clipController animated:YES completion:nil]; } - (void)loadWebViewWithURLString:(NSString *)urlString { @@ -246,15 +248,15 @@ - (void)loadWebViewWithURLString:(NSString *)urlString { return; } - self.webView = [[UIWebView alloc] initWithFrame:self.view.window.bounds]; - self.webView.delegate = self; + self.webView = [[WKWebView alloc] initWithFrame:self.view.window.bounds]; + self.webView.navigationDelegate = self; [SVProgressHUD showWithMaskType:SVProgressHUDMaskTypeBlack]; [self.webView loadRequest:[NSURLRequest requestWithURL:urlToClip]]; } - (void)clipWebPage { - UIWebView * webView = self.webView; - self.webView.delegate = nil; + WKWebView * webView = self.webView; + self.webView.navigationDelegate = nil; [self.webView stopLoading]; self.webView = nil; @@ -342,7 +344,7 @@ - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker #pragma mark - UIWebViewDelegate -- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error +- (void)webView:(WKWebView *)webView didFailNavigation:(WKNavigation *)navigation withError:(NSError *)error { [NSObject cancelPreviousPerformRequestsWithTarget:self selector:@selector(clipWebPage) object:nil]; NSLog(@"Web view fail: %@", error); @@ -351,7 +353,7 @@ - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error [CommonUtils showSimpleAlertWithMessage:@"Failed to load web page to clip."]; } -- (void)webViewDidFinishLoad:(UIWebView *)webView +- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation; { // At the end of every load complete, cancel a pending perform and start a new one. We wait for 3 // seconds for the page to "settle down" diff --git a/EvernoteSDKSample/EvernoteSDKSample/NoteDetailViewController.m b/EvernoteSDKSample/EvernoteSDKSample/NoteDetailViewController.m index e7373c5..1929ec0 100644 --- a/EvernoteSDKSample/EvernoteSDKSample/NoteDetailViewController.m +++ b/EvernoteSDKSample/EvernoteSDKSample/NoteDetailViewController.m @@ -11,8 +11,8 @@ #import "SVProgressHUD.h" #import "CommonUtils.h" -@interface NoteDetailViewController () -@property (nonatomic, strong) UIWebView * webView; +@interface NoteDetailViewController () +@property (nonatomic, strong) WKWebView * webView; @property (nonatomic, assign) BOOL doneLoading; @property (nonatomic, strong) ENNote *note; @end @@ -22,8 +22,8 @@ @implementation NoteDetailViewController - (void)loadView { [super loadView]; - self.webView = [[UIWebView alloc] initWithFrame:self.view.bounds]; - self.webView.delegate = self; + self.webView = [[WKWebView alloc] initWithFrame:self.view.bounds]; + self.webView.navigationDelegate = self; [self.view addSubview:self.webView]; } @@ -66,7 +66,8 @@ - (void)loadWebDataFromNote:(ENNote *)note [SVProgressHUD dismiss]; [self.webView loadData:data MIMEType:ENWebArchiveDataMIMEType - textEncodingName:nil + //textEncodingName:nil + characterEncodingName:nil baseURL:nil]; }]; } @@ -89,16 +90,18 @@ - (void)viewInEvernote { [CommonUtils showSimpleAlertWithMessage:@"Evernote App not installed"]; } } - -- (void)webViewDidFinishLoad:(UIWebView *)webView +- (void)webView:(WKWebView *)webView +didFinishNavigation:(WKNavigation *)navigation { self.doneLoading = YES; } -- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType; -{ - // Don't allow user to navigate from here. - return !self.doneLoading; +- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler { + if(!self.doneLoading){ + decisionHandler(WKNavigationActionPolicyAllow); + }else{ + decisionHandler(WKNavigationActionPolicyCancel); +} } @end diff --git a/EvernoteSDKSample/EvernoteSDKSample/NoteListResultViewController.m b/EvernoteSDKSample/EvernoteSDKSample/NoteListResultViewController.m index 4dce406..6ad32c1 100644 --- a/EvernoteSDKSample/EvernoteSDKSample/NoteListResultViewController.m +++ b/EvernoteSDKSample/EvernoteSDKSample/NoteListResultViewController.m @@ -52,7 +52,10 @@ - (void)viewDidLoad sortOrder:ENSessionSortOrderRecentlyCreated maxResults:0 completion:^(NSArray *findNotesResults, NSError *findNotesError) { - [SVProgressHUD dismiss]; + dispatch_async(dispatch_get_main_queue(), ^{ + [SVProgressHUD dismiss]; + }); + dispatch_async(dispatch_get_main_queue(), ^{ if (!findNotesResults) { if ([findNotesError.domain isEqualToString:ENErrorDomain] && findNotesError.code == ENErrorCodePermissionDenied) { @@ -67,7 +70,8 @@ - (void)viewDidLoad self.findNotesResults = findNotesResults; [self.tableView reloadData]; } - }]; + }); +}]; } #pragma mark - UITableView diff --git a/EvernoteSDKSample/EvernoteSDKSample/NotebooksViewController.m b/EvernoteSDKSample/EvernoteSDKSample/NotebooksViewController.m index e10463a..5196eef 100644 --- a/EvernoteSDKSample/EvernoteSDKSample/NotebooksViewController.m +++ b/EvernoteSDKSample/EvernoteSDKSample/NotebooksViewController.m @@ -108,20 +108,22 @@ - (void)showAlertToEnterNotebookName { notebookToCreate.name = notebookName; if (weakSelf.creatingBusinessNotebook) { - [[ENSession sharedSession].businessNoteStore createBusinessNotebook:notebookToCreate success:^(EDAMLinkedNotebook *notebook) { + [[ENSession sharedSession].businessNoteStore createBusinessNotebook:notebookToCreate completion:^(EDAMLinkedNotebook *notebook,NSError *error) { + if(notebook){ NSLog(@"Successfully created business notebook %@", notebook); [weakSelf reloadNotebooks]; - } failure:^(NSError *error) { + } else { NSLog(@"Failed to create the notebook with error %@", error); - }]; + }}]; weakSelf.creatingBusinessNotebook = NO; } else { - [[ENSession sharedSession].primaryNoteStore createNotebook:notebookToCreate success:^(EDAMNotebook *notebook) { +[[ENSession sharedSession].primaryNoteStore createNotebook:notebookToCreate completion:^(EDAMNotebook *notebook,NSError *error) { + if(notebook){ NSLog(@"Successfully created personal notebook %@", notebook); [weakSelf reloadNotebooks]; - } failure:^(NSError *error) { + } else{ NSLog(@"Failed to create the notebook with error %@", error); - }]; + }}]; } }]; UIAlertAction *dismissAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]; diff --git a/EvernoteSDKSample/EvernoteSDKSample/SaveActivityViewController.m b/EvernoteSDKSample/EvernoteSDKSample/SaveActivityViewController.m index 8e03288..6a55ee8 100644 --- a/EvernoteSDKSample/EvernoteSDKSample/SaveActivityViewController.m +++ b/EvernoteSDKSample/EvernoteSDKSample/SaveActivityViewController.m @@ -52,7 +52,10 @@ - (void)action:(id)sender #pragma ENSaveToEvernoteActivityDelegate - (void)activity:(ENSaveToEvernoteActivity *)activity didFinishWithSuccess:(BOOL)success error:(NSError *)error { if (success) { - [[[UIAlertView alloc] initWithTitle:@"Success" message:@"Saved to Evernote!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil] show]; + + UIAlertController *alert = [UIAlertController alertControllerWithTitle:nil message:@"Saved to Evernote" preferredStyle:UIAlertControllerStyleAlert]; + [alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]]; + [[[UIApplication sharedApplication] keyWindow].rootViewController presentViewController:alert animated:YES completion:nil]; } else { NSLog(@"Activity Error: %@", error); } diff --git a/EvernoteSDKSample/EvernoteSDKSample/TagsInfoViewController.m b/EvernoteSDKSample/EvernoteSDKSample/TagsInfoViewController.m index da7dec3..4f20ec0 100644 --- a/EvernoteSDKSample/EvernoteSDKSample/TagsInfoViewController.m +++ b/EvernoteSDKSample/EvernoteSDKSample/TagsInfoViewController.m @@ -28,29 +28,31 @@ - (void)viewDidLoad NSMutableString * str = [NSMutableString string]; [self.textView setText:str]; - - [[ENSession sharedSession].primaryNoteStore listTagsWithSuccess:^(NSArray *tags) { + + [[ENSession sharedSession].primaryNoteStore listTagsWithCompletion:^(NSArray *tags,NSError *error) { + if(tags){ [str appendString:@"Personal Tags:\n"]; for (EDAMTag *tag in tags) { [str appendFormat:@"%@\n", tag.name]; } [str appendString:@"\n"]; [self.textView setText:str]; - } failure:^(NSError *error) { + } else { NSLog(@"Error in fetching personal tags %@", error); - }]; + }}]; if ([[ENSession sharedSession] isBusinessUser]) { - [[ENSession sharedSession].businessNoteStore listTagsWithSuccess:^(NSArray *tags) { + [[ENSession sharedSession].businessNoteStore listTagsWithCompletion:^(NSArray *tags,NSError *error) { + if(tags){ [str appendString:@"Business Tags:\n"]; for (EDAMTag *tag in tags) { [str appendFormat:@"%@\n", tag.name]; } [str appendString:@"\n"]; [self.textView setText:str]; - } failure:^(NSError *error) { + } else { NSLog(@"Error in fetching business tags %@", error); - }]; + }}]; } } diff --git a/README.md b/README.md index a84a1f0..27caa2c 100755 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Drag & Drop `evernote-sdk-ios.xcodeproj` into your project. Now open your target's `Build Phases` and add the following items to your `Link Binary With Libraries` section: - EvernoteSDKiOS.framework -- MobileCoreServices.framework +- CoreServices.framework - libxml2.dylib ## Configuration diff --git a/evernote-cloud-sdk-ios.podspec b/evernote-cloud-sdk-ios.podspec index 1a594b7..ba93fa9 100644 --- a/evernote-cloud-sdk-ios.podspec +++ b/evernote-cloud-sdk-ios.podspec @@ -14,7 +14,7 @@ Pod::Spec.new do |spec| spec.resource = "ENSDKResources.bundle" spec.requires_arc = true - spec.framework = "MobileCoreServices", "CoreGraphics", "Foundation", "UIKit" + spec.framework = "CoreServices", "CoreGraphics", "Foundation", "UIKit" spec.library = "xml2" spec.deprecated_in_favor_of = "EvernoteSDK" diff --git a/evernote-sdk-ios.xcodeproj/project.pbxproj b/evernote-sdk-ios.xcodeproj/project.pbxproj index 868f4ce..de824a3 100755 --- a/evernote-sdk-ios.xcodeproj/project.pbxproj +++ b/evernote-sdk-ios.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 0BB3D1B11524ED96001C4534 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0BB3D1B01524ED96001C4534 /* Foundation.framework */; }; + 27F202FB243395FD00A535EA /* CoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27F202FA243395FD00A535EA /* CoreServices.framework */; }; 6D9D5FFC1E23AC27001740D8 /* EDAMAuthenticationTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 6D9D5FFA1E23AC27001740D8 /* EDAMAuthenticationTypes.h */; settings = {ATTRIBUTES = (Public, ); }; }; 6D9D5FFD1E23AC27001740D8 /* EDAMAuthenticationTypes.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D9D5FFB1E23AC27001740D8 /* EDAMAuthenticationTypes.m */; }; 6D9D60BF1E279424001740D8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0BB3D1B01524ED96001C4534 /* Foundation.framework */; }; @@ -505,6 +506,7 @@ 0BB3D1B01524ED96001C4534 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 0BB3D1B41524ED96001C4534 /* evernote-sdk-ios-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "evernote-sdk-ios-Prefix.pch"; sourceTree = ""; }; 0BB3D24D1524EEF3001C4534 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 27F202FA243395FD00A535EA /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreServices.framework; sourceTree = DEVELOPER_DIR; }; 6D9D5FFA1E23AC27001740D8 /* EDAMAuthenticationTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EDAMAuthenticationTypes.h; sourceTree = ""; }; 6D9D5FFB1E23AC27001740D8 /* EDAMAuthenticationTypes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EDAMAuthenticationTypes.m; sourceTree = ""; }; 6D9D60B71E27940A001740D8 /* EvernoteSDK.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = EvernoteSDK.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -648,7 +650,6 @@ BE2E245A18EBA5D500BD7E6E /* ENSaveToEvernoteActivity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ENSaveToEvernoteActivity.h; sourceTree = ""; }; BE2E245B18EBA5D500BD7E6E /* ENSaveToEvernoteActivity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ENSaveToEvernoteActivity.m; sourceTree = ""; }; BE2E24E818EDD4A300BD7E6E /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; - BE2E25B018EDE1C100BD7E6E /* MobileCoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MobileCoreServices.framework; path = System/Library/Frameworks/MobileCoreServices.framework; sourceTree = SDKROOT; }; BE2E25D718F4D6C200BD7E6E /* ENMLConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ENMLConstants.h; sourceTree = ""; }; BE2E25D818F4D6C200BD7E6E /* ENMLConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ENMLConstants.m; sourceTree = ""; }; BE2E25DC18F4DCE600BD7E6E /* ENSDKPrivate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ENSDKPrivate.m; sourceTree = ""; }; @@ -709,6 +710,7 @@ buildActionMask = 2147483647; files = ( 6D9D61691E2796FC001740D8 /* libxml2.2.tbd in Frameworks */, + 27F202FB243395FD00A535EA /* CoreServices.framework in Frameworks */, 6D9D60BF1E279424001740D8 /* Foundation.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -758,8 +760,8 @@ 0BB3D1AF1524ED96001C4534 /* Frameworks */ = { isa = PBXGroup; children = ( + 27F202FA243395FD00A535EA /* CoreServices.framework */, 6D9D61681E2796FC001740D8 /* libxml2.2.tbd */, - BE2E25B018EDE1C100BD7E6E /* MobileCoreServices.framework */, A9BE476B1781FAFA00471BF7 /* libxml2.dylib */, 0BB3D1B01524ED96001C4534 /* Foundation.framework */, 0BB3D24D1524EEF3001C4534 /* UIKit.framework */, @@ -1427,7 +1429,7 @@ 0BB3D1A41524ED96001C4534 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0820; + LastUpgradeCheck = 1330; ORGANIZATIONNAME = "Evernote Corporation"; TargetAttributes = { 6D9D60B61E27940A001740D8 = { @@ -1439,7 +1441,7 @@ }; buildConfigurationList = 0BB3D1A71524ED96001C4534 /* Build configuration list for PBXProject "evernote-sdk-ios" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -1790,12 +1792,21 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 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_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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; @@ -1827,7 +1838,7 @@ GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; ONLY_ACTIVE_ARCH = YES; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; @@ -1839,12 +1850,21 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 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_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + 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; @@ -1868,7 +1888,7 @@ GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; @@ -1886,9 +1906,10 @@ GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; GCC_WARN_SHADOW = NO; HEADER_SEARCH_PATHS = "${SDKROOT}/usr/include/libxml2"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; SKIP_INSTALL = YES; }; name = Debug; @@ -1904,9 +1925,10 @@ GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_SHADOW = NO; HEADER_SEARCH_PATHS = "${SDKROOT}/usr/include/libxml2"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; SKIP_INSTALL = YES; }; name = Release; @@ -1923,7 +1945,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; @@ -1936,7 +1958,7 @@ HEADER_SEARCH_PATHS = "${SDKROOT}/usr/include/libxml2"; INFOPLIST_FILE = EvernoteSDK/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = YES; OTHER_LDFLAGS = "-ObjC"; @@ -1961,7 +1983,7 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -1977,7 +1999,7 @@ HEADER_SEARCH_PATHS = "${SDKROOT}/usr/include/libxml2"; INFOPLIST_FILE = EvernoteSDK/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; MTL_ENABLE_DEBUG_INFO = NO; OTHER_LDFLAGS = "-ObjC"; @@ -2023,7 +2045,7 @@ ); INFOPLIST_FILE = "ENSDK/ENSDK-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LIBRARY_SEARCH_PATHS = "$(inherited)"; LINK_WITH_STANDARD_LIBRARIES = NO; MACH_O_TYPE = mh_object; @@ -2069,7 +2091,7 @@ ); INFOPLIST_FILE = "ENSDK/ENSDK-Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; LIBRARY_SEARCH_PATHS = "$(inherited)"; LINK_WITH_STANDARD_LIBRARIES = NO; MACH_O_TYPE = mh_object; diff --git a/evernote-sdk-ios.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/evernote-sdk-ios.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/evernote-sdk-ios.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/evernote-sdk-ios/ENSDK/Advanced/ENNoteStoreClient.h b/evernote-sdk-ios/ENSDK/Advanced/ENNoteStoreClient.h index ee0ef1c..8efa7d0 100644 --- a/evernote-sdk-ios/ENSDK/Advanced/ENNoteStoreClient.h +++ b/evernote-sdk-ios/ENSDK/Advanced/ENNoteStoreClient.h @@ -962,7 +962,7 @@ DEPRECATED_MSG_ATTRIBUTE("Use -createTag:completion: instead") NS_SWIFT_UNAVAILA DEPRECATED_MSG_ATTRIBUTE("Use -updateTag:completion: instead") NS_SWIFT_UNAVAILABLE("Deprecated"); - (void)untagAllWithGuid:(EDAMGuid)guid - success:(void(^)())success + success:(void(^)(void))success failure:(void(^)(NSError *error))failure DEPRECATED_MSG_ATTRIBUTE("Use -untagAllWithGuid:completion: instead") NS_SWIFT_UNAVAILABLE("Deprecated"); @@ -1256,7 +1256,7 @@ DEPRECATED_MSG_ATTRIBUTE("Use -authenticateToSharedNotebook:completion: instead" DEPRECATED_MSG_ATTRIBUTE("Use -getSharedNotebookByAuthWithCompletion: instead") NS_SWIFT_UNAVAILABLE("Deprecated"); - (void)emailNoteWithParameters:(EDAMNoteEmailParameters *)parameters - success:(void(^)())success + success:(void(^)(void))success failure:(void(^)(NSError *error))failure DEPRECATED_MSG_ATTRIBUTE("Use -emailNoteWithParameters:completion: instead") NS_SWIFT_UNAVAILABLE("Deprecated"); @@ -1266,7 +1266,7 @@ DEPRECATED_MSG_ATTRIBUTE("Use -emailNoteWithParameters:completion: instead") NS_ DEPRECATED_MSG_ATTRIBUTE("Use -shareNoteWithGuid:completion: instead") NS_SWIFT_UNAVAILABLE("Deprecated"); - (void)stopSharingNoteWithGuid:(EDAMGuid)guid - success:(void(^)())success + success:(void(^)(void))success failure:(void(^)(NSError *error))failure DEPRECATED_MSG_ATTRIBUTE("Use -stopSharingNoteWithGuid:completion: instead") NS_SWIFT_UNAVAILABLE("Deprecated"); diff --git a/evernote-sdk-ios/ENSDK/Advanced/ENNoteStoreClient.m b/evernote-sdk-ios/ENSDK/Advanced/ENNoteStoreClient.m index 0c575b2..a282a45 100644 --- a/evernote-sdk-ios/ENSDK/Advanced/ENNoteStoreClient.m +++ b/evernote-sdk-ios/ENSDK/Advanced/ENNoteStoreClient.m @@ -1023,7 +1023,7 @@ - (void)updateTag:(EDAMTag *)tag } - (void)untagAllWithGuid:(EDAMGuid)guid - success:(void(^)())success + success:(void(^)(void))success failure:(void(^)(NSError *error))failure { [self untagAllWithGuid:guid completion:^(NSError * _Nonnull error) { @@ -1569,7 +1569,7 @@ - (void)getSharedNotebookByAuthWithSuccess:(void(^)(EDAMSharedNotebook *sharedNo } - (void)emailNoteWithParameters:(EDAMNoteEmailParameters *)parameters - success:(void(^)())success + success:(void(^)(void))success failure:(void(^)(NSError *error))failure { [self emailNoteWithParameters:parameters completion:^(NSError * _Nonnull error) { @@ -1587,7 +1587,7 @@ - (void)shareNoteWithGuid:(EDAMGuid)guid } - (void)stopSharingNoteWithGuid:(EDAMGuid)guid - success:(void(^)())success + success:(void(^)(void))success failure:(void(^)(NSError *error))failure { [self stopSharingNoteWithGuid:guid completion:^(NSError * _Nonnull error) { diff --git a/evernote-sdk-ios/ENSDK/Advanced/ENUserStoreClient.h b/evernote-sdk-ios/ENSDK/Advanced/ENUserStoreClient.h index a6bb949..132f57b 100644 --- a/evernote-sdk-ios/ENSDK/Advanced/ENUserStoreClient.h +++ b/evernote-sdk-ios/ENSDK/Advanced/ENUserStoreClient.h @@ -150,7 +150,7 @@ NS_ASSUME_NONNULL_BEGIN DEPRECATED_MSG_ATTRIBUTE("Use -authenticateToBusinessWithCompletion: instead") NS_SWIFT_UNAVAILABLE("Deprecated"); - (void)revokeLongSessionWithAuthenticationToken:(NSString*)authenticationToken - success:(void(^)())success + success:(void(^)(void))success failure:(void(^)(NSError *error))failure DEPRECATED_MSG_ATTRIBUTE("Use -revokeLongSessionWithAuthenticationToken:completion: instead") NS_SWIFT_UNAVAILABLE("Deprecated"); @end diff --git a/evernote-sdk-ios/ENSDK/Advanced/ENUserStoreClient.m b/evernote-sdk-ios/ENSDK/Advanced/ENUserStoreClient.m index e43ffcf..cd0064a 100644 --- a/evernote-sdk-ios/ENSDK/Advanced/ENUserStoreClient.m +++ b/evernote-sdk-ios/ENSDK/Advanced/ENUserStoreClient.m @@ -192,7 +192,7 @@ - (void)authenticateToBusinessWithSuccess:(void(^)(EDAMAuthenticationResult *aut } - (void)revokeLongSessionWithAuthenticationToken:(NSString*)authenticationToken - success:(void(^)())success + success:(void(^)(void))success failure:(void(^)(NSError *error))failure { [self revokeLongSessionWithAuthenticationToken:authenticationToken completion:^(NSError *error) { (error == nil) ? success() : failure(error); diff --git a/evernote-sdk-ios/ENSDK/Advanced/Utilities/ENMLWriter/ENMIMEUtils.m b/evernote-sdk-ios/ENSDK/Advanced/Utilities/ENMLWriter/ENMIMEUtils.m index d5a5b9d..905c24f 100644 --- a/evernote-sdk-ios/ENSDK/Advanced/Utilities/ENMLWriter/ENMIMEUtils.m +++ b/evernote-sdk-ios/ENSDK/Advanced/Utilities/ENMLWriter/ENMIMEUtils.m @@ -31,11 +31,7 @@ #import "ENSDKAdvanced.h" #import "ENMLConstants.h" -#if TARGET_OS_IPHONE -# import -#else # import -#endif @implementation ENMIMEUtils diff --git a/evernote-sdk-ios/ENSDK/ENCommonUtils.h b/evernote-sdk-ios/ENSDK/ENCommonUtils.h index 1b32d2c..10e4c75 100644 --- a/evernote-sdk-ios/ENSDK/ENCommonUtils.h +++ b/evernote-sdk-ios/ENSDK/ENCommonUtils.h @@ -10,7 +10,7 @@ @interface ENCommonUtils : NSObject -BOOL IsIOS8(); -BOOL IsEvernoteInstalled(); +BOOL IsIOS8(void); +BOOL IsEvernoteInstalled(void); @end diff --git a/evernote-sdk-ios/ENSDK/ENNote.h b/evernote-sdk-ios/ENSDK/ENNote.h index 533afa1..0839603 100644 --- a/evernote-sdk-ios/ENSDK/ENNote.h +++ b/evernote-sdk-ios/ENSDK/ENNote.h @@ -27,11 +27,12 @@ */ #import +#import @class ENNote; @class ENResource; @class ENNotebook; @class ENNoteContent; -@class UIWebView; +@class WKWebView; NS_ASSUME_NONNULL_BEGIN @@ -91,7 +92,7 @@ typedef void (^ENNoteGenerateWebArchiveDataCompletionHandler)(NSData *_Nullable /** * A note can be rendered for the user within a web view. This method generates a web archive from the - * receiver's content. This archive is a single data object that can be given to a UIWebView's -loadData:... + * receiver's content. This archive is a single data object that can be given to a WKWebView's -loadData:... * method, using the MIME type defined as ENWebArchiveDataMIMEType. This method is asynchronous, but does * not operate using any remote resources; it can generally be safely used without e.g. a background * thread/progress indicator. @@ -101,7 +102,7 @@ typedef void (^ENNoteGenerateWebArchiveDataCompletionHandler)(NSData *_Nullable - (void)generateWebArchiveData:(ENNoteGenerateWebArchiveDataCompletionHandler)completion; /** - * Class method to create and populate a note object from a loaded UIWebView of your content. The styled contents + * Class method to create and populate a note object from a loaded WKWebView of your content. The styled contents * of the DOM as currently loaded are captured into the content of the note. Remote images (i.e. in tags) * are captured as resources. (CSS-based images are not pulled in as resources, but will remain remote links in * the resulting note.) @@ -111,10 +112,10 @@ typedef void (^ENNoteGenerateWebArchiveDataCompletionHandler)(NSData *_Nullable * completely support general-purpose web page capture and reproduction; it will not work well in a * generic "web clipping to Evernote" feature. * - * @param webView A UIWebView (on or offscreen) that contains loaded web content for capture. + * @param webView A WKWebView (on or offscreen) that contains loaded web content for capture. * @param completion A prepopulated note object appropriate for upload. */ -+ (void)populateNoteFromWebView:(UIWebView *)webView completion:(ENNotePopulateFromWebViewCompletionHandler)completion; ++ (void)populateNoteFromWebView:(WKWebView *)webView completion:(ENNotePopulateFromWebViewCompletionHandler)completion; @end NS_ASSUME_NONNULL_END diff --git a/evernote-sdk-ios/ENSDK/ENNote.m b/evernote-sdk-ios/ENSDK/ENNote.m index 9ad2989..08a8139 100644 --- a/evernote-sdk-ios/ENSDK/ENNote.m +++ b/evernote-sdk-ios/ENSDK/ENNote.m @@ -159,7 +159,7 @@ - (void)generateWebArchiveData:(ENNoteGenerateWebArchiveDataCompletionHandler)co // note was not captured from a web page), then just make one up. In this case we use a dummy hostname, and just use the // resource's hash as a fake filename with an appropriate extension. // - // This would be cleaner if we didn't require the totally fake hostname, but using any non-absolute path here confuses UIWebView. + // This would be cleaner if we didn't require the totally fake hostname, but using any non-absolute path here confuses WKWebView. // NSMutableArray * edamResources = [NSMutableArray arrayWithCapacity:self.resources.count]; for (ENResource * resource in self.resources) { @@ -211,7 +211,7 @@ - (void)generateWebArchiveData:(ENNoteGenerateWebArchiveDataCompletionHandler)co }]; } -+ (void)populateNoteFromWebView:(UIWebView *)webView completion:(ENNotePopulateFromWebViewCompletionHandler)completion ++ (void)populateNoteFromWebView:(WKWebView *)webView completion:(ENNotePopulateFromWebViewCompletionHandler)completion { if (!completion) { ENSDKLogError(@"+populateNoteFromWebView requires a valid completion block"); diff --git a/evernote-sdk-ios/ENSDK/ENNoteContent.h b/evernote-sdk-ios/ENSDK/ENNoteContent.h index a48e621..80b5963 100644 --- a/evernote-sdk-ios/ENSDK/ENNoteContent.h +++ b/evernote-sdk-ios/ENSDK/ENNoteContent.h @@ -58,7 +58,7 @@ NS_ASSUME_NONNULL_BEGIN * "Sanitized" HTML means that any desired CSS styles are inlined into the DOM (versus being * remote resources or a single