-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6446ecb
commit b637552
Showing
32 changed files
with
435 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
1 change: 1 addition & 0 deletions
1
...ndexMobileAdsExample/YandexMobileAdsExample/Accessibility/YandexNativeAccessibility.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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
enum YandexNativeAccessibility { | ||
static let template = "template" | ||
static let custom = "custom" | ||
static let bulk = "bulk" | ||
} |
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
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
79 changes: 79 additions & 0 deletions
79
...xMobileAdsExample/YandexMobileAdsExample/Yandex/Native/Bulk/NativeBulkTableViewCell.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,79 @@ | ||
/* | ||
* Version for iOS © 2015–2023 YANDEX | ||
* | ||
* You may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at https://yandex.com/legal/mobileads_sdk_agreement/ | ||
*/ | ||
|
||
import YandexMobileAds | ||
|
||
final class NativeBulkTableViewCell: UITableViewCell { | ||
static var reuseIdentifier: String { String(describing: Self.self) } | ||
|
||
private let adView: NativeCustomAdView = .init() | ||
|
||
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { | ||
super.init(style: style, reuseIdentifier: reuseIdentifier) | ||
setupViews() | ||
} | ||
|
||
@available(*, unavailable) | ||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
|
||
private func setupViews() { | ||
adView.translatesAutoresizingMaskIntoConstraints = false | ||
contentView.addSubview(adView) | ||
|
||
let margins = contentView.layoutMarginsGuide | ||
|
||
NSLayoutConstraint.activate([ | ||
adView.topAnchor.constraint(equalTo: margins.topAnchor), | ||
adView.leadingAnchor.constraint(equalTo: margins.leadingAnchor), | ||
adView.trailingAnchor.constraint(equalTo: margins.trailingAnchor), | ||
adView.bottomAnchor.constraint(equalTo: margins.bottomAnchor), | ||
]) | ||
} | ||
|
||
public func bindNativeAd(_ ad: NativeAd) { | ||
ad.delegate = self | ||
do { | ||
try ad.bind(with: adView) | ||
adView.isHidden = false | ||
adView.callToActionButton?.accessibilityIdentifier = "call" | ||
setNeedsLayout() | ||
layoutIfNeeded() | ||
} catch { | ||
print("Binding error: \(error)") | ||
} | ||
} | ||
} | ||
|
||
// MARK: - YMANativeAdDelegate | ||
|
||
extension NativeBulkTableViewCell: NativeAdDelegate { | ||
func nativeAdDidClick(_ ad: NativeAd) { | ||
print(#function) | ||
} | ||
|
||
func nativeAdWillLeaveApplication(_ ad: NativeAd) { | ||
print(#function) | ||
} | ||
|
||
func nativeAd(_ ad: NativeAd, willPresentScreen viewController: UIViewController?) { | ||
print(#function) | ||
} | ||
|
||
func nativeAd(_ ad: NativeAd, didTrackImpressionWith impressionData: ImpressionData?) { | ||
print(#function) | ||
} | ||
|
||
func nativeAd(_ ad: NativeAd, didDismissScreen viewController: UIViewController?) { | ||
print(#function) | ||
} | ||
|
||
func close(_ ad: NativeAd) { | ||
print(#function) | ||
} | ||
} |
Oops, something went wrong.