-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [Setting] Widget Extension 타겟 추가 * [Setting] Widget match identifier 주석 해제 * [Feat] ArrivalInfoWidget 추가 * [Remove] 레거시 위젯 제거 ArrivalInfoWidget로 대체 * [Chore] 위젯뷰 경로 수정 * [Add] RefreshView Preview 추가 * [Fix] 주변정류장 위젯 이름 / 설명 추가 * [Feat] ArrivalInfoIntent 동적 파라미터 추가 * [Fix] DynamicOptionsProvider defaultResult 추가 * [Chore] NearByStopView 경로 수정 * [Fix] widgetBackground 인자 기본값 추가 * [Setting] Widget Extension Resources 경로 수정 * [Setting] 빌드버전 한국기준으로 고정 * [Setting] CI/CD OS, Xcode, Swift 버전 수정 * [Setting] 빌드 테스트 Scheme App으로 수정
- Loading branch information
Showing
19 changed files
with
226 additions
and
77 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
17 changes: 11 additions & 6 deletions
17
...Info/Medium/ArrivalInfoMediumWidget.swift → ...idget/ArrivalInfo/ArrivalInfoWidget.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,28 +1,33 @@ | ||
// | ||
// ArrivalInfoMediumWidget.swift | ||
// ArrivalInfoWidget.swift | ||
// Widget | ||
// | ||
// Created by gnksbm on 4/12/24. | ||
// Created by gnksbm on 4/13/24. | ||
// Copyright © 2024 Pepsi-Club. All rights reserved. | ||
// | ||
|
||
import WidgetKit | ||
import SwiftUI | ||
|
||
@available(iOS 17.0, *) | ||
struct ArrivalInfoMediumWidget: Widget { | ||
let kind: String = "ArrivalInfoMedium" | ||
struct ArrivalInfoWidget: Widget { | ||
let kind: String = "ArrivalInfo" | ||
|
||
var body: some WidgetConfiguration { | ||
AppIntentConfiguration( | ||
kind: kind, | ||
intent: ArrivalInfoIntent.self, | ||
provider: ArrivalInfoProvider() | ||
) { entry in | ||
ArrivalInfoMediumView( | ||
ArrivalInfoView( | ||
entry: entry | ||
) | ||
} | ||
.supportedFamilies([.systemMedium]) | ||
.supportedFamilies([ | ||
.systemSmall, | ||
.systemMedium | ||
]) | ||
.configurationDisplayName("즐겨찾기") | ||
.description("실시간 도착정보를 확인할 수 있어요") | ||
} | ||
} |
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
27 changes: 27 additions & 0 deletions
27
Projects/App/Widget/ArrivalInfo/Intent/Parameter/BusOptionProvider.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,27 @@ | ||
// | ||
// BusOptionProvider.swift | ||
// AppUITests | ||
// | ||
// Created by gnksbm on 4/13/24. | ||
// Copyright © 2024 Pepsi-Club. All rights reserved. | ||
// | ||
|
||
import AppIntents | ||
|
||
import CoreDataService | ||
import Domain | ||
|
||
struct BusOptionProvider: DynamicOptionsProvider { | ||
// let coreDataService = DefaultCoreDataService() | ||
func defaultResult() async -> String? { | ||
"" | ||
} | ||
|
||
func results() async throws -> [String] { | ||
// let responses = try coreDataService.fetch( | ||
// type: FavoritesBusStopResponse.self | ||
// ) | ||
// return responses.flatMap { $0.busIds } | ||
[] | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
Projects/App/Widget/ArrivalInfo/Intent/Parameter/BusStopOptionProvider.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,27 @@ | ||
// | ||
// BusStopOptionProvider.swift | ||
// AppUITests | ||
// | ||
// Created by gnksbm on 4/13/24. | ||
// Copyright © 2024 Pepsi-Club. All rights reserved. | ||
// | ||
|
||
import AppIntents | ||
|
||
import CoreDataService | ||
import Domain | ||
|
||
struct BusStopOptionProvider: DynamicOptionsProvider { | ||
// let coreDataService = DefaultCoreDataService() | ||
func defaultResult() async -> String? { | ||
"" | ||
} | ||
|
||
func results() async throws -> [String] { | ||
// let responses = try coreDataService.fetch( | ||
// type: FavoritesBusStopResponse.self | ||
// ) | ||
// return responses.map { $0.busStopId } | ||
[] | ||
} | ||
} |
28 changes: 0 additions & 28 deletions
28
Projects/App/Widget/ArrivalInfo/Small/ArrivalInfoSmallWidget.swift
This file was deleted.
Oops, something went wrong.
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
60 changes: 60 additions & 0 deletions
60
Projects/App/Widget/ArrivalInfo/View/ArrivalInfoView.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,60 @@ | ||
// | ||
// ArrivalInfoView.swift | ||
// Widget | ||
// | ||
// Created by gnksbm on 4/13/24. | ||
// Copyright © 2024 Pepsi-Club. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
import WidgetKit | ||
|
||
@available (iOS 17.0, *) | ||
struct ArrivalInfoView: View { | ||
var entry: ArrivalInfoProvider.Entry | ||
@Environment(\.widgetFamily) var widgetFamily | ||
|
||
var body: some View { | ||
view.widgetBackground(Color.white) | ||
} | ||
|
||
@ViewBuilder | ||
var view: some View { | ||
switch widgetFamily { | ||
case .systemSmall: | ||
ArrivalInfoSmallView(entry: entry) | ||
case .systemMedium: | ||
ArrivalInfoMediumView(entry: entry) | ||
default: | ||
EmptyView() | ||
} | ||
} | ||
} | ||
|
||
#if DEBUG | ||
@available(iOS 17.0, *) | ||
struct ArrivalInfoView_Preview: PreviewProvider { | ||
static var previews: some View { | ||
ArrivalInfoView( | ||
entry: ArrivalInfoEntry( | ||
date: .now, | ||
configuration: .init(), | ||
responses: .mock | ||
) | ||
) | ||
.previewContext( | ||
WidgetPreviewContext(family: .systemSmall) | ||
) | ||
ArrivalInfoView( | ||
entry: ArrivalInfoEntry( | ||
date: .now, | ||
configuration: .init(), | ||
responses: .mock | ||
) | ||
) | ||
.previewContext( | ||
WidgetPreviewContext(family: .systemMedium) | ||
) | ||
} | ||
} | ||
#endif |
Oops, something went wrong.