From d9161c0cefd07556cd97739fdc8862a2711bc1d3 Mon Sep 17 00:00:00 2001 From: CooperCorona Date: Thu, 1 Apr 2021 14:26:17 -0700 Subject: [PATCH] Update Podspec to exclude C++ and Obj-C++ from public headers. This prevents Swift from trying to import C++ symbols in the umbrella header, which fixes Swift compatibility. --- GTXiLib.podspec | 12 ++++++++++-- README.md | 10 ++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/GTXiLib.podspec b/GTXiLib.podspec index 5148a8a..f30cb28 100644 --- a/GTXiLib.podspec +++ b/GTXiLib.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "GTXiLib" - s.version = "4.3" + s.version = "4.4" s.summary = "iOS Accessibility testing library." s.description = <<-DESC iOS Accessibility testing library that works with XCTest based frameworks. @@ -9,8 +9,16 @@ Pod::Spec.new do |s| s.license = "Apache License 2.0" s.author = "j-sid" s.platform = :ios - s.source = { :git => "https://github.com/google/GTXiLib.git", :tag => "4.3.0" } + s.source = { :git => "https://github.com/google/GTXiLib.git", :tag => "4.4.0" } s.source_files = "{Classes,OOPClasses}/**/*.{h,m,swift,mm,cc}" + s.public_header_files = "Classes/**/*.h" + s.private_header_files = [ + "Classes/GTXImageRGBAData+GTXOOPAdditions.h", + "Classes/GTXToolKit+GTXOOPAdditions.h", + "Classes/NSObject+GTXAdditions.h", + "Classes/NSString+GTXAdditions.h", + "Classes/UIColor+GTXOOPAdditions.h" + ] s.ios.deployment_target = '9.0' s.libraries = 'c++' s.dependency 'Protobuf-C++' diff --git a/README.md b/README.md index ccbfeb3..813f1dd 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,16 @@ To add GTXiLib to your project use the xcodeproj file in this project or using the xcodeproj file you must also link to the [C++ protobuf library](https://github.com/protocolbuffers/protobuf/tree/master/src) and reference headers under "GTXiLib > Build Settings > Header Search Paths". +## CocoaPods and Swift +GTXiLib supports Swift projects. The installation instructions are almost the same as for Objective-C projects. Your `Podfile` should look like +``` +use_modular_headers! +target "NameOfYourProject" do + pod "GTXiLib" +end +``` +with an optional version specifier for "GTXiLib". Note the `use_modular_headers!` line and the **lack** of `use_frameworks!`. As of [CocoaPods 1.5.0](https://blog.cocoapods.org/CocoaPods-1.5.0/), `use_frameworks!` is no longer required for Swift projects. `use_frameworks!` makes `Protobuf-C++`, which is a dependency of `GTXiLib`, fail to import properly. Thus, you cannot use `use_frameworks!`, which means you must use `use_modular_headers!`. You may also specify `:modular_headers => true` on a per-pod basis. Then, add `import GTXiLib` to your Swift files, and you can use GTXiLib APIs. + ## Incremental Accessibility GTXiLib APIs support a practical solution for improving accessibility of large