Skip to content

Commit

Permalink
Merge pull request #4 from ScribbleLabApp/auth
Browse files Browse the repository at this point in the history
Create AppClip and create Reset Password View
  • Loading branch information
N3v1 committed Nov 1, 2023
2 parents 6fc955d + 867cf92 commit 4da2b3a
Show file tree
Hide file tree
Showing 27 changed files with 814 additions and 253 deletions.
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,13 @@
{
"images" : [
{
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
6 changes: 6 additions & 0 deletions ScribbleLab AppClip/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
61 changes: 61 additions & 0 deletions ScribbleLab AppClip/ContentView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
//
// ContentView.swift
// ScribbleLab AppClip
//
// Created by Nevio Hirani on 01.11.23.
//

import SwiftUI
import SwiftData

struct ContentView: View {
@Environment(\.modelContext) private var modelContext
@Query private var items: [Item]

var body: some View {
NavigationSplitView {
List {
ForEach(items) { item in
NavigationLink {
Text("Item at \(item.timestamp, format: Date.FormatStyle(date: .numeric, time: .standard))")
} label: {
Text(item.timestamp, format: Date.FormatStyle(date: .numeric, time: .standard))
}
}
.onDelete(perform: deleteItems)
}
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
EditButton()
}
ToolbarItem {
Button(action: addItem) {
Label("Add Item", systemImage: "plus")
}
}
}
} detail: {
Text("Select an item")
}
}

private func addItem() {
withAnimation {
let newItem = Item(timestamp: Date())
modelContext.insert(newItem)
}
}

private func deleteItems(offsets: IndexSet) {
withAnimation {
for index in offsets {
modelContext.delete(items[index])
}
}
}
}

#Preview {
ContentView()
.modelContainer(for: Item.self, inMemory: true)
}
18 changes: 18 additions & 0 deletions ScribbleLab AppClip/Item.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// Item.swift
// ScribbleLab AppClip
//
// Created by Nevio Hirani on 01.11.23.
//

import Foundation
import SwiftData

@Model
final class Item {
var timestamp: Date

init(timestamp: Date) {
self.timestamp = timestamp
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
10 changes: 10 additions & 0 deletions ScribbleLab AppClip/ScribbleLab_AppClip.entitlements
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?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.developer.parent-application-identifiers</key>
<array>
<string>$(AppIdentifierPrefix)com.nhstudio.ScribbleLab</string>
</array>
</dict>
</plist>
32 changes: 32 additions & 0 deletions ScribbleLab AppClip/ScribbleLab_AppClipApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// ScribbleLab_AppClipApp.swift
// ScribbleLab AppClip
//
// Created by Nevio Hirani on 01.11.23.
//

import SwiftUI
import SwiftData

@main
struct ScribbleLab_AppClipApp: App {
var sharedModelContainer: ModelContainer = {
let schema = Schema([
Item.self,
])
let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false)

do {
return try ModelContainer(for: schema, configurations: [modelConfiguration])
} catch {
fatalError("Could not create ModelContainer: \(error)")
}
}()

var body: some Scene {
WindowGroup {
ContentView()
}
.modelContainer(sharedModelContainer)
}
}
356 changes: 355 additions & 1 deletion ScribbleLab.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,15 @@
"version" : "1.24.0"
}
},
{
"identity" : "swiftrui",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Sweekwang/SwiftRUI.git",
"state" : {
"branch" : "main",
"revision" : "8c4ba5e73ac37ba2c8b007f2083084e7c2689037"
}
},
{
"identity" : "updates",
"kind" : "remoteSourceControl",
Expand Down
Loading

0 comments on commit 4da2b3a

Please sign in to comment.