Skip to content

Commit

Permalink
Update Podspec to exclude C++ and Obj-C++ from public headers. This p…
Browse files Browse the repository at this point in the history
…revents Swift from trying to import C++ symbols in the umbrella header, which fixes Swift compatibility.
  • Loading branch information
CooperCorona committed Apr 1, 2021
1 parent 84e9b85 commit d9161c0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
12 changes: 10 additions & 2 deletions GTXiLib.podspec
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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++'
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d9161c0

Please sign in to comment.