feat(recommendation): 추천 서브 배너와 연속 순환을 추가한다
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import Foundation
|
||||
|
||||
#if canImport(UIKit)
|
||||
import UIKit
|
||||
#endif
|
||||
|
||||
enum SubBannerLinkOpener {
|
||||
static func open(_ banner: SubBanner, using opener: @escaping (URL, @escaping (Bool) -> Void) -> Void) {
|
||||
let webURL = banner.webURL
|
||||
if let iosURL = banner.iosURL {
|
||||
opener(iosURL) { opened in
|
||||
if !opened, let webURL {
|
||||
opener(webURL) { _ in }
|
||||
}
|
||||
}
|
||||
} else if let webURL {
|
||||
opener(webURL) { _ in }
|
||||
}
|
||||
}
|
||||
|
||||
#if canImport(UIKit)
|
||||
static func open(_ banner: SubBanner) {
|
||||
open(banner) { url, completion in
|
||||
UIApplication.shared.open(url, options: [:], completionHandler: completion)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
Reference in New Issue
Block a user