From 9cf6674de86af90cd7f06a91cb7b9fe2f65d1ca0 Mon Sep 17 00:00:00 2001 From: breadone Date: Sun, 23 Jun 2024 19:08:29 +1200 Subject: [PATCH] Start working on an autoscroll view and did some icloud stuff --- OnCue.xcodeproj/project.pbxproj | 22 ++++++++++---- OnCue/OnCue.entitlements | 16 ++++++++++ Shared/AutoScrollView.swift | 53 +++++++++++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 6 deletions(-) create mode 100644 OnCue/OnCue.entitlements create mode 100644 Shared/AutoScrollView.swift diff --git a/OnCue.xcodeproj/project.pbxproj b/OnCue.xcodeproj/project.pbxproj index a7c1e73..c2a52f4 100644 --- a/OnCue.xcodeproj/project.pbxproj +++ b/OnCue.xcodeproj/project.pbxproj @@ -34,6 +34,7 @@ 46D3E1402C26D6430060722E /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46D3E13E2C26D6430060722E /* Constants.swift */; }; 46D3E1422C27DD5D0060722E /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46D3E1412C27DD5C0060722E /* SettingsView.swift */; }; 46D3E1442C27DFCE0060722E /* Preferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46D3E1432C27DFCE0060722E /* Preferences.swift */; }; + 46D3E1462C27EC3B0060722E /* AutoScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46D3E1452C27EC3B0060722E /* AutoScrollView.swift */; }; 46E5FFD92C26A50D001191C9 /* CueCardViewPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E5FFD82C26A50D001191C9 /* CueCardViewPresenter.swift */; }; /* End PBXBuildFile section */ @@ -85,6 +86,8 @@ 46D3E13E2C26D6430060722E /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; 46D3E1412C27DD5C0060722E /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; 46D3E1432C27DFCE0060722E /* Preferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Preferences.swift; sourceTree = ""; }; + 46D3E1452C27EC3B0060722E /* AutoScrollView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutoScrollView.swift; sourceTree = ""; }; + 46D3E1472C27FAFC0060722E /* OnCue.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = OnCue.entitlements; sourceTree = ""; }; 46E5FFD82C26A50D001191C9 /* CueCardViewPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CueCardViewPresenter.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -128,6 +131,7 @@ 46AD30B92C26557500486C25 /* OnCue */ = { isa = PBXGroup; children = ( + 46D3E1472C27FAFC0060722E /* OnCue.entitlements */, 46AD30BA2C26557500486C25 /* OnCueApp.swift */, 46AD30E82C266AB900486C25 /* View */, 46AD30E02C2656B900486C25 /* Model */, @@ -212,6 +216,7 @@ 46AD30F32C267D6400486C25 /* PreviewData.swift */, 46D3E13E2C26D6430060722E /* Constants.swift */, 46D3E1432C27DFCE0060722E /* Preferences.swift */, + 46D3E1452C27EC3B0060722E /* AutoScrollView.swift */, ); path = Shared; sourceTree = ""; @@ -320,6 +325,7 @@ files = ( 46AD30F82C2689B900486C25 /* ProjectSlideshowView.swift in Sources */, 46AD30EF2C266F1900486C25 /* NewProjectForm.swift in Sources */, + 46D3E1462C27EC3B0060722E /* AutoScrollView.swift in Sources */, 46AD30F62C26823B00486C25 /* AddNewCardView.swift in Sources */, 464787CB2C269CAF00A9C462 /* TeleprompterView.swift in Sources */, 46AD30ED2C266C0B00486C25 /* CardsView.swift in Sources */, @@ -487,12 +493,14 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = OnCue/OnCue.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"OnCue/Preview Content\""; DEVELOPMENT_TEAM = 9MP5435PRF; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_CFBundleDisplayName = OnCue; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; @@ -503,7 +511,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = xyz.breadone.OnCue; + PRODUCT_BUNDLE_IDENTIFIER = xyz.breadone.oncue; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; @@ -521,12 +529,14 @@ ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = OnCue/OnCue.entitlements; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_ASSET_PATHS = "\"OnCue/Preview Content\""; DEVELOPMENT_TEAM = 9MP5435PRF; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_CFBundleDisplayName = OnCue; INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; INFOPLIST_KEY_UILaunchScreen_Generation = YES; @@ -537,7 +547,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = xyz.breadone.OnCue; + PRODUCT_BUNDLE_IDENTIFIER = xyz.breadone.oncue; PRODUCT_NAME = "$(TARGET_NAME)"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = NO; @@ -562,13 +572,13 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_CFBundleDisplayName = OnCuePresenter; INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; - INFOPLIST_KEY_WKCompanionAppBundleIdentifier = xyz.breadone.OnCue; + INFOPLIST_KEY_WKCompanionAppBundleIdentifier = xyz.breadone.oncue; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = xyz.breadone.OnCue.watchkitapp; + PRODUCT_BUNDLE_IDENTIFIER = xyz.breadone.oncue.watchkitapp; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = watchos; SKIP_INSTALL = YES; @@ -592,13 +602,13 @@ GENERATE_INFOPLIST_FILE = YES; INFOPLIST_KEY_CFBundleDisplayName = OnCuePresenter; INFOPLIST_KEY_UISupportedInterfaceOrientations = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown"; - INFOPLIST_KEY_WKCompanionAppBundleIdentifier = xyz.breadone.OnCue; + INFOPLIST_KEY_WKCompanionAppBundleIdentifier = xyz.breadone.oncue; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = xyz.breadone.OnCue.watchkitapp; + PRODUCT_BUNDLE_IDENTIFIER = xyz.breadone.oncue.watchkitapp; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = watchos; SKIP_INSTALL = YES; diff --git a/OnCue/OnCue.entitlements b/OnCue/OnCue.entitlements new file mode 100644 index 0000000..9f5c100 --- /dev/null +++ b/OnCue/OnCue.entitlements @@ -0,0 +1,16 @@ + + + + + aps-environment + development + com.apple.developer.icloud-container-identifiers + + iCloud.xyz.breadone.oncue + + com.apple.developer.icloud-services + + CloudKit + + + diff --git a/Shared/AutoScrollView.swift b/Shared/AutoScrollView.swift new file mode 100644 index 0000000..46a096e --- /dev/null +++ b/Shared/AutoScrollView.swift @@ -0,0 +1,53 @@ +// +// AutoScrollView.swift +// OnCue +// +// Created by Pradyun Setti on 23/06/2024. +// + +import SwiftUI +import SwiftData + +struct AutoScrollView: View { + let content: Content + var scrollSpeed: Double = 15.0 + + @State private var offset: Double = 0.0 + + init(scrollSpeed: Double = 0, @ViewBuilder _ content: () -> Content) { + self.content = content() + self.scrollSpeed = scrollSpeed + } + + var body: some View { + ScrollView { + content + .offset(y: offset) + } + } + + func startScrolling() { + + } + + func stopScrolling() { + + } + + mutating func setScrollSpeed(_ speed: Double) { + self.scrollSpeed = speed + } +} + +#Preview { + let config = ModelConfiguration(isStoredInMemoryOnly: true) + let container = try! ModelContainer(for: OCProject.self, configurations: config) + + container.mainContext.insert(PreviewData.project) + + return AutoScrollView { + Text(PreviewData.project.script) + .font(.system(size: 45)) + .padding(.horizontal) + } +}