From f3f68336849595beaced04d987ab3729538d983e Mon Sep 17 00:00:00 2001 From: Hiroyuki Koike Date: Wed, 2 Jan 2019 13:17:32 +0900 Subject: [PATCH 1/5] Remove warning --- .../Core/ODURLSEssion/ODURLSessionDataTask.m | 2 +- .../ODURLSEssion/ODURLSessionDownloadTask.m | 2 +- .../Core/ODURLSEssion/ODURLSessionTask.m | 10 ++-- .../OneDriveSDK.xcodeproj/project.pbxproj | 58 +++++++++---------- .../xcschemes/OneDriveSDK.xcscheme | 4 +- .../xcschemes/OneDriveSDKTests.xcscheme | 8 +-- .../xcshareddata/IDEWorkspaceChecks.plist | 8 +++ OneDriveSDK/Podfile | 1 + 8 files changed, 49 insertions(+), 44 deletions(-) create mode 100644 OneDriveSDK/OneDriveSDK.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/OneDriveSDK/OneDriveCoreSDK/Core/ODURLSEssion/ODURLSessionDataTask.m b/OneDriveSDK/OneDriveCoreSDK/Core/ODURLSEssion/ODURLSessionDataTask.m index d6c7ba9..7f0271f 100644 --- a/OneDriveSDK/OneDriveCoreSDK/Core/ODURLSEssion/ODURLSessionDataTask.m +++ b/OneDriveSDK/OneDriveCoreSDK/Core/ODURLSEssion/ODURLSessionDataTask.m @@ -61,7 +61,7 @@ - (NSURLSessionDataTask *)taskWithRequest:(NSMutableURLRequest *)request return [self.client.httpProvider dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error){ - _state = ODTaskCompleted; + self->_state = ODTaskCompleted; NSError *resolvedError = nil; NSDictionary *resolvedResponse = nil; if (!error && response){ diff --git a/OneDriveSDK/OneDriveCoreSDK/Core/ODURLSEssion/ODURLSessionDownloadTask.m b/OneDriveSDK/OneDriveCoreSDK/Core/ODURLSEssion/ODURLSessionDownloadTask.m index 99af7a6..b50079c 100644 --- a/OneDriveSDK/OneDriveCoreSDK/Core/ODURLSEssion/ODURLSessionDownloadTask.m +++ b/OneDriveSDK/OneDriveCoreSDK/Core/ODURLSEssion/ODURLSessionDownloadTask.m @@ -57,7 +57,7 @@ - (NSURLSessionDownloadTask *)taskWithRequest:(NSMutableURLRequest *)request [self.client.logger logWithLevel:ODLogVerbose message:@"Creating download task with request : %@", request]; NSProgress *progress = self.progress; return [self.client.httpProvider downloadTaskWithRequest:request progress:&progress completionHandler:^(NSURL *location, NSURLResponse *response, NSError *error){ - _state = ODTaskCompleted; + self->_state = ODTaskCompleted; NSInteger statusCode = ((NSHTTPURLResponse *)response).statusCode; [self.client.logger logWithLevel:ODLogVerbose message:@"Received download response with http status code %ld", statusCode]; if (!error && statusCode != ODOK && statusCode != ODPartialContent) { diff --git a/OneDriveSDK/OneDriveCoreSDK/Core/ODURLSEssion/ODURLSessionTask.m b/OneDriveSDK/OneDriveCoreSDK/Core/ODURLSEssion/ODURLSessionTask.m index ba91afb..08ea584 100644 --- a/OneDriveSDK/OneDriveCoreSDK/Core/ODURLSEssion/ODURLSessionTask.m +++ b/OneDriveSDK/OneDriveCoreSDK/Core/ODURLSEssion/ODURLSessionTask.m @@ -53,14 +53,14 @@ - (void)execute; [self.client.authProvider appendAuthHeaders:self.request completion:^(NSMutableURLRequest *request, NSError *error){ if (self.state != ODTaskCanceled){ if (!error){ - _state = ODTaskExecuting; - _innerTask = [self taskWithRequest:request]; + self->_state = ODTaskExecuting; + self->_innerTask = [self taskWithRequest:request]; [self.client.logger logWithLevel:ODLogInfo message:@"Created NSURLSessionTask"]; - [self.client.logger logWithLevel:ODLogVerbose message:@"Task Id : %ld", _innerTask.taskIdentifier]; - [_innerTask resume]; + [self.client.logger logWithLevel:ODLogVerbose message:@"Task Id : %ld", self->_innerTask.taskIdentifier]; + [self->_innerTask resume]; } else{ - _state = ODTaskAuthFailed; + self->_state = ODTaskAuthFailed; [self.client.logger logWithLevel:ODLogError message:@"Authentication Failed with error :%@", error]; [self authenticationFailedWithError:error]; } diff --git a/OneDriveSDK/OneDriveSDK.xcodeproj/project.pbxproj b/OneDriveSDK/OneDriveSDK.xcodeproj/project.pbxproj index db581c3..314c4c8 100644 --- a/OneDriveSDK/OneDriveSDK.xcodeproj/project.pbxproj +++ b/OneDriveSDK/OneDriveSDK.xcodeproj/project.pbxproj @@ -1333,7 +1333,7 @@ 10B4D11C1AF8215D0083D86C /* Frameworks */, 10B4D11D1AF8215D0083D86C /* Headers */, 10B4D11E1AF8215D0083D86C /* Resources */, - 95C8F43AA7F2936CE94EF4CE /* [CP] Copy Pods Resources */, + A110B4A555530897FFDDB48E /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -1352,8 +1352,7 @@ 10B4D3291AF827D80083D86C /* Sources */, 10B4D32A1AF827D80083D86C /* Frameworks */, 10B4D32B1AF827D80083D86C /* Resources */, - 6571E6AB65E86A4F7FB685F3 /* [CP] Copy Pods Resources */, - C85DDFB8E2937AD6EFB526DE /* [CP] Embed Pods Frameworks */, + C535D8E4F56A8E6D3FDB5208 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -1371,7 +1370,7 @@ 10B4D1171AF8215D0083D86C /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1010; ORGANIZATIONNAME = Microsoft; TargetAttributes = { 10B4D11F1AF8215D0083D86C = { @@ -1481,29 +1480,12 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 6571E6AB65E86A4F7FB685F3 /* [CP] Copy Pods Resources */ = { + A110B4A555530897FFDDB48E /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputPaths = ( - "${SRCROOT}/Pods/Target Support Files/Pods-OneDriveSDKTests/Pods-OneDriveSDKTests-resources.sh", - "${PODS_ROOT}/ADAL/ADALiOS/ADALiOS/ADAL_iPad_Storyboard.storyboard", - "${PODS_ROOT}/ADAL/ADALiOS/ADALiOS/ADAL_iPhone_Storyboard.storyboard", - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-OneDriveSDKTests/Pods-OneDriveSDKTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 95C8F43AA7F2936CE94EF4CE /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( + inputFileListPaths = ( ); inputPaths = ( "${SRCROOT}/Pods/Target Support Files/Pods-OneDriveSDK/Pods-OneDriveSDK-resources.sh", @@ -1511,8 +1493,11 @@ "${PODS_ROOT}/ADAL/ADALiOS/ADALiOS/ADAL_iPhone_Storyboard.storyboard", ); name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + ); outputPaths = ( - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ADAL_iPad_Storyboard.storyboardc", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ADAL_iPhone_Storyboard.storyboardc", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -1537,19 +1522,28 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - C85DDFB8E2937AD6EFB526DE /* [CP] Embed Pods Frameworks */ = { + C535D8E4F56A8E6D3FDB5208 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); + inputFileListPaths = ( + ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-OneDriveSDKTests/Pods-OneDriveSDKTests-resources.sh", + "${PODS_ROOT}/ADAL/ADALiOS/ADALiOS/ADAL_iPad_Storyboard.storyboard", + "${PODS_ROOT}/ADAL/ADALiOS/ADALiOS/ADAL_iPhone_Storyboard.storyboard", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( ); - name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ADAL_iPad_Storyboard.storyboardc", + "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ADAL_iPhone_Storyboard.storyboardc", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-OneDriveSDKTests/Pods-OneDriveSDKTests-frameworks.sh\"\n"; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-OneDriveSDKTests/Pods-OneDriveSDKTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ @@ -1736,12 +1730,14 @@ 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_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_RANGE_LOOP_ANALYSIS = YES; @@ -1769,7 +1765,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.2; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -1791,12 +1787,14 @@ 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_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_RANGE_LOOP_ANALYSIS = YES; @@ -1817,7 +1815,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.2; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1838,6 +1836,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = OneDriveSDK/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.Microsoft.OneDrive.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1856,6 +1855,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = OneDriveSDK/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.Microsoft.OneDrive.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/OneDriveSDK/OneDriveSDK.xcodeproj/xcshareddata/xcschemes/OneDriveSDK.xcscheme b/OneDriveSDK/OneDriveSDK.xcodeproj/xcshareddata/xcschemes/OneDriveSDK.xcscheme index 3e34acf..d37b6ec 100644 --- a/OneDriveSDK/OneDriveSDK.xcodeproj/xcshareddata/xcschemes/OneDriveSDK.xcscheme +++ b/OneDriveSDK/OneDriveSDK.xcodeproj/xcshareddata/xcschemes/OneDriveSDK.xcscheme @@ -1,6 +1,6 @@ @@ -37,7 +36,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/OneDriveSDK/OneDriveSDK.xcodeproj/xcshareddata/xcschemes/OneDriveSDKTests.xcscheme b/OneDriveSDK/OneDriveSDK.xcodeproj/xcshareddata/xcschemes/OneDriveSDKTests.xcscheme index ec0baee..ec9ad89 100644 --- a/OneDriveSDK/OneDriveSDK.xcodeproj/xcshareddata/xcschemes/OneDriveSDKTests.xcscheme +++ b/OneDriveSDK/OneDriveSDK.xcodeproj/xcshareddata/xcschemes/OneDriveSDKTests.xcscheme @@ -1,6 +1,6 @@ @@ -40,7 +40,6 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - language = "" shouldUseLaunchSchemeArgsEnv = "YES"> diff --git a/OneDriveSDK/OneDriveSDK.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/OneDriveSDK/OneDriveSDK.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/OneDriveSDK/OneDriveSDK.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/OneDriveSDK/Podfile b/OneDriveSDK/Podfile index 43beb04..3840499 100644 --- a/OneDriveSDK/Podfile +++ b/OneDriveSDK/Podfile @@ -3,6 +3,7 @@ target 'OneDriveSDK' do pod 'ADAL', '~> 1.2' + #pod 'ADAL' pod 'Base32', '~> 1.1' end From b7002a447dacc79d5eff0f2c5451d6a92916096d Mon Sep 17 00:00:00 2001 From: Hiroyuki Koike Date: Wed, 2 Jan 2019 13:23:03 +0900 Subject: [PATCH 2/5] Remove warning --- .../Extensions/ODClient+DefaultConfiguration.h | 14 +++++++------- OneDriveSDK/OneDriveCoreSDK/Core/ODObject.h | 2 +- OneDriveSDK/OneDriveCoreSDK/Core/ODRequest.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/OneDriveSDK/Extensions/ODClient+DefaultConfiguration.h b/OneDriveSDK/Extensions/ODClient+DefaultConfiguration.h index 5f9c27b..ea805ca 100644 --- a/OneDriveSDK/Extensions/ODClient+DefaultConfiguration.h +++ b/OneDriveSDK/Extensions/ODClient+DefaultConfiguration.h @@ -75,7 +75,7 @@ /** Calls setActiveDirectoryAppId:capability:redirectURL with OneDrive for business Capability (MyFiles) @param activeDirectoryAppId The applicaiton id. Must not be nil. - @param redirectURL the redirect url to be used with Azure Active Directory. Most not be nil. + @param activeDirectoryRedirectURL The redirect url to be used with Azure Active Directory. Most not be nil. */ + (void)setActiveDirectoryAppId:(NSString *)activeDirectoryAppId redirectURL:(NSString *)activeDirectoryRedirectURL; @@ -83,7 +83,7 @@ /** Calls setActiveDirectoryAppId:capability:resouceId:apiEndpoint:redirectURL:flags: with the given information. @param activeDirectoryAppId The application id. Must not be nil. - @param redirectURL the direct url to be used with Azure Active Directory. Must not be nil + @param activeDirectoryRedirectURL The direct url to be used with Azure Active Directory. Must not be nil */ + (void)setActiveDirectoryAppId:(NSString *)activeDirectoryAppId redirectURL:(NSString *)activeDirectoryRedirectURL @@ -91,7 +91,7 @@ /** Calls setActiveDirectoryAppId:capability:redirectURL:flags: with nil flags. @param activeDirectoryAppId The application id. Must not be nil. - @param activeDirectoryCapabilty The capability to use for active directoy. Must not be nil. + @param activeDirectoryCapability The capability to use for active directoy. Must not be nil. @param activeDirectoryRedirectURL The redirect url to be used with Azure Active Directory. Must not be nil. */ + (void)setActiveDirectoryAppId:(NSString *)activeDirectoryAppId @@ -101,7 +101,7 @@ /** Calls setActiveDirectoryAppId:capability:redirectURL:flags: with nil flags. @param activeDirectoryAppId The application id. Must not be nil. - @param activeDirectoryResouceId The active directory reosuce id. Must not be nil. + @param activeDirectoryResourceId The active directory reosuce id. Must not be nil. @param activeDirectoryApiEndpoint The active directory api endpoint. Must not be nil. @param activeDirectoryRedirectURL The redirect url to be used with Azure Active Directory. Must not be nil. */ @@ -114,7 +114,7 @@ Sets the OneDrive for Business app information. @param activeDirectoryAppId The application id. Must not be nil. @param activeDirectoryCapability The active directory capability. Must not be nil if resouceId and apiEndpoint are nil. - @param activeDirectoryResouceId The active directroy resouceId. Must not be nil if capability is nil. + @param activeDirectoryResourceId The active directroy resouceId. Must not be nil if capability is nil. @param activeDirectoryApiEndpoint The active directory ApiEndpoing. Must not be nil if capability is nil. @param activeDirectoryRedirectURL The redirect url to be used with Azure Active Directory. Must not be nil. @param activeDirectoryFlags A user defined dictionary to be passed through to the client when authenticated using the OneDrive for Business authentication flow. @@ -133,7 +133,7 @@ @param microsoftAccountScopes The scopes to be used with authentication. Must not be nil. @param microsoftAccountFlags A user defined dictionary to be passed through to the client when authenticated using the OneDrive microsoftAccount authentication flow. @param activeDirectoryAppId The application id. Must not be nil. - @param activeDirectoryCapabilty The active directroy capability must not be nil + @param activeDirectoryCapability The active directroy capability must not be nil @param activeDirectoryRedirectURL The redirect url to be used with Azure Active Directory. Must not be nil. @param activeDirectoryFlags A user defined dictionary to be passed through to the client when authenticated using the OneDrive for Business authentication flow. */ @@ -150,7 +150,7 @@ @param microsoftAccountScopes The scopes to be used with authentication. Must not be nil. @param microsoftAccountFlags A user defined dictionary to be passed through to the client when authenticated using the OneDrive microsoftAccount authentication flow. @param activeDirectoryAppId The application id. Must not be nil. - @param activeDirectoryResouceId The active directroy resource Id. Must not be nil. + @param activeDirectoryResourceId The active directroy resource Id. Must not be nil. @param activeDirectoryApiEndpoint The active directroy Api Endpoint. Must not be nil. @param activeDirectoryRedirectURL The redirect url to be used with Azure Active Directory. Must not be nil. @param activeDirectoryFlags A user defined dictionary to be passed through to the client when authenticated using the OneDrive for Business authentication flow. diff --git a/OneDriveSDK/OneDriveCoreSDK/Core/ODObject.h b/OneDriveSDK/OneDriveCoreSDK/Core/ODObject.h index 6c9e787..51bd422 100644 --- a/OneDriveSDK/OneDriveCoreSDK/Core/ODObject.h +++ b/OneDriveSDK/OneDriveCoreSDK/Core/ODObject.h @@ -43,7 +43,7 @@ /** Creates an NSDate from a string returned by the server. - @param A date string in ISO 1601 format. + @param dateString A date string in ISO 1601 format. @return An NSDate object of the string. */ - (NSDate *)dateFromString:(NSString *)dateString; diff --git a/OneDriveSDK/OneDriveCoreSDK/Core/ODRequest.h b/OneDriveSDK/OneDriveCoreSDK/Core/ODRequest.h index c86310d..660ccd9 100644 --- a/OneDriveSDK/OneDriveCoreSDK/Core/ODRequest.h +++ b/OneDriveSDK/OneDriveCoreSDK/Core/ODRequest.h @@ -120,7 +120,7 @@ typedef id (^ODObjectWithDictionary)(NSDictionary *response); /** Creates an `ODURLSessionDataTask` with the given request. - @param The request to create the task with. + @param request The request to create the task with. @param castBlock A block that converts an NSDictionary to an ODObject. @param completionHandler The completion handler to be called when the task has finished. */ From 57cc9af15b781b4e97bd57214e4e775934f85213 Mon Sep 17 00:00:00 2001 From: Hiroyuki Koike Date: Thu, 3 Jan 2019 01:50:54 +0900 Subject: [PATCH 3/5] Modify --- OneDriveSDK.podspec | 2 +- OneDriveSDK/OneDriveSDK.xcodeproj/project.pbxproj | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/OneDriveSDK.podspec b/OneDriveSDK.podspec index 8f24d9c..2c18ecd 100644 --- a/OneDriveSDK.podspec +++ b/OneDriveSDK.podspec @@ -19,7 +19,7 @@ Pod::Spec.new do |s| s.author = { "onedriveapi " => "onedrivesdkowners@microsoft.com" } s.social_media_url = "http://twitter.com/onedrivedev" - s.platform = :ios, "7.0" + s.platform = :ios, "10.0" s.source = { :git => "https://github.com/OneDrive/onedrive-sdk-ios.git", :tag => "#{s.version}"} diff --git a/OneDriveSDK/OneDriveSDK.xcodeproj/project.pbxproj b/OneDriveSDK/OneDriveSDK.xcodeproj/project.pbxproj index 314c4c8..de08ac5 100644 --- a/OneDriveSDK/OneDriveSDK.xcodeproj/project.pbxproj +++ b/OneDriveSDK/OneDriveSDK.xcodeproj/project.pbxproj @@ -1765,7 +1765,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -1815,7 +1815,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -1836,7 +1836,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = OneDriveSDK/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.Microsoft.OneDrive.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1855,7 +1855,7 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = OneDriveSDK/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.Microsoft.OneDrive.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; From 77c38e04c78e01793993e2905944335adaa552f2 Mon Sep 17 00:00:00 2001 From: Hiroyuki Koike Date: Sun, 13 Oct 2019 18:03:20 +0900 Subject: [PATCH 4/5] PS-1468 Fix issue --- .../iOSExplorer.xcodeproj/project.pbxproj | 19 ++++- .../iOSExplorer/Base.lproj/Main.storyboard | 31 ++++---- Examples/iOSExplorer/iOSExplorer/Info.plist | 17 +++++ .../iOSExplorer/SceneDelegate.swift | 74 +++++++++++++++++++ .../iOSExplorer/iOSExplorer-Bridging-Header.h | 6 ++ OneDriveSDK/Accounts/ODAppConfiguration.m | 3 +- .../Extensions/ODClient+Authentication.m | 3 +- 7 files changed, 137 insertions(+), 16 deletions(-) create mode 100644 Examples/iOSExplorer/iOSExplorer/SceneDelegate.swift create mode 100644 Examples/iOSExplorer/iOSExplorer/iOSExplorer-Bridging-Header.h diff --git a/Examples/iOSExplorer/iOSExplorer.xcodeproj/project.pbxproj b/Examples/iOSExplorer/iOSExplorer.xcodeproj/project.pbxproj index 6119d99..909648b 100644 --- a/Examples/iOSExplorer/iOSExplorer.xcodeproj/project.pbxproj +++ b/Examples/iOSExplorer/iOSExplorer.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ 51037E9C92F08CDC45500AAD /* libPods-iOSExplorer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3DFCFC19ED153A38DAF7A55 /* libPods-iOSExplorer.a */; }; 96DEE06E1BC5E4F700F02AF8 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 96DEE06A1BC5E4F700F02AF8 /* LaunchScreen.xib */; }; 96DEE06F1BC5E4F700F02AF8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96DEE06C1BC5E4F700F02AF8 /* Main.storyboard */; }; + C75FEE9E235318B3001BF79D /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75FEE9D235318B3001BF79D /* SceneDelegate.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -55,6 +56,8 @@ 106DAB3C1AF82E77001FF917 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 96DEE06B1BC5E4F700F02AF8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 96DEE06D1BC5E4F700F02AF8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + C75FEE9C235318B2001BF79D /* iOSExplorer-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "iOSExplorer-Bridging-Header.h"; sourceTree = ""; }; + C75FEE9D235318B3001BF79D /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; CB0C0620E9767D1127AEF938 /* Pods-iOSExplorer.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iOSExplorer.debug.xcconfig"; path = "Pods/Target Support Files/Pods-iOSExplorer/Pods-iOSExplorer.debug.xcconfig"; sourceTree = ""; }; D3DFCFC19ED153A38DAF7A55 /* libPods-iOSExplorer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-iOSExplorer.a"; sourceTree = BUILT_PRODUCTS_DIR; }; FBDADC01A80AB5DE8181D87E /* Pods-iOSExplorer.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iOSExplorer.release.xcconfig"; path = "Pods/Target Support Files/Pods-iOSExplorer/Pods-iOSExplorer.release.xcconfig"; sourceTree = ""; }; @@ -115,6 +118,8 @@ 106DAB261AF82E68001FF917 /* ODXTextViewController.m */, 10007C721B31D86800E4ED17 /* Resources */, 106DAAE31AF82DE9001FF917 /* Supporting Files */, + C75FEE9D235318B3001BF79D /* SceneDelegate.swift */, + C75FEE9C235318B2001BF79D /* iOSExplorer-Bridging-Header.h */, ); path = iOSExplorer; sourceTree = ""; @@ -194,12 +199,13 @@ 106DAAD81AF82DE9001FF917 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1010; + LastUpgradeCheck = 1100; ORGANIZATIONNAME = Microsoft; TargetAttributes = { 106DAADF1AF82DE9001FF917 = { CreatedOnToolsVersion = 6.2; DevelopmentTeam = M343ZJ9LAZ; + LastSwiftMigration = 1100; ProvisioningStyle = Automatic; SystemCapabilities = { com.apple.Keychain = { @@ -296,6 +302,7 @@ 106DAB321AF82E68001FF917 /* ODXItemCollectionViewController.m in Sources */, 105857821B9A1F8000B71550 /* ODXProgressViewController.m in Sources */, 106DAB2C1AF82E68001FF917 /* ODXAppDelegate.m in Sources */, + C75FEE9E235318B3001BF79D /* SceneDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -341,6 +348,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -395,6 +403,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -433,6 +442,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -443,6 +453,7 @@ baseConfigurationReference = CB0C0620E9767D1127AEF938 /* Pods-iOSExplorer.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; @@ -454,6 +465,9 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.Microsoft.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OBJC_BRIDGING_HEADER = "iOSExplorer/iOSExplorer-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -462,6 +476,7 @@ baseConfigurationReference = FBDADC01A80AB5DE8181D87E /* Pods-iOSExplorer.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; @@ -473,6 +488,8 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.Microsoft.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OBJC_BRIDGING_HEADER = "iOSExplorer/iOSExplorer-Bridging-Header.h"; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Examples/iOSExplorer/iOSExplorer/Base.lproj/Main.storyboard b/Examples/iOSExplorer/iOSExplorer/Base.lproj/Main.storyboard index 7ec1c2e..738ff8e 100644 --- a/Examples/iOSExplorer/iOSExplorer/Base.lproj/Main.storyboard +++ b/Examples/iOSExplorer/iOSExplorer/Base.lproj/Main.storyboard @@ -1,7 +1,10 @@ - - + + + - + + + @@ -13,18 +16,19 @@ - + - + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. - + @@ -39,7 +43,7 @@ - + @@ -55,9 +59,9 @@ - + - + @@ -66,7 +70,7 @@ - + @@ -74,16 +78,17 @@ + - diff --git a/Examples/iOSExplorer/iOSExplorer/Info.plist b/Examples/iOSExplorer/iOSExplorer/Info.plist index 40c6215..6ba3f13 100644 --- a/Examples/iOSExplorer/iOSExplorer/Info.plist +++ b/Examples/iOSExplorer/iOSExplorer/Info.plist @@ -22,6 +22,23 @@ 1 LSRequiresIPhoneOS + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneConfigurationName + Default Configuration + + + + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/Examples/iOSExplorer/iOSExplorer/SceneDelegate.swift b/Examples/iOSExplorer/iOSExplorer/SceneDelegate.swift new file mode 100644 index 0000000..df7024b --- /dev/null +++ b/Examples/iOSExplorer/iOSExplorer/SceneDelegate.swift @@ -0,0 +1,74 @@ +// +// SceneDelegate.swift +// iOSExplorer +// +// Created by Hiroyuki Koike on 2019/10/13. +// Copyright © 2019 Microsoft. All rights reserved. +// + +import UIKit +import os.log + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + var rootViewController: UINavigationController? + + @available(iOS 13.0, *) + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + + os_log("willConnectTo : %@", log: OSLog.default, type: .debug, scene.session.persistentIdentifier) + + ODClient.setMicrosoftAccountAppId("0000000048160AF8", scopes: ["onedrive.readwrite"]); + + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + + let layout = UICollectionViewFlowLayout() + layout.itemSize = CGSize(width: 100, height: 50) + let vc = ODXItemCollectionViewController.init(collectionViewLayout: layout) + + self.rootViewController = UINavigationController.init(rootViewController: vc) + window.rootViewController = self.rootViewController + + self.window = window + window.makeKeyAndVisible() + } + } + + @available(iOS 13.0, *) + func sceneWillEnterForeground(_ scene: UIScene) { // launch:1 + os_log("sceneWillEnterForeground : %@", log: OSLog.default, type: .debug, scene.session.persistentIdentifier) + } + + @available(iOS 13.0, *) + func sceneDidBecomeActive(_ scene: UIScene) { // launch:2 + os_log("sceneDidBecomeActive : %@", log: OSLog.default, type: .debug, scene.session.persistentIdentifier) + } + + @available(iOS 13.0, *) + func sceneWillResignActive(_ scene: UIScene) { // launch:3 + os_log("sceneWillResignActive : %@", log: OSLog.default, type: .debug, scene.session.persistentIdentifier) + } + + @available(iOS 13.0, *) + func sceneDidEnterBackground(_ scene: UIScene) { + os_log("sceneDidEnterBackground : %@", log: OSLog.default, type: .debug, scene.session.persistentIdentifier) + } + + @available(iOS 13.0, *) + func sceneDidDisconnect(_ scene: UIScene) { + os_log("sceneDidDisconnect : %@", log: OSLog.default, type: .debug, scene.session.persistentIdentifier) + } + + @available(iOS 13.0, *) + func scene(_ scene: UIScene, openURLContexts URLContexts: Set) { + os_log("scene openURLContexts : %@", log: OSLog.default, type: .debug, scene.session.persistentIdentifier) + } + + @available(iOS 13.0, *) + func scene(_ scene: UIScene, continue userActivity: NSUserActivity) { + os_log("scene continue : %@", log: OSLog.default, type: .debug, scene.session.persistentIdentifier) + } +} + diff --git a/Examples/iOSExplorer/iOSExplorer/iOSExplorer-Bridging-Header.h b/Examples/iOSExplorer/iOSExplorer/iOSExplorer-Bridging-Header.h new file mode 100644 index 0000000..cc4347a --- /dev/null +++ b/Examples/iOSExplorer/iOSExplorer/iOSExplorer-Bridging-Header.h @@ -0,0 +1,6 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + +#import "ODXItemCollectionViewController.h" +#import diff --git a/OneDriveSDK/Accounts/ODAppConfiguration.m b/OneDriveSDK/Accounts/ODAppConfiguration.m index 1715ec9..d7daee1 100644 --- a/OneDriveSDK/Accounts/ODAppConfiguration.m +++ b/OneDriveSDK/Accounts/ODAppConfiguration.m @@ -26,7 +26,8 @@ @implementation ODAppConfiguration - (UIViewController *)parentAuthController { if (!_parentAuthController){ - _parentAuthController = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; + //_parentAuthController = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; + _parentAuthController = [UIApplication sharedApplication].keyWindow.rootViewController; // For iPadOS multiview PS-1468 } return _parentAuthController; } diff --git a/OneDriveSDK/Extensions/ODClient+Authentication.m b/OneDriveSDK/Extensions/ODClient+Authentication.m index c26924f..91c064b 100644 --- a/OneDriveSDK/Extensions/ODClient+Authentication.m +++ b/OneDriveSDK/Extensions/ODClient+Authentication.m @@ -146,7 +146,8 @@ - (void)authenticateWithAuthProvider:(id )authProvider completion:(void (^)(NSError *error))completion { - UIViewController *rootViewController = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; + //UIViewController *rootViewController = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; + UIViewController *rootViewController = [UIApplication sharedApplication].keyWindow.rootViewController; // For iPadOS multiview PS-1468 [self authenticateWithAuthProvider:authProvider httpProvider:httpProvider logger:logger From 4d43f568282538ee92ca9e30990b7ceb0082842f Mon Sep 17 00:00:00 2001 From: Hiroyuki Koike Date: Sun, 13 Oct 2019 18:03:20 +0900 Subject: [PATCH 5/5] Supports iPadOS's multi views --- .../iOSExplorer.xcodeproj/project.pbxproj | 19 ++++- .../iOSExplorer/Base.lproj/Main.storyboard | 31 ++++---- Examples/iOSExplorer/iOSExplorer/Info.plist | 17 +++++ .../iOSExplorer/SceneDelegate.swift | 74 +++++++++++++++++++ .../iOSExplorer/iOSExplorer-Bridging-Header.h | 6 ++ OneDriveSDK/Accounts/ODAppConfiguration.m | 3 +- .../Extensions/ODClient+Authentication.m | 3 +- 7 files changed, 137 insertions(+), 16 deletions(-) create mode 100644 Examples/iOSExplorer/iOSExplorer/SceneDelegate.swift create mode 100644 Examples/iOSExplorer/iOSExplorer/iOSExplorer-Bridging-Header.h diff --git a/Examples/iOSExplorer/iOSExplorer.xcodeproj/project.pbxproj b/Examples/iOSExplorer/iOSExplorer.xcodeproj/project.pbxproj index 6119d99..909648b 100644 --- a/Examples/iOSExplorer/iOSExplorer.xcodeproj/project.pbxproj +++ b/Examples/iOSExplorer/iOSExplorer.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ 51037E9C92F08CDC45500AAD /* libPods-iOSExplorer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D3DFCFC19ED153A38DAF7A55 /* libPods-iOSExplorer.a */; }; 96DEE06E1BC5E4F700F02AF8 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 96DEE06A1BC5E4F700F02AF8 /* LaunchScreen.xib */; }; 96DEE06F1BC5E4F700F02AF8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96DEE06C1BC5E4F700F02AF8 /* Main.storyboard */; }; + C75FEE9E235318B3001BF79D /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C75FEE9D235318B3001BF79D /* SceneDelegate.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -55,6 +56,8 @@ 106DAB3C1AF82E77001FF917 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 96DEE06B1BC5E4F700F02AF8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 96DEE06D1BC5E4F700F02AF8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + C75FEE9C235318B2001BF79D /* iOSExplorer-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "iOSExplorer-Bridging-Header.h"; sourceTree = ""; }; + C75FEE9D235318B3001BF79D /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; CB0C0620E9767D1127AEF938 /* Pods-iOSExplorer.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iOSExplorer.debug.xcconfig"; path = "Pods/Target Support Files/Pods-iOSExplorer/Pods-iOSExplorer.debug.xcconfig"; sourceTree = ""; }; D3DFCFC19ED153A38DAF7A55 /* libPods-iOSExplorer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-iOSExplorer.a"; sourceTree = BUILT_PRODUCTS_DIR; }; FBDADC01A80AB5DE8181D87E /* Pods-iOSExplorer.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-iOSExplorer.release.xcconfig"; path = "Pods/Target Support Files/Pods-iOSExplorer/Pods-iOSExplorer.release.xcconfig"; sourceTree = ""; }; @@ -115,6 +118,8 @@ 106DAB261AF82E68001FF917 /* ODXTextViewController.m */, 10007C721B31D86800E4ED17 /* Resources */, 106DAAE31AF82DE9001FF917 /* Supporting Files */, + C75FEE9D235318B3001BF79D /* SceneDelegate.swift */, + C75FEE9C235318B2001BF79D /* iOSExplorer-Bridging-Header.h */, ); path = iOSExplorer; sourceTree = ""; @@ -194,12 +199,13 @@ 106DAAD81AF82DE9001FF917 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1010; + LastUpgradeCheck = 1100; ORGANIZATIONNAME = Microsoft; TargetAttributes = { 106DAADF1AF82DE9001FF917 = { CreatedOnToolsVersion = 6.2; DevelopmentTeam = M343ZJ9LAZ; + LastSwiftMigration = 1100; ProvisioningStyle = Automatic; SystemCapabilities = { com.apple.Keychain = { @@ -296,6 +302,7 @@ 106DAB321AF82E68001FF917 /* ODXItemCollectionViewController.m in Sources */, 105857821B9A1F8000B71550 /* ODXProgressViewController.m in Sources */, 106DAB2C1AF82E68001FF917 /* ODXAppDelegate.m in Sources */, + C75FEE9E235318B3001BF79D /* SceneDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -341,6 +348,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -395,6 +403,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -433,6 +442,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 10.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -443,6 +453,7 @@ baseConfigurationReference = CB0C0620E9767D1127AEF938 /* Pods-iOSExplorer.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; @@ -454,6 +465,9 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.Microsoft.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OBJC_BRIDGING_HEADER = "iOSExplorer/iOSExplorer-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; }; name = Debug; }; @@ -462,6 +476,7 @@ baseConfigurationReference = FBDADC01A80AB5DE8181D87E /* Pods-iOSExplorer.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; CLANG_WARN_DOCUMENTATION_COMMENTS = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; @@ -473,6 +488,8 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.Microsoft.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_OBJC_BRIDGING_HEADER = "iOSExplorer/iOSExplorer-Bridging-Header.h"; + SWIFT_VERSION = 5.0; }; name = Release; }; diff --git a/Examples/iOSExplorer/iOSExplorer/Base.lproj/Main.storyboard b/Examples/iOSExplorer/iOSExplorer/Base.lproj/Main.storyboard index 7ec1c2e..738ff8e 100644 --- a/Examples/iOSExplorer/iOSExplorer/Base.lproj/Main.storyboard +++ b/Examples/iOSExplorer/iOSExplorer/Base.lproj/Main.storyboard @@ -1,7 +1,10 @@ - - + + + - + + + @@ -13,18 +16,19 @@ - + - + + Lorem ipsum dolor sit er elit lamet, consectetaur cillium adipisicing pecu, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Nam liber te conscient to factor tum poen legum odioque civiuda. - + @@ -39,7 +43,7 @@ - + @@ -55,9 +59,9 @@ - + - + @@ -66,7 +70,7 @@ - + @@ -74,16 +78,17 @@ + - diff --git a/Examples/iOSExplorer/iOSExplorer/Info.plist b/Examples/iOSExplorer/iOSExplorer/Info.plist index 40c6215..6ba3f13 100644 --- a/Examples/iOSExplorer/iOSExplorer/Info.plist +++ b/Examples/iOSExplorer/iOSExplorer/Info.plist @@ -22,6 +22,23 @@ 1 LSRequiresIPhoneOS + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneConfigurationName + Default Configuration + + + + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/Examples/iOSExplorer/iOSExplorer/SceneDelegate.swift b/Examples/iOSExplorer/iOSExplorer/SceneDelegate.swift new file mode 100644 index 0000000..df7024b --- /dev/null +++ b/Examples/iOSExplorer/iOSExplorer/SceneDelegate.swift @@ -0,0 +1,74 @@ +// +// SceneDelegate.swift +// iOSExplorer +// +// Created by Hiroyuki Koike on 2019/10/13. +// Copyright © 2019 Microsoft. All rights reserved. +// + +import UIKit +import os.log + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + var rootViewController: UINavigationController? + + @available(iOS 13.0, *) + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + + os_log("willConnectTo : %@", log: OSLog.default, type: .debug, scene.session.persistentIdentifier) + + ODClient.setMicrosoftAccountAppId("0000000048160AF8", scopes: ["onedrive.readwrite"]); + + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + + let layout = UICollectionViewFlowLayout() + layout.itemSize = CGSize(width: 100, height: 50) + let vc = ODXItemCollectionViewController.init(collectionViewLayout: layout) + + self.rootViewController = UINavigationController.init(rootViewController: vc) + window.rootViewController = self.rootViewController + + self.window = window + window.makeKeyAndVisible() + } + } + + @available(iOS 13.0, *) + func sceneWillEnterForeground(_ scene: UIScene) { // launch:1 + os_log("sceneWillEnterForeground : %@", log: OSLog.default, type: .debug, scene.session.persistentIdentifier) + } + + @available(iOS 13.0, *) + func sceneDidBecomeActive(_ scene: UIScene) { // launch:2 + os_log("sceneDidBecomeActive : %@", log: OSLog.default, type: .debug, scene.session.persistentIdentifier) + } + + @available(iOS 13.0, *) + func sceneWillResignActive(_ scene: UIScene) { // launch:3 + os_log("sceneWillResignActive : %@", log: OSLog.default, type: .debug, scene.session.persistentIdentifier) + } + + @available(iOS 13.0, *) + func sceneDidEnterBackground(_ scene: UIScene) { + os_log("sceneDidEnterBackground : %@", log: OSLog.default, type: .debug, scene.session.persistentIdentifier) + } + + @available(iOS 13.0, *) + func sceneDidDisconnect(_ scene: UIScene) { + os_log("sceneDidDisconnect : %@", log: OSLog.default, type: .debug, scene.session.persistentIdentifier) + } + + @available(iOS 13.0, *) + func scene(_ scene: UIScene, openURLContexts URLContexts: Set) { + os_log("scene openURLContexts : %@", log: OSLog.default, type: .debug, scene.session.persistentIdentifier) + } + + @available(iOS 13.0, *) + func scene(_ scene: UIScene, continue userActivity: NSUserActivity) { + os_log("scene continue : %@", log: OSLog.default, type: .debug, scene.session.persistentIdentifier) + } +} + diff --git a/Examples/iOSExplorer/iOSExplorer/iOSExplorer-Bridging-Header.h b/Examples/iOSExplorer/iOSExplorer/iOSExplorer-Bridging-Header.h new file mode 100644 index 0000000..cc4347a --- /dev/null +++ b/Examples/iOSExplorer/iOSExplorer/iOSExplorer-Bridging-Header.h @@ -0,0 +1,6 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + +#import "ODXItemCollectionViewController.h" +#import diff --git a/OneDriveSDK/Accounts/ODAppConfiguration.m b/OneDriveSDK/Accounts/ODAppConfiguration.m index 1715ec9..d7daee1 100644 --- a/OneDriveSDK/Accounts/ODAppConfiguration.m +++ b/OneDriveSDK/Accounts/ODAppConfiguration.m @@ -26,7 +26,8 @@ @implementation ODAppConfiguration - (UIViewController *)parentAuthController { if (!_parentAuthController){ - _parentAuthController = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; + //_parentAuthController = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; + _parentAuthController = [UIApplication sharedApplication].keyWindow.rootViewController; // For iPadOS multiview PS-1468 } return _parentAuthController; } diff --git a/OneDriveSDK/Extensions/ODClient+Authentication.m b/OneDriveSDK/Extensions/ODClient+Authentication.m index c26924f..91c064b 100644 --- a/OneDriveSDK/Extensions/ODClient+Authentication.m +++ b/OneDriveSDK/Extensions/ODClient+Authentication.m @@ -146,7 +146,8 @@ - (void)authenticateWithAuthProvider:(id )authProvider completion:(void (^)(NSError *error))completion { - UIViewController *rootViewController = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; + //UIViewController *rootViewController = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; + UIViewController *rootViewController = [UIApplication sharedApplication].keyWindow.rootViewController; // For iPadOS multiview PS-1468 [self authenticateWithAuthProvider:authProvider httpProvider:httpProvider logger:logger