Skip to content

Commit d9161c0

Browse files
committed
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.
1 parent 84e9b85 commit d9161c0

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

GTXiLib.podspec

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "GTXiLib"
3-
s.version = "4.3"
3+
s.version = "4.4"
44
s.summary = "iOS Accessibility testing library."
55
s.description = <<-DESC
66
iOS Accessibility testing library that works with XCTest based frameworks.
@@ -9,8 +9,16 @@ Pod::Spec.new do |s|
99
s.license = "Apache License 2.0"
1010
s.author = "j-sid"
1111
s.platform = :ios
12-
s.source = { :git => "https://github.com/google/GTXiLib.git", :tag => "4.3.0" }
12+
s.source = { :git => "https://github.com/google/GTXiLib.git", :tag => "4.4.0" }
1313
s.source_files = "{Classes,OOPClasses}/**/*.{h,m,swift,mm,cc}"
14+
s.public_header_files = "Classes/**/*.h"
15+
s.private_header_files = [
16+
"Classes/GTXImageRGBAData+GTXOOPAdditions.h",
17+
"Classes/GTXToolKit+GTXOOPAdditions.h",
18+
"Classes/NSObject+GTXAdditions.h",
19+
"Classes/NSString+GTXAdditions.h",
20+
"Classes/UIColor+GTXOOPAdditions.h"
21+
]
1422
s.ios.deployment_target = '9.0'
1523
s.libraries = 'c++'
1624
s.dependency 'Protobuf-C++'

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ To add GTXiLib to your project use the xcodeproj file in this project or
7777
using the xcodeproj file you must also link to the [C++ protobuf library](https://github.com/protocolbuffers/protobuf/tree/master/src) and reference
7878
headers under "GTXiLib > Build Settings > Header Search Paths".
7979
80+
## CocoaPods and Swift
81+
GTXiLib supports Swift projects. The installation instructions are almost the same as for Objective-C projects. Your `Podfile` should look like
82+
```
83+
use_modular_headers!
84+
target "NameOfYourProject" do
85+
pod "GTXiLib"
86+
end
87+
```
88+
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.
89+
8090
## Incremental Accessibility
8191
8292
GTXiLib APIs support a practical solution for improving accessibility of large

0 commit comments

Comments
 (0)