Skip to content

Commit

Permalink
second project setting
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrescent61 committed Jun 29, 2024
1 parent 4707642 commit 8378c97
Show file tree
Hide file tree
Showing 33 changed files with 1,048 additions and 1,218 deletions.
File renamed without changes.
1,009 changes: 0 additions & 1,009 deletions TToGiOk.xcodeproj/project.pbxproj

This file was deleted.

Binary file not shown.

This file was deleted.

793 changes: 793 additions & 0 deletions TToGiOk/TToGiOk.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// ContentView.swift
// TToGiOk
//
// Created by Hans Yim on 6/29/24.
// Created by Ellen J on 6/29/24.
//

import SwiftUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// TToGiOkApp.swift
// TToGiOk
//
// Created by Hans Yim on 6/29/24.
// Created by Ellen J on 6/29/24.
//

import SwiftUI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//
// ContentView.swift
// TToGiOkWatch Watch App
// TToGiokWatch Watch App
//
// Created by Hans Yim on 6/29/24.
// Created by Ellen J on 6/29/24.
//

import SwiftUI
Expand Down
17 changes: 17 additions & 0 deletions TToGiOk/TToGiokWatch Watch App/TToGiokWatchApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// TToGiokWatchApp.swift
// TToGiokWatch Watch App
//
// Created by Ellen J on 6/29/24.
//

import SwiftUI

@main
struct TToGiokWatch_Watch_AppApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"images" : [
{
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "tinted"
}
],
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions TToGiOk/TToGiokWidget/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
11 changes: 11 additions & 0 deletions TToGiOk/TToGiokWidget/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?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>NSExtension</key>
<dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.widgetkit-extension</string>
</dict>
</dict>
</plist>
8 changes: 8 additions & 0 deletions TToGiOk/TToGiokWidget/TToGiokWidget.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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>com.apple.security.app-sandbox</key>
<true/>
</dict>
</plist>
86 changes: 86 additions & 0 deletions TToGiOk/TToGiokWidget/TToGiokWidget.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
//
// TToGiokWidget.swift
// TToGiokWidget
//
// Created by Ellen J on 6/29/24.
//

import WidgetKit
import SwiftUI

struct Provider: TimelineProvider {
func placeholder(in context: Context) -> SimpleEntry {
SimpleEntry(date: Date(), emoji: "😀")
}

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

func getTimeline(in context: Context, completion: @escaping (Timeline<Entry>) -> ()) {
var entries: [SimpleEntry] = []

// Generate a timeline consisting of five entries an hour apart, starting from the current date.
let currentDate = Date()
for hourOffset in 0 ..< 5 {
let entryDate = Calendar.current.date(byAdding: .hour, value: hourOffset, to: currentDate)!
let entry = SimpleEntry(date: entryDate, emoji: "😀")
entries.append(entry)
}

let timeline = Timeline(entries: entries, policy: .atEnd)
completion(timeline)
}

// func relevances() async -> WidgetRelevances<Void> {
// // Generate a list containing the contexts this widget is relevant in.
// }
}

struct SimpleEntry: TimelineEntry {
let date: Date
let emoji: String
}

struct TToGiokWidgetEntryView : View {
var entry: Provider.Entry

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

Text("Emoji:")
Text(entry.emoji)
}
}
}

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

var body: some WidgetConfiguration {
StaticConfiguration(kind: kind, provider: Provider()) { entry in
if #available(macOS 14.0, iOS 17.0, *) {
TToGiokWidgetEntryView(entry: entry)
.containerBackground(.fill.tertiary, for: .widget)
} else {
TToGiokWidgetEntryView(entry: entry)
.padding()
.background()
}
}
.configurationDisplayName("My Widget")
.description("This is an example widget.")
}
}

#Preview(as: .systemSmall) {
TToGiokWidget()
} timeline: {
SimpleEntry(date: .now, emoji: "😀")
SimpleEntry(date: .now, emoji: "🤩")
}
16 changes: 16 additions & 0 deletions TToGiOk/TToGiokWidget/TToGiokWidgetBundle.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// TToGiokWidgetBundle.swift
// TToGiokWidget
//
// Created by Ellen J on 6/29/24.
//

import WidgetKit
import SwiftUI

@main
struct TToGiokWidgetBundle: WidgetBundle {
var body: some Widget {
TToGiokWidget()
}
}
17 changes: 0 additions & 17 deletions TToGiOkTests/TToGiOkTests.swift

This file was deleted.

43 changes: 0 additions & 43 deletions TToGiOkUITests/TToGiOkUITests.swift

This file was deleted.

Loading

0 comments on commit 8378c97

Please sign in to comment.