Skip to content

Commit

Permalink
Replace the UIWebView resolver with one based on libxml2
Browse files Browse the repository at this point in the history
  • Loading branch information
Conrad Kramer committed May 1, 2014
1 parent f7f65de commit 9dee894
Show file tree
Hide file tree
Showing 7 changed files with 303 additions and 333 deletions.
2 changes: 2 additions & 0 deletions Bolts.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Pod::Spec.new do |s|
s.requires_arc = true

s.source_files = 'Bolts'
s.libraries = 'xml2'
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }

s.public_header_files = 'Bolts/**/*.h'
end
38 changes: 30 additions & 8 deletions Bolts.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
1E45E47618DA7F0000D23509 /* BFAppLinkResolving.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1EC3019318CDD79F00D06D07 /* BFAppLinkResolving.h */; };
1E45E47718DA7F0000D23509 /* BFAppLinkTarget.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1E11AB7C18C7C50800522739 /* BFAppLinkTarget.h */; };
1E45E47818DA7F0000D23509 /* BFURL.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1E11AB7718C561E300522739 /* BFURL.h */; };
1E45E47918DA7F0000D23509 /* BFWebViewAppLinkResolver.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1EC3019418CDD8A500D06D07 /* BFWebViewAppLinkResolver.h */; };
1E45E47918DA7F0000D23509 /* BFXMLAppLinkResolver.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1EC3019418CDD8A500D06D07 /* BFXMLAppLinkResolver.h */; };
1E9BF8DC18EA0CAD00514B1E /* test.html in Resources */ = {isa = PBXBuildFile; fileRef = 1E9BF8DB18EA0CAD00514B1E /* test.html */; };
1EC3016118CDAA8400D06D07 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E9C3CEC17DE9DE000427E62 /* Foundation.framework */; };
1EC3016318CDAA8400D06D07 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EC3016218CDAA8400D06D07 /* CoreGraphics.framework */; };
Expand All @@ -28,7 +28,7 @@
1EC3017318CDAA8400D06D07 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1EC3017218CDAA8400D06D07 /* Images.xcassets */; };
1EC3019118CDABCE00D06D07 /* AppLinkTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EC3019018CDABCE00D06D07 /* AppLinkTests.m */; };
1EC3019218CDB3CB00D06D07 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EC3016418CDAA8400D06D07 /* UIKit.framework */; };
1EC3019618CDD8A500D06D07 /* BFWebViewAppLinkResolver.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EC3019518CDD8A500D06D07 /* BFWebViewAppLinkResolver.m */; };
1EC3019618CDD8A500D06D07 /* BFXMLAppLinkResolver.m in Sources */ = {isa = PBXBuildFile; fileRef = 1EC3019518CDD8A500D06D07 /* BFXMLAppLinkResolver.m */; };
8550FD2218ECCF1600976B4B /* BFAppLinkReturnToRefererView.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 85D5138618E4E27700D19D87 /* BFAppLinkReturnToRefererView.h */; };
85D5138818E4E27700D19D87 /* BFAppLinkReturnToRefererView.m in Sources */ = {isa = PBXBuildFile; fileRef = 85D5138718E4E27700D19D87 /* BFAppLinkReturnToRefererView.m */; };
85D5138A18E4E45800D19D87 /* AppLinkReturnToRefererViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 85D5138918E4E45800D19D87 /* AppLinkReturnToRefererViewTests.m */; };
Expand Down Expand Up @@ -63,6 +63,8 @@
8EE768A81803E5DA009A53B1 /* BoltsVersion.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8E0B5CDA17E13B4C0066379B /* BoltsVersion.h */; };
8EE768A91803E5E0009A53B1 /* Bolts.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8EE768A61803E32F009A53B1 /* Bolts.h */; };
8EE768AA1803E5E5009A53B1 /* BoltsVersion.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8E0B5CDA17E13B4C0066379B /* BoltsVersion.h */; };
D029D2EB191220B900B62C70 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D029D2E919121FC600B62C70 /* libxml2.dylib */; };
D029D2EE191220C500B62C70 /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = D029D2E919121FC600B62C70 /* libxml2.dylib */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -103,7 +105,7 @@
1E45E47618DA7F0000D23509 /* BFAppLinkResolving.h in CopyFiles */,
1E45E47718DA7F0000D23509 /* BFAppLinkTarget.h in CopyFiles */,
1E45E47818DA7F0000D23509 /* BFURL.h in CopyFiles */,
1E45E47918DA7F0000D23509 /* BFWebViewAppLinkResolver.h in CopyFiles */,
1E45E47918DA7F0000D23509 /* BFXMLAppLinkResolver.h in CopyFiles */,
8E42701F1805E5A1000B84ED /* BFExecutor.h in CopyFiles */,
8EE768A81803E5DA009A53B1 /* BoltsVersion.h in CopyFiles */,
8EE768A71803E5D5009A53B1 /* Bolts.h in CopyFiles */,
Expand Down Expand Up @@ -168,8 +170,8 @@
1EC3017218CDAA8400D06D07 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
1EC3019018CDABCE00D06D07 /* AppLinkTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppLinkTests.m; sourceTree = "<group>"; };
1EC3019318CDD79F00D06D07 /* BFAppLinkResolving.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BFAppLinkResolving.h; sourceTree = "<group>"; };
1EC3019418CDD8A500D06D07 /* BFWebViewAppLinkResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BFWebViewAppLinkResolver.h; sourceTree = "<group>"; };
1EC3019518CDD8A500D06D07 /* BFWebViewAppLinkResolver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BFWebViewAppLinkResolver.m; sourceTree = "<group>"; };
1EC3019418CDD8A500D06D07 /* BFXMLAppLinkResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BFXMLAppLinkResolver.h; sourceTree = "<group>"; };
1EC3019518CDD8A500D06D07 /* BFXMLAppLinkResolver.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BFXMLAppLinkResolver.m; sourceTree = "<group>"; };
8550FD2E18EE1B7A00976B4B /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
85D5138618E4E27700D19D87 /* BFAppLinkReturnToRefererView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BFAppLinkReturnToRefererView.h; sourceTree = "<group>"; };
85D5138718E4E27700D19D87 /* BFAppLinkReturnToRefererView.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = BFAppLinkReturnToRefererView.m; sourceTree = "<group>"; tabWidth = 4; wrapsLines = 1; };
Expand Down Expand Up @@ -199,13 +201,15 @@
8EB2CB411805DDDB00323385 /* BFExecutor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BFExecutor.m; sourceTree = "<group>"; };
8EDDA63517E17DDD00655F8A /* libMacBolts.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libMacBolts.a; sourceTree = BUILT_PRODUCTS_DIR; };
8EE768A61803E32F009A53B1 /* Bolts.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Bolts.h; sourceTree = "<group>"; };
D029D2E919121FC600B62C70 /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = usr/lib/libxml2.dylib; sourceTree = SDKROOT; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
1EC3015D18CDAA8300D06D07 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D029D2EE191220C500B62C70 /* libxml2.dylib in Frameworks */,
1EC3016318CDAA8400D06D07 /* CoreGraphics.framework in Frameworks */,
1EC3016518CDAA8400D06D07 /* UIKit.framework in Frameworks */,
1EC3016118CDAA8400D06D07 /* Foundation.framework in Frameworks */,
Expand All @@ -216,6 +220,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D029D2EB191220B900B62C70 /* libxml2.dylib in Frameworks */,
1EC3019218CDB3CB00D06D07 /* UIKit.framework in Frameworks */,
8E8C8EFC17F23E6E00E3F1C7 /* libBolts.a in Frameworks */,
8E8C8EEA17F23D1D00E3F1C7 /* XCTest.framework in Frameworks */,
Expand Down Expand Up @@ -325,6 +330,7 @@
8E9C3CEB17DE9DE000427E62 /* Frameworks */ = {
isa = PBXGroup;
children = (
D029D2E919121FC600B62C70 /* libxml2.dylib */,
8E9C3CEC17DE9DE000427E62 /* Foundation.framework */,
8E9C3CFB17DE9DE000427E62 /* SenTestingKit.framework */,
8E8C8ED217F23C3B00E3F1C7 /* XCTest.framework */,
Expand Down Expand Up @@ -357,8 +363,8 @@
8E9C3D2117DEA35700427E62 /* BFTaskCompletionSource.m */,
1E11AB7718C561E300522739 /* BFURL.h */,
1E11AB7818C561E300522739 /* BFURL.m */,
1EC3019418CDD8A500D06D07 /* BFWebViewAppLinkResolver.h */,
1EC3019518CDD8A500D06D07 /* BFWebViewAppLinkResolver.m */,
1EC3019418CDD8A500D06D07 /* BFXMLAppLinkResolver.h */,
1EC3019518CDD8A500D06D07 /* BFXMLAppLinkResolver.m */,
8EE768A61803E32F009A53B1 /* Bolts.h */,
8EA6BF661805CED500337041 /* Bolts.m */,
8E0B5CDA17E13B4C0066379B /* BoltsVersion.h */,
Expand Down Expand Up @@ -576,7 +582,7 @@
8EB2CB421805DDDB00323385 /* BFExecutor.m in Sources */,
8E9C3D2417DEA35700427E62 /* BFTaskCompletionSource.m in Sources */,
85EEE11B18FCAB370007510B /* BFAppLinkReturnToRefererController.m in Sources */,
1EC3019618CDD8A500D06D07 /* BFWebViewAppLinkResolver.m in Sources */,
1EC3019618CDD8A500D06D07 /* BFXMLAppLinkResolver.m in Sources */,
1E11AB7918C561E300522739 /* BFAppLinkNavigation.m in Sources */,
85D5138818E4E27700D19D87 /* BFAppLinkReturnToRefererView.m in Sources */,
);
Expand Down Expand Up @@ -944,6 +950,10 @@
DSTROOT = /tmp/Bolts.dst;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Bolts/Bolts-Prefix.pch";
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SDKROOT)/usr/include/libxml2",
);
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -962,6 +972,10 @@
DSTROOT = /tmp/Bolts.dst;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Bolts/Bolts-Prefix.pch";
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SDKROOT)/usr/include/libxml2",
);
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -1035,6 +1049,10 @@
DSTROOT = /tmp/Bolts.dst;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Bolts/Bolts-Prefix.pch";
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SDKROOT)/usr/include/libxml2",
);
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -1152,6 +1170,10 @@
DSTROOT = /tmp/Bolts.dst;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "Bolts/Bolts-Prefix.pch";
HEADER_SEARCH_PATHS = (
"$(inherited)",
"$(SDKROOT)/usr/include/libxml2",
);
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
4 changes: 2 additions & 2 deletions Bolts/BFAppLinkNavigation.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#import "BFTaskCompletionSource.h"
#import "BFAppLinkTarget.h"
#import "BoltsVersion.h"
#import "BFWebViewAppLinkResolver.h"
#import "BFXMLAppLinkResolver.h"
#import "BFExecutor.h"
#import "BFTask.h"

Expand Down Expand Up @@ -176,7 +176,7 @@ + (BFAppLinkNavigationType)navigateToAppLink:(BFAppLink *)link error:(NSError **
if (defaultResolver) {
return defaultResolver;
}
return [BFWebViewAppLinkResolver sharedInstance];
return [BFXMLAppLinkResolver sharedInstance];
}

+ (void)setDefaultResolver:(id<BFAppLinkResolving>)resolver {
Expand Down
Loading

0 comments on commit 9dee894

Please sign in to comment.