-
Notifications
You must be signed in to change notification settings - Fork 1
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
371ac19
commit 36f93cb
Showing
15 changed files
with
515 additions
and
22 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,91 @@ | ||
import ScadeKit | ||
|
||
// MARK: - Type | ||
|
||
enum SponsorType { | ||
case platinum(PlatinumType) | ||
case gold(GoldType) | ||
case supporter(SupporterType) | ||
|
||
var name: String { | ||
switch self { | ||
case let .platinum(type): return type.name | ||
case let .gold(type): return type.name | ||
case let .supporter(type): return type.name | ||
} | ||
} | ||
|
||
var url: String { | ||
switch self { | ||
case let .platinum(type): return type.url | ||
case let .gold(type): return type.url | ||
case let .supporter(type): return type.url | ||
} | ||
} | ||
|
||
var logo: String { | ||
switch self { | ||
case let .platinum(type): return type.logo | ||
case let .gold(type): return type.logo | ||
case let .supporter(type): return type.logo | ||
} | ||
} | ||
} | ||
|
||
enum PlatinumType { | ||
case zozo, yappli, yumemi | ||
|
||
var name: String { | ||
switch self { | ||
case .zozo: return "株式会社ZOZOテクノロジーズ" | ||
case .yappli: return "株式会社ヤプリ" | ||
case .yumemi: return "株式会社ゆめみ" | ||
} | ||
} | ||
|
||
var url: String { | ||
switch self { | ||
case .zozo: return "https://corp.zozo.com/" | ||
case .yappli: return "https://yappli.co.jp/" | ||
case .yumemi: return "https://www.yumemi.co.jp/ja" | ||
} | ||
} | ||
|
||
var logo: String { | ||
switch self { | ||
case .zozo: return "" | ||
case .yappli: return "" | ||
case .yumemi: return "" | ||
} | ||
} | ||
} | ||
|
||
enum GoldType { | ||
|
||
var name: String { | ||
return "" | ||
} | ||
|
||
var url: String { | ||
return "" | ||
} | ||
|
||
var logo: String { | ||
return "" | ||
} | ||
} | ||
|
||
enum SupporterType { | ||
|
||
var name: String { | ||
return "" | ||
} | ||
|
||
var url: String { | ||
return "" | ||
} | ||
|
||
var logo: String { | ||
return "" | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import ScadeKit | ||
|
||
// MARK: - Delegate | ||
|
||
protocol WebPageDelegate: SCDLatticePageAdapter { | ||
func onBackClicked() | ||
} | ||
|
||
|
||
// MARK: - View | ||
|
||
final class WebPage { | ||
|
||
// MARK: Properties | ||
|
||
weak var webPageDelegate: WebPageDelegate? | ||
private weak var adapter: WebPageAdapter? | ||
|
||
// MARK: Widgets | ||
|
||
lazy var backButton: SCDWidgetsButton! = { | ||
let btn = adapter?.page?.getWidgetByName("backButton")?.asButton | ||
btn?.onClick.append(SCDWidgetsEventHandler { [weak self] event in | ||
self?.webPageDelegate?.onBackClicked() | ||
}) | ||
return btn | ||
}() | ||
|
||
lazy var webView: SCDWidgetsWebView! = { | ||
let web = adapter?.page?.getWidgetByName("webView")?.asWebView | ||
return web | ||
}() | ||
|
||
|
||
// MARK: Initializer | ||
|
||
init(adapter: WebPageAdapter?) { | ||
self.adapter = adapter | ||
|
||
/// todo access | ||
backButton.isVisible = true | ||
|
||
webView.onLoaded.append(SCDWidgetsLoadEventHandler { event in | ||
print("Page Loaded: \(event)") | ||
}) | ||
webView.onLoadFailed.append(SCDWidgetsLoadFailedEventHandler { event in | ||
print("Page failed to load \(event)") | ||
}) | ||
} | ||
|
||
deinit { | ||
adapter = nil | ||
webPageDelegate = nil | ||
} | ||
} |
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
Oops, something went wrong.