Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt .apollo.method() namespacing for extensions #1256

Merged
merged 17 commits into from
Jun 12, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update bundle extension to use apollo namespace
  • Loading branch information
designatednerd committed Jun 11, 2020
commit 37e0646a9c05bd9370ffcc447505242db9423148
7 changes: 5 additions & 2 deletions Sources/Apollo/Bundle+Helpers.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import Foundation
import ApolloCore

extension Bundle {
extension Bundle: ApolloCompatible {}

extension ApolloExtension where Base == Bundle {

/// Type-safe getter for info dictionary key objects
///
/// - Parameter key: The key to try to grab an object for
/// - Returns: The object of the desired type, or nil if it is not present or of the incorrect type.
func bundleValue<T>(forKey key: String) -> T? {
return object(forInfoDictionaryKey: key) as? T
return base.object(forInfoDictionaryKey: key) as? T
}

/// The bundle identifier of this bundle, or nil if not present.
Expand Down
4 changes: 2 additions & 2 deletions Sources/Apollo/NetworkTransport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ public extension NetworkTransport {
/// The default client version to use when setting up the `clientVersion` property.
static var defaultClientVersion: String {
var version = String()
if let shortVersion = Bundle.main.shortVersion {
if let shortVersion = Bundle.main.apollo.shortVersion {
version.append(shortVersion)
}

if let buildNumber = Bundle.main.buildNumber {
if let buildNumber = Bundle.main.apollo.buildNumber {
if version.isEmpty {
version.append(buildNumber)
} else {
Expand Down