-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #419 from DataDog/ncreated/RUMM-1097-fix-default-r…
…um-predicate-for-objc RUMM-1097 Fix `DefaultUIKitRUMViewsPredicate` for Objc view controllers
- Loading branch information
Showing
12 changed files
with
175 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
*/ | ||
|
||
#import "NSURLSessionBridge.h" | ||
#import "CustomObjcViewController.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
Tests/DatadogTests/Datadog/Utils/UIKitExtensionsTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2019-2020 Datadog, Inc. | ||
*/ | ||
|
||
import XCTest | ||
import UIKit | ||
@testable import Datadog | ||
|
||
class CustomSwiftViewController: UIViewController {} | ||
|
||
class UIKitExtensionsTests: XCTestCase { | ||
func testViewControllerCanonicalClassName() { | ||
let swiftViewController = CustomSwiftViewController() | ||
let objcViewController = CustomObjcViewController() | ||
|
||
XCTAssertEqual(swiftViewController.canonicalClassName, "DatadogTests.CustomSwiftViewController") | ||
XCTAssertEqual(objcViewController.canonicalClassName, "CustomObjcViewController") | ||
} | ||
|
||
func testBundleIsUIKit() { | ||
let someUIKitClasses: [AnyClass] = [ | ||
UIViewController.self, | ||
UIButton.self, | ||
UINavigationBar.self, | ||
UIScrollView.self | ||
] | ||
|
||
let someNonUIKitClasses: [AnyClass] = [ | ||
CustomSwiftViewController.self, | ||
CustomObjcViewController.self, | ||
OperationQueue.self, | ||
] | ||
|
||
someUIKitClasses.forEach { XCTAssertTrue(Bundle(for: $0).isUIKit) } | ||
someNonUIKitClasses.forEach { XCTAssertFalse(Bundle(for: $0).isUIKit) } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2019-2020 Datadog, Inc. | ||
*/ | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface CustomObjcViewController : UIViewController | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2019-2020 Datadog, Inc. | ||
*/ | ||
|
||
#import "CustomObjcViewController.h" | ||
|
||
@interface CustomObjcViewController () | ||
|
||
@end | ||
|
||
@implementation CustomObjcViewController | ||
|
||
- (void)viewDidLoad { | ||
[super viewDidLoad]; | ||
} | ||
|
||
@end |