63 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Swift
		
	
	
		
		
			
		
	
	
			63 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Swift
		
	
	
|  | // GuruMRecAd.swift | ||
|  | // Base class for MRec ad implementations | ||
|  | // Corresponds to GuruMRecAd.kt in Android implementation | ||
|  | 
 | ||
|  | import Foundation | ||
|  | import UIKit | ||
|  | 
 | ||
|  | open class GuruMRecAd: RelayAd { | ||
|  |     public let adUnitId: String | ||
|  |     public let adPlatform: AdPlatform | ||
|  |      | ||
|  |     public let adType = AdType.MRec | ||
|  |      | ||
|  |     private let name: String | ||
|  |      | ||
|  |     public init(engineId: Int, adUnitId: String, adPlatform: AdPlatform) { | ||
|  |         self.adUnitId = adUnitId | ||
|  |         self.adPlatform = adPlatform | ||
|  |         self.name = "[MREC-\(adPlatform)]" | ||
|  |         super.init(engineId: engineId) | ||
|  |     } | ||
|  |      | ||
|  |     // MARK: - Logging Methods | ||
|  |      | ||
|  |     public func logWarn(_ message: String) { | ||
|  |         Logger.w(tag: "MRecAd", message: "\(name) \(message)") | ||
|  |     } | ||
|  |      | ||
|  |     public func logDebug(_ message: String) { | ||
|  |         Logger.d(tag: "MRecAd", message: "\(name) \(message)") | ||
|  |     } | ||
|  |      | ||
|  |     public func logInfo(_ message: String) { | ||
|  |         Logger.i(tag: "MRecAd", message: "\(name) \(message)") | ||
|  |     } | ||
|  |      | ||
|  |     public func logError(_ message: String) { | ||
|  |         Logger.e(tag: "MRecAd", message: "\(name) \(message)") | ||
|  |     } | ||
|  |      | ||
|  |     // MARK: - Methods to override | ||
|  |      | ||
|  |     open func load() -> Bool { | ||
|  |         fatalError("Subclass must implement") | ||
|  |     } | ||
|  |      | ||
|  |     open func show(request: MRecShowRequest? = nil) -> Bool { | ||
|  |         fatalError("Subclass must implement") | ||
|  |     } | ||
|  |      | ||
|  |     open func hide() -> Bool { | ||
|  |         fatalError("Subclass must implement") | ||
|  |     } | ||
|  |      | ||
|  |     open func destroy() -> Bool { | ||
|  |         fatalError("Subclass must implement") | ||
|  |     } | ||
|  |      | ||
|  |     open func updateOrientation(orientation: ScreenOrientation) -> Bool { | ||
|  |         fatalError("Subclass must implement") | ||
|  |     } | ||
|  | } |