Skip to content

Commit

Permalink
[D-0] Dev Scheme 추가 (#76)
Browse files Browse the repository at this point in the history
* add: dev scheme 추가

* add: fastfile Dev 업로드 추가

* feat: dev upload를 위해 workflows 수정

* chore: marketingVersion 1.2.1 -> 1.2.2
  • Loading branch information
FirstDo authored and Siwon-L committed Oct 16, 2024
1 parent db4f4cf commit 44eb9d1
Show file tree
Hide file tree
Showing 6 changed files with 208 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ let project = Project(
]
),
targets: [
.init(
name: "WidgetExtension",
platform: .iOS,
product: .appExtension,
bundleId: "com.yapp.moneymong.WidgetExtension",
infoPlist: .extendingDefault(with: [
"CFBundleDisplayName": "$(PRODUCT_NAME)",
"NSExtension": [
"NSExtensionPointIdentifier": "com.apple.widgetkit-extension",
],
]),
sources: "WidgetExtension/Sources/**",
resources: "WidgetExtension/Resources/**",
dependencies: []
),
Target(
name: "Moneymong",
platform: .iOS,
Expand Down Expand Up @@ -63,7 +78,8 @@ let project = Project(
entitlements: "Resources/App.entitlements",
dependencies: [
.project(target: "SignFeature", path: .relativeToRoot("Projects/Feature/Sign")),
.project(target: "MainFeature", path: .relativeToRoot("Projects/Feature/Main"))
.project(target: "MainFeature", path: .relativeToRoot("Projects/Feature/Main")),
.target(name: "WidgetExtension")
],
settings: .settings(
base: .init()
Expand Down
29 changes: 29 additions & 0 deletions Projects/App/WidgetExtension/Resources/WidgetExtension-Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.widgetkit-extension</string>
</dict>
</dict>
</plist>
50 changes: 50 additions & 0 deletions Projects/App/WidgetExtension/Sources/MainWidget/MainWidget.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import WidgetKit
import SwiftUI

struct MainWidget: Widget {
let kind: String = "MainWidget"

var body: some WidgetConfiguration {
StaticConfiguration(kind: kind, provider: MainProvider()) { entry in
MainWidgetEntryView(entry: entry)
}
.supportedFamilies([.systemMedium])
.configurationDisplayName("My Widget")
.description("This is an example widget.")
}
}

struct MainWidgetEntryView: View {
var entry: MainProvider.Entry

var body: some View {
Text(entry.date, style: .time)
}
}

struct MainSimpleEntry: TimelineEntry {
let date: Date
}

struct MainProvider: TimelineProvider {
func placeholder(in context: Context) -> MainSimpleEntry {
MainSimpleEntry(date: Date())
}

func getSnapshot(in context: Context, completion: @escaping (MainSimpleEntry) -> ()) {
let entry = MainSimpleEntry(date: Date())
completion(entry)
}

func getTimeline(in context: Context, completion: @escaping (Timeline<MainSimpleEntry>) -> ()) {
var entries: [MainSimpleEntry] = []
let currentDate = Date()
for hourOffset in 0..<5 {
let entryDate = Calendar.current.date(byAdding: .hour, value: hourOffset, to: currentDate)!
let entry = MainSimpleEntry(date: entryDate)
entries.append(entry)
}
let timeline = Timeline(entries: entries, policy: .atEnd)
completion(timeline)
}
}
50 changes: 50 additions & 0 deletions Projects/App/WidgetExtension/Sources/OCRWidget/MyWidget.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import WidgetKit
import SwiftUI

struct OCRWidget: Widget {
let kind: String = "OCRWidget"

var body: some WidgetConfiguration {
StaticConfiguration(kind: kind, provider: OCRProvider()) { entry in
OCRWidgetEntryView(entry: entry)
}
.supportedFamilies([.systemSmall])
.configurationDisplayName("My Widget")
.description("This is an example widget.")
}
}

struct OCRWidgetEntryView: View {
var entry: OCRProvider.Entry

var body: some View {
Text(entry.date, style: .time)
}
}

struct OCRSimpleEntry: TimelineEntry {
let date: Date
}

struct OCRProvider: TimelineProvider {
func placeholder(in context: Context) -> OCRSimpleEntry {
OCRSimpleEntry(date: Date())
}

func getSnapshot(in context: Context, completion: @escaping (OCRSimpleEntry) -> ()) {
let entry = OCRSimpleEntry(date: Date())
completion(entry)
}

func getTimeline(in context: Context, completion: @escaping (Timeline<OCRSimpleEntry>) -> ()) {
var entries: [OCRSimpleEntry] = []
let currentDate = Date()
for hourOffset in 0..<5 {
let entryDate = Calendar.current.date(byAdding: .hour, value: hourOffset, to: currentDate)!
let entry = OCRSimpleEntry(date: entryDate)
entries.append(entry)
}
let timeline = Timeline(entries: entries, policy: .atEnd)
completion(timeline)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import WidgetKit
import SwiftUI

struct SecondWidget: Widget {
let kind: String = "SecondWidget"

var body: some WidgetConfiguration {
StaticConfiguration(kind: kind, provider: SecondProvider()) { entry in
SecondWidgetEntryView(entry: entry)
}
.supportedFamilies([.systemMedium])
.configurationDisplayName("My Widget")
.description("This is an example widget.")
}
}

struct SecondWidgetEntryView: View {
var entry: SecondProvider.Entry

var body: some View {
Text(entry.date, style: .time)
}
}

struct SecondSimpleEntry: TimelineEntry {
let date: Date
}

struct SecondProvider: TimelineProvider {
func placeholder(in context: Context) -> SecondSimpleEntry {
SecondSimpleEntry(date: Date())
}

func getSnapshot(in context: Context, completion: @escaping (SecondSimpleEntry) -> ()) {
let entry = SecondSimpleEntry(date: Date())
completion(entry)
}

func getTimeline(in context: Context, completion: @escaping (Timeline<SecondSimpleEntry>) -> ()) {
var entries: [SecondSimpleEntry] = []
let currentDate = Date()
for hourOffset in 0..<5 {
let entryDate = Calendar.current.date(byAdding: .hour, value: hourOffset, to: currentDate)!
let entry = SecondSimpleEntry(date: entryDate)
entries.append(entry)
}
let timeline = Timeline(entries: entries, policy: .atEnd)
completion(timeline)
}
}
12 changes: 12 additions & 0 deletions Projects/App/WidgetExtension/Sources/Widgets.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import SwiftUI
import WidgetKit

@main
struct Widgets: WidgetBundle {
@WidgetBundleBuilder
var body: some Widget {
MainWidget()
SecondWidget()
OCRWidget()
}
}

0 comments on commit 44eb9d1

Please sign in to comment.