diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b880605 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language: objective-c +xcode_project: NJKWebViewProgress.xcodeproj +xcode_scheme: NJKWebViewProgressTests +xcode_sdk: iphonesimulator diff --git a/DemoApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/DemoApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index fd99fe4..0000000 --- a/DemoApp.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/DemoApp/DemoApp-Info.plist b/DemoApp/DemoApp-Info.plist index fe86239..8a34c1e 100644 --- a/DemoApp/DemoApp-Info.plist +++ b/DemoApp/DemoApp-Info.plist @@ -9,7 +9,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.ninjinkun.webviewprogress.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName diff --git a/DemoApp.xcodeproj/project.pbxproj b/NJKWebViewProgress.xcodeproj/project.pbxproj similarity index 51% rename from DemoApp.xcodeproj/project.pbxproj rename to NJKWebViewProgress.xcodeproj/project.pbxproj index 1d707f2..486865b 100644 --- a/DemoApp.xcodeproj/project.pbxproj +++ b/NJKWebViewProgress.xcodeproj/project.pbxproj @@ -7,8 +7,6 @@ objects = { /* Begin PBXBuildFile section */ - 260C2937183704EE0099D1B6 /* NJKWebViewProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 260C2936183704EE0099D1B6 /* NJKWebViewProgressView.m */; }; - 2677297317245E5C00D4E159 /* NJKWebViewProgress.m in Sources */ = {isa = PBXBuildFile; fileRef = 2677297217245E5C00D4E159 /* NJKWebViewProgress.m */; }; 2677297817245E7900D4E159 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2677297517245E7900D4E159 /* AppDelegate.m */; }; 2677297917245E7900D4E159 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2677297717245E7900D4E159 /* ViewController.m */; }; 2677297E17245E8E00D4E159 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 2677297A17245E8E00D4E159 /* Default-568h@2x.png */; }; @@ -17,15 +15,53 @@ 2677298117245E8E00D4E159 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2677297D17245E8E00D4E159 /* main.m */; }; 2677298A17245EB000D4E159 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2677298617245EB000D4E159 /* InfoPlist.strings */; }; 2677298B17245EB000D4E159 /* MainStoryboard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2677298817245EB000D4E159 /* MainStoryboard.storyboard */; }; + 26A456671E6A78B7000E2746 /* NJKWebViewProgress.m in Sources */ = {isa = PBXBuildFile; fileRef = 2677297217245E5C00D4E159 /* NJKWebViewProgress.m */; }; + 26A456741E6A7921000E2746 /* NJKWebViewProgress.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26A4566D1E6A7921000E2746 /* NJKWebViewProgress.framework */; }; + 26A456751E6A7921000E2746 /* NJKWebViewProgress.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 26A4566D1E6A7921000E2746 /* NJKWebViewProgress.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 26A4567A1E6A7945000E2746 /* NJKWebViewProgress.m in Sources */ = {isa = PBXBuildFile; fileRef = 2677297217245E5C00D4E159 /* NJKWebViewProgress.m */; }; + 26A4567B1E6A7947000E2746 /* NJKWebViewProgressView.m in Sources */ = {isa = PBXBuildFile; fileRef = 260C2936183704EE0099D1B6 /* NJKWebViewProgressView.m */; }; + 26A4567D1E6A7A98000E2746 /* NJKWebViewProgress.h in Headers */ = {isa = PBXBuildFile; fileRef = 26A4567C1E6A7A98000E2746 /* NJKWebViewProgress.h */; }; + 26A4567F1E6A7B11000E2746 /* NJKWebViewProgress.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26A4566D1E6A7921000E2746 /* NJKWebViewProgress.framework */; }; + 26E1F3341E6A6F42000FBC08 /* NJKWebViewProgressTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 26E1F3331E6A6F42000FBC08 /* NJKWebViewProgressTests.m */; }; 26E5744A172235B500203262 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26E57449172235B500203262 /* UIKit.framework */; }; 26E5744C172235B500203262 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26E5744B172235B500203262 /* Foundation.framework */; }; 26E5744E172235B500203262 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26E5744D172235B500203262 /* CoreGraphics.framework */; }; /* End PBXBuildFile section */ +/* Begin PBXContainerItemProxy section */ + 26A456721E6A7921000E2746 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 26E5743E172235B500203262 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 26A4566C1E6A7921000E2746; + remoteInfo = NJKWebViewProgress; + }; + 26A456811E6A865F000E2746 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 26E5743E172235B500203262 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 26E57445172235B500203262; + remoteInfo = DemoApp; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 26A456791E6A7921000E2746 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 26A456751E6A7921000E2746 /* NJKWebViewProgress.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 260C2935183704EE0099D1B6 /* NJKWebViewProgressView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NJKWebViewProgressView.h; path = NJKWebViewProgress/NJKWebViewProgressView.h; sourceTree = SOURCE_ROOT; }; 260C2936183704EE0099D1B6 /* NJKWebViewProgressView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NJKWebViewProgressView.m; path = NJKWebViewProgress/NJKWebViewProgressView.m; sourceTree = SOURCE_ROOT; }; - 2677297117245E5C00D4E159 /* NJKWebViewProgress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NJKWebViewProgress.h; path = NJKWebViewProgress/NJKWebViewProgress.h; sourceTree = SOURCE_ROOT; }; 2677297217245E5C00D4E159 /* NJKWebViewProgress.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NJKWebViewProgress.m; path = NJKWebViewProgress/NJKWebViewProgress.m; sourceTree = SOURCE_ROOT; }; 2677297417245E7900D4E159 /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = DemoApp/AppDelegate.h; sourceTree = SOURCE_ROOT; }; 2677297517245E7900D4E159 /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = DemoApp/AppDelegate.m; sourceTree = SOURCE_ROOT; }; @@ -39,6 +75,12 @@ 2677298417245EA000D4E159 /* DemoApp-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "DemoApp-Prefix.pch"; path = "DemoApp/DemoApp-Prefix.pch"; sourceTree = SOURCE_ROOT; }; 2677298717245EB000D4E159 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = InfoPlist.strings; sourceTree = ""; }; 2677298917245EB000D4E159 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = en; path = MainStoryboard.storyboard; sourceTree = ""; }; + 26A4566D1E6A7921000E2746 /* NJKWebViewProgress.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = NJKWebViewProgress.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 26A456701E6A7921000E2746 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 26A4567C1E6A7A98000E2746 /* NJKWebViewProgress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NJKWebViewProgress.h; sourceTree = ""; }; + 26E1F3311E6A6F42000FBC08 /* NJKWebViewProgressTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NJKWebViewProgressTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 26E1F3331E6A6F42000FBC08 /* NJKWebViewProgressTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NJKWebViewProgressTests.m; sourceTree = ""; }; + 26E1F3351E6A6F42000FBC08 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 26E57446172235B500203262 /* DemoApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DemoApp.app; sourceTree = BUILT_PRODUCTS_DIR; }; 26E57449172235B500203262 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 26E5744B172235B500203262 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; @@ -46,11 +88,27 @@ /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + 26A456691E6A7921000E2746 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 26E1F32E1E6A6F42000FBC08 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 26A4567F1E6A7B11000E2746 /* NJKWebViewProgress.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 26E57443172235B500203262 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 26E5744A172235B500203262 /* UIKit.framework in Frameworks */, + 26A456741E6A7921000E2746 /* NJKWebViewProgress.framework in Frameworks */, 26E5744C172235B500203262 /* Foundation.framework in Frameworks */, 26E5744E172235B500203262 /* CoreGraphics.framework in Frameworks */, ); @@ -59,31 +117,43 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 260C2938183713360099D1B6 /* NJKWebViewProgress */ = { + 2677298517245EB000D4E159 /* en.lproj */ = { + isa = PBXGroup; + children = ( + 2677298617245EB000D4E159 /* InfoPlist.strings */, + 2677298817245EB000D4E159 /* MainStoryboard.storyboard */, + ); + name = en.lproj; + path = DemoApp/en.lproj; + sourceTree = SOURCE_ROOT; + }; + 26A4566E1E6A7921000E2746 /* NJKWebViewProgress */ = { isa = PBXGroup; children = ( - 2677297117245E5C00D4E159 /* NJKWebViewProgress.h */, + 26A4567C1E6A7A98000E2746 /* NJKWebViewProgress.h */, 2677297217245E5C00D4E159 /* NJKWebViewProgress.m */, 260C2935183704EE0099D1B6 /* NJKWebViewProgressView.h */, 260C2936183704EE0099D1B6 /* NJKWebViewProgressView.m */, + 26A456701E6A7921000E2746 /* Info.plist */, ); - name = NJKWebViewProgress; + path = NJKWebViewProgress; sourceTree = ""; }; - 2677298517245EB000D4E159 /* en.lproj */ = { + 26E1F3321E6A6F42000FBC08 /* NJKWebViewProgressTests */ = { isa = PBXGroup; children = ( - 2677298617245EB000D4E159 /* InfoPlist.strings */, - 2677298817245EB000D4E159 /* MainStoryboard.storyboard */, + 26E1F3331E6A6F42000FBC08 /* NJKWebViewProgressTests.m */, + 26E1F3351E6A6F42000FBC08 /* Info.plist */, ); - name = en.lproj; - path = DemoApp/en.lproj; - sourceTree = SOURCE_ROOT; + path = NJKWebViewProgressTests; + sourceTree = ""; }; 26E5743D172235B500203262 = { isa = PBXGroup; children = ( + 26A4566E1E6A7921000E2746 /* NJKWebViewProgress */, 26E5744F172235B500203262 /* DemoApp */, + 26E1F3321E6A6F42000FBC08 /* NJKWebViewProgressTests */, 26E57448172235B500203262 /* Frameworks */, 26E57447172235B500203262 /* Products */, ); @@ -93,6 +163,8 @@ isa = PBXGroup; children = ( 26E57446172235B500203262 /* DemoApp.app */, + 26E1F3311E6A6F42000FBC08 /* NJKWebViewProgressTests.xctest */, + 26A4566D1E6A7921000E2746 /* NJKWebViewProgress.framework */, ); name = Products; sourceTree = ""; @@ -110,7 +182,6 @@ 26E5744F172235B500203262 /* DemoApp */ = { isa = PBXGroup; children = ( - 260C2938183713360099D1B6 /* NJKWebViewProgress */, 2677297417245E7900D4E159 /* AppDelegate.h */, 2677297517245E7900D4E159 /* AppDelegate.m */, 2677297617245E7900D4E159 /* ViewController.h */, @@ -137,7 +208,54 @@ }; /* End PBXGroup section */ +/* Begin PBXHeadersBuildPhase section */ + 26A4566A1E6A7921000E2746 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 26A4567D1E6A7A98000E2746 /* NJKWebViewProgress.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + /* Begin PBXNativeTarget section */ + 26A4566C1E6A7921000E2746 /* NJKWebViewProgress */ = { + isa = PBXNativeTarget; + buildConfigurationList = 26A456761E6A7921000E2746 /* Build configuration list for PBXNativeTarget "NJKWebViewProgress" */; + buildPhases = ( + 26A456681E6A7921000E2746 /* Sources */, + 26A456691E6A7921000E2746 /* Frameworks */, + 26A4566A1E6A7921000E2746 /* Headers */, + 26A4566B1E6A7921000E2746 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = NJKWebViewProgress; + productName = NJKWebViewProgress; + productReference = 26A4566D1E6A7921000E2746 /* NJKWebViewProgress.framework */; + productType = "com.apple.product-type.framework"; + }; + 26E1F3301E6A6F42000FBC08 /* NJKWebViewProgressTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 26E1F3361E6A6F42000FBC08 /* Build configuration list for PBXNativeTarget "NJKWebViewProgressTests" */; + buildPhases = ( + 26E1F32D1E6A6F42000FBC08 /* Sources */, + 26E1F32E1E6A6F42000FBC08 /* Frameworks */, + 26E1F32F1E6A6F42000FBC08 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 26A456821E6A865F000E2746 /* PBXTargetDependency */, + ); + name = NJKWebViewProgressTests; + productName = NJKWebViewProgressTests; + productReference = 26E1F3311E6A6F42000FBC08 /* NJKWebViewProgressTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; 26E57445172235B500203262 /* DemoApp */ = { isa = PBXNativeTarget; buildConfigurationList = 26E57469172235B500203262 /* Build configuration list for PBXNativeTarget "DemoApp" */; @@ -145,10 +263,12 @@ 26E57442172235B500203262 /* Sources */, 26E57443172235B500203262 /* Frameworks */, 26E57444172235B500203262 /* Resources */, + 26A456791E6A7921000E2746 /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( + 26A456731E6A7921000E2746 /* PBXTargetDependency */, ); name = DemoApp; productName = WebViewSample; @@ -161,10 +281,20 @@ 26E5743E172235B500203262 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0460; + LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Satoshi Asano"; + TargetAttributes = { + 26A4566C1E6A7921000E2746 = { + CreatedOnToolsVersion = 8.2.1; + ProvisioningStyle = Automatic; + }; + 26E1F3301E6A6F42000FBC08 = { + CreatedOnToolsVersion = 8.2.1; + ProvisioningStyle = Automatic; + }; + }; }; - buildConfigurationList = 26E57441172235B500203262 /* Build configuration list for PBXProject "DemoApp" */; + buildConfigurationList = 26E57441172235B500203262 /* Build configuration list for PBXProject "NJKWebViewProgress" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -177,11 +307,27 @@ projectRoot = ""; targets = ( 26E57445172235B500203262 /* DemoApp */, + 26E1F3301E6A6F42000FBC08 /* NJKWebViewProgressTests */, + 26A4566C1E6A7921000E2746 /* NJKWebViewProgress */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + 26A4566B1E6A7921000E2746 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 26E1F32F1E6A6F42000FBC08 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 26E57444172235B500203262 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -197,12 +343,28 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + 26A456681E6A7921000E2746 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 26A4567A1E6A7945000E2746 /* NJKWebViewProgress.m in Sources */, + 26A4567B1E6A7947000E2746 /* NJKWebViewProgressView.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 26E1F32D1E6A6F42000FBC08 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 26E1F3341E6A6F42000FBC08 /* NJKWebViewProgressTests.m in Sources */, + 26A456671E6A78B7000E2746 /* NJKWebViewProgress.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 26E57442172235B500203262 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2677297317245E5C00D4E159 /* NJKWebViewProgress.m in Sources */, - 260C2937183704EE0099D1B6 /* NJKWebViewProgressView.m in Sources */, 2677297817245E7900D4E159 /* AppDelegate.m in Sources */, 2677297917245E7900D4E159 /* ViewController.m in Sources */, 2677298117245E8E00D4E159 /* main.m in Sources */, @@ -211,6 +373,19 @@ }; /* End PBXSourcesBuildPhase section */ +/* Begin PBXTargetDependency section */ + 26A456731E6A7921000E2746 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 26A4566C1E6A7921000E2746 /* NJKWebViewProgress */; + targetProxy = 26A456721E6A7921000E2746 /* PBXContainerItemProxy */; + }; + 26A456821E6A865F000E2746 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 26E57445172235B500203262 /* DemoApp */; + targetProxy = 26A456811E6A865F000E2746 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + /* Begin PBXVariantGroup section */ 2677298617245EB000D4E159 /* InfoPlist.strings */ = { isa = PBXVariantGroup; @@ -231,6 +406,112 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ + 26A456771E6A7921000E2746 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CODE_SIGN_IDENTITY = ""; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = NJKWebViewProgress/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.ninjinkun.NJKWebViewProgress; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 26A456781E6A7921000E2746 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CODE_SIGN_IDENTITY = ""; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_NS_ASSERTIONS = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = NJKWebViewProgress/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = com.ninjinkun.NJKWebViewProgress; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 26E1F3371E6A6F42000FBC08 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = NJKWebViewProgressTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.ninjinkun.NJKWebViewProgressTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 26E1F3381E6A6F42000FBC08 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CLANG_ANALYZER_NONNULL = YES; + CLANG_ENABLE_MODULES = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + INFOPLIST_FILE = NJKWebViewProgressTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = com.ninjinkun.NJKWebViewProgressTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; 26E57467172235B500203262 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -238,27 +519,38 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; + "TEST_HOST[sdk=*]" = ""; }; name = Debug; }; @@ -269,18 +561,27 @@ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 6.1; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; SDKROOT = iphoneos; VALIDATE_PRODUCT = YES; @@ -293,7 +594,9 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "DemoApp/DemoApp-Prefix.pch"; INFOPLIST_FILE = "DemoApp/DemoApp-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.ninjinkun.webviewprogress.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; WRAPPER_EXTENSION = app; @@ -306,7 +609,9 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "DemoApp/DemoApp-Prefix.pch"; INFOPLIST_FILE = "DemoApp/DemoApp-Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 7.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.ninjinkun.webviewprogress.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; TARGETED_DEVICE_FAMILY = "1,2"; WRAPPER_EXTENSION = app; @@ -316,7 +621,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 26E57441172235B500203262 /* Build configuration list for PBXProject "DemoApp" */ = { + 26A456761E6A7921000E2746 /* Build configuration list for PBXNativeTarget "NJKWebViewProgress" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 26A456771E6A7921000E2746 /* Debug */, + 26A456781E6A7921000E2746 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 26E1F3361E6A6F42000FBC08 /* Build configuration list for PBXNativeTarget "NJKWebViewProgressTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 26E1F3371E6A6F42000FBC08 /* Debug */, + 26E1F3381E6A6F42000FBC08 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 26E57441172235B500203262 /* Build configuration list for PBXProject "NJKWebViewProgress" */ = { isa = XCConfigurationList; buildConfigurations = ( 26E57467172235B500203262 /* Debug */, diff --git a/NJKWebViewProgress.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/NJKWebViewProgress.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..ad8569c --- /dev/null +++ b/NJKWebViewProgress.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/NJKWebViewProgress.xcodeproj/xcshareddata/xcschemes/NJKWebViewProgress.xcscheme b/NJKWebViewProgress.xcodeproj/xcshareddata/xcschemes/NJKWebViewProgress.xcscheme new file mode 100644 index 0000000..7c466e0 --- /dev/null +++ b/NJKWebViewProgress.xcodeproj/xcshareddata/xcschemes/NJKWebViewProgress.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NJKWebViewProgress.xcodeproj/xcshareddata/xcschemes/NJKWebViewProgressTests.xcscheme b/NJKWebViewProgress.xcodeproj/xcshareddata/xcschemes/NJKWebViewProgressTests.xcscheme new file mode 100644 index 0000000..677937a --- /dev/null +++ b/NJKWebViewProgress.xcodeproj/xcshareddata/xcschemes/NJKWebViewProgressTests.xcscheme @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NJKWebViewProgress/Info.plist b/NJKWebViewProgress/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/NJKWebViewProgress/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/NJKWebViewProgress/NJKWebViewProgress-Prefix.h b/NJKWebViewProgress/NJKWebViewProgress-Prefix.h new file mode 100644 index 0000000..69dcae3 --- /dev/null +++ b/NJKWebViewProgress/NJKWebViewProgress-Prefix.h @@ -0,0 +1,11 @@ +#import +#import "NJKWebViewProgress.h" +//! Project version number for NJKWebViewProgress. +FOUNDATION_EXPORT double NJKWebViewProgressVersionNumber; + +//! Project version string for NJKWebViewProgress. +FOUNDATION_EXPORT const unsigned char NJKWebViewProgressVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/NJKWebViewProgress/NJKWebViewProgress.h b/NJKWebViewProgress/NJKWebViewProgress.h index 1e1ac3e..acf32d7 100644 --- a/NJKWebViewProgress/NJKWebViewProgress.h +++ b/NJKWebViewProgress/NJKWebViewProgress.h @@ -15,6 +15,9 @@ #define njk_weak unsafe_unretained #endif +FOUNDATION_EXPORT double NJKWebViewProgressVersionNumber; +FOUNDATION_EXPORT const unsigned char NJKWebViewProgressVersionString[]; + extern const float NJKInitialProgressValue; extern const float NJKInteractiveProgressValue; extern const float NJKFinalProgressValue; diff --git a/NJKWebViewProgressTests/Info.plist b/NJKWebViewProgressTests/Info.plist new file mode 100644 index 0000000..6c6c23c --- /dev/null +++ b/NJKWebViewProgressTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/NJKWebViewProgressTests/NJKWebViewProgressTests.m b/NJKWebViewProgressTests/NJKWebViewProgressTests.m new file mode 100644 index 0000000..9e073fb --- /dev/null +++ b/NJKWebViewProgressTests/NJKWebViewProgressTests.m @@ -0,0 +1,70 @@ +// +// NJKWebViewProgressTests.m +// +// Created by Satoshi Aasano on 3/4/17. +// Copyright (c) 2017 Satoshi Asano. All rights reserved. +// + +#import +#import +#import "NJKWebViewProgress.h" + +@interface NJKWebViewProgressTests : XCTestCase +@property (nonatomic) NJKWebViewProgress *progressProxy; +@property (nonatomic) UIWebView *webView; +@property (nonatomic) float progressValue; +@property (nonatomic) XCTestExpectation *firstExpectation; +@property (nonatomic) XCTestExpectation *intermidiateExpectation; +@property (nonatomic) BOOL intermidiateLoaded; +@property (nonatomic) XCTestExpectation *loadedExpactation; +@end + +@implementation NJKWebViewProgressTests + +- (void)setUp { + [super setUp]; + + _webView = [[UIWebView alloc] init]; + _progressProxy = [[NJKWebViewProgress alloc] init]; + _webView.delegate = _progressProxy; + _progressProxy.webViewProxyDelegate = self; + _progressProxy.progressDelegate = self; +} + +- (void)tearDown { + [super tearDown]; +} + +- (void)testLoadWebPage { + NSURLRequest *req = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://google.com/"]]; + [_webView loadRequest:req]; + + _firstExpectation = [self expectationWithDescription:@"first"]; + _intermidiateExpectation = [self expectationWithDescription:@"interamidiate"]; + _loadedExpactation = [self expectationWithDescription:@"loaded"]; + + [self waitForExpectationsWithTimeout:10 handler:^(NSError * _Nullable error) { + + }]; +} + +#pragma mark - NJKWebViewProgressDelegate + +- (void)webViewProgress:(NJKWebViewProgress *)webViewProgress updateProgress:(float)progress { + if (progress <= 0.1) { + [_firstExpectation fulfill]; + } + + if (progress > 0.1 && progress < 0.9 && !_intermidiateLoaded) { + [_intermidiateExpectation fulfill]; + _intermidiateLoaded = YES; + } + + if (progress >= 1.0) { + [_loadedExpactation fulfill]; + } + + _progressValue = progress; +} + +@end diff --git a/README.md b/README.md index d8c445b..2a9e25b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # NJKWebViewProgress + +[![Build Status](https://travis-ci.org/ninjinkun/NJKWebViewProgress.svg?branch=master)](https://travis-ci.org/ninjinkun/NJKWebViewProgress) + NJKWebViewProgress is a progress interface library for UIWebView. Currently, UIWebView doesn't have official progress interface. You can implement progress bar for your in-app browser using this module. iOS ScreenShot 1