Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database #14

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions Swift/FishSense Swift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
7AA6771F1CFF765600B353FB /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 7AA6771D1CFF765600B353FB /* LaunchScreen.storyboard */; };
7AA677271CFF774800B353FB /* PhotoCaptureDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AA677261CFF774800B353FB /* PhotoCaptureDelegate.swift */; };
7AA677291CFF7B5C00B353FB /* PreviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AA677281CFF7B5C00B353FB /* PreviewView.swift */; };
9DA317CD2C585DF400482765 /* Entitlements.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9DA317CC2C585DF400482765 /* Entitlements.plist */; };
9DA317D12C58602000482765 /* DBHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DA317D02C58602000482765 /* DBHelper.swift */; };
9DA317D32C58603300482765 /* Objects.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DA317D22C58603300482765 /* Objects.swift */; };
EF9079482BE892D300EDEF43 /* PhotoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF9079472BE892D300EDEF43 /* PhotoViewController.swift */; };
EFBFFD1B2C0790390061AE66 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = EFBFFD1A2C0790390061AE66 /* Extensions.swift */; };
EFBFFD1D2C0791D30061AE66 /* SphereNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = EFBFFD1C2C0791D30061AE66 /* SphereNode.swift */; };
Expand Down Expand Up @@ -59,6 +62,9 @@
7AA677201CFF765600B353FB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7AA677261CFF774800B353FB /* PhotoCaptureDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotoCaptureDelegate.swift; sourceTree = "<group>"; };
7AA677281CFF7B5C00B353FB /* PreviewView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PreviewView.swift; sourceTree = "<group>"; };
9DA317CC2C585DF400482765 /* Entitlements.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Entitlements.plist; sourceTree = "<group>"; };
9DA317D02C58602000482765 /* DBHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DBHelper.swift; sourceTree = "<group>"; };
9DA317D22C58603300482765 /* Objects.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Objects.swift; sourceTree = "<group>"; };
EF9079472BE892D300EDEF43 /* PhotoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhotoViewController.swift; sourceTree = "<group>"; };
EFBFFD1A2C0790390061AE66 /* Extensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
EFBFFD1C2C0791D30061AE66 /* SphereNode.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SphereNode.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -123,11 +129,22 @@
7AA6771B1CFF765600B353FB /* Assets.xcassets */,
7AA6771D1CFF765600B353FB /* LaunchScreen.storyboard */,
7AA677201CFF765600B353FB /* Info.plist */,
9DA317CC2C585DF400482765 /* Entitlements.plist */,
42C6D5B12C3EFA94009711A1 /* Zipping.swift */,
9DA317C72C585B0C00482765 /* Local Database */,
);
path = FishSense;
sourceTree = "<group>";
};
9DA317C72C585B0C00482765 /* Local Database */ = {
isa = PBXGroup;
children = (
9DA317D02C58602000482765 /* DBHelper.swift */,
9DA317D22C58603300482765 /* Objects.swift */,
);
path = "Local Database";
sourceTree = "<group>";
};
DF594A7680971C5690D94783 /* Configuration */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -212,6 +229,7 @@
7AA6771F1CFF765600B353FB /* LaunchScreen.storyboard in Resources */,
7AA6771C1CFF765600B353FB /* Assets.xcassets in Resources */,
7697F939217A94FB0011862B /* README.md in Resources */,
9DA317CD2C585DF400482765 /* Entitlements.plist in Resources */,
7AA6771A1CFF765600B353FB /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -234,6 +252,8 @@
7AA677151CFF765600B353FB /* AppDelegate.swift in Sources */,
EF9079482BE892D300EDEF43 /* PhotoViewController.swift in Sources */,
EFBFFD1B2C0790390061AE66 /* Extensions.swift in Sources */,
9DA317D32C58603300482765 /* Objects.swift in Sources */,
9DA317D12C58602000482765 /* DBHelper.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -388,7 +408,7 @@
CLANG_CXX_LIBRARY = "libc++";
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = J7APG66N2C;
DEVELOPMENT_TEAM = BV4K5476V9;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Frameworks",
Expand All @@ -399,7 +419,7 @@
"@executable_path/Frameworks",
);
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = org.ucsd.e4e.FishSense;
PRODUCT_BUNDLE_IDENTIFIER = org.mango.ucsd.e4e.FishSense;
PRODUCT_NAME = FishSense;
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = iphoneos;
Expand All @@ -417,7 +437,7 @@
CLANG_CXX_LIBRARY = "libc++";
CODE_SIGN_IDENTITY = "iPhone Developer";
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = J7APG66N2C;
DEVELOPMENT_TEAM = BV4K5476V9;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/Frameworks",
Expand All @@ -428,7 +448,7 @@
"@executable_path/Frameworks",
);
OTHER_LDFLAGS = "";
PRODUCT_BUNDLE_IDENTIFIER = org.ucsd.e4e.FishSense;
PRODUCT_BUNDLE_IDENTIFIER = org.mango.ucsd.e4e.FishSense;
PRODUCT_NAME = FishSense;
PROVISIONING_PROFILE_SPECIFIER = "";
SDKROOT = iphoneos;
Expand Down
15 changes: 0 additions & 15 deletions Swift/FishSense/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -258,21 +258,6 @@
</objects>
<point key="canvasLocation" x="-590" y="-631"/>
</scene>
<!--View Controller-->
<scene sceneID="wEP-za-P1B">
<objects>
<viewController id="PSv-12-Mww" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="b3h-Gk-cPm">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="2kI-41-13x"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="REm-Aj-00l" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-1610" y="-1617"/>
</scene>
</scenes>
<color key="tintColor" white="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<resources>
Expand Down
12 changes: 12 additions & 0 deletions Swift/FishSense/Entitlements.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?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/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.files.documents</key>
<true/>
</dict>
</plist>
14 changes: 12 additions & 2 deletions Swift/FishSense/ImageGallery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ struct ImageGallery: View {
@State private var selectedItem: DataTemp?
@State private var position = CGSize.zero

// To display the length of the fish
// var fish_length: Int64
//

var body: some View {
ZStack {
ScrollView {
Expand All @@ -31,7 +35,7 @@ struct ImageGallery: View {
let fileAttribute: [FileAttributeKey : Any] = try FileManager.default.attributesOfItem(atPath: zipUrl.path)

if let fileNumberSize: NSNumber = fileAttribute[FileAttributeKey.size] as? NSNumber {
fileSizeValue = UInt64(fileNumberSize)
fileSizeValue = UInt64(truncating: fileNumberSize)

let byteCountFormatter: ByteCountFormatter = ByteCountFormatter()
byteCountFormatter.countStyle = ByteCountFormatter.CountStyle.file
Expand All @@ -57,7 +61,12 @@ struct ImageGallery: View {
print("Error occurred: \(error)")
}
}
})
}
//
//THIS IS WHERE I WOULD LIKE TO PUT A DELETE BUTTON NEXT TO THE IMPORT BUTTON
//I would like for it to display a message and ask, "Before proceeding, are you sure you want to delete all data?" ( YES | NO )
//
)
ForEach(dataList) { data in
HStack(spacing: 2) {
// Image on the left
Expand All @@ -84,6 +93,7 @@ struct ImageGallery: View {
Text("Time: \n\(data.creationDate, formatter: dateFormatter)\n ")
.foregroundColor(Color.primary)
Text("Fish Length: \(data.fishLen.map { "\($0)" } ?? "Unavailable")")
//Text("Fish Length: \(fish_length)")
.foregroundColor(Color.primary)
}
.padding(8)
Expand Down
115 changes: 63 additions & 52 deletions Swift/FishSense/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,68 @@
<!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>en</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>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>FishSense uses the camera to take fish length measurements</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>AVCam uses your location to tag where photos and videos are taken.</string>
<key>NSMicrophoneUsageDescription</key>
<string>FishSense</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>AVCam saves captured photos and videos to your photo library.</string>
<key>UIFileSharingEnabled</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>Launch Screen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIRequiresFullScreen</key>
<true/>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>CFBundleDevelopmentRegion</key>
<string>en</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>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>NSCameraUsageDescription</key>
<string>FishSense uses the camera to take fish length measurements</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>AVCam uses your location to tag where photos and videos are taken.</string>
<key>NSMicrophoneUsageDescription</key>
<string>FishSense</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>AVCam saves captured photos and videos to your photo library.</string>
<key>UIFileSharingEnabled</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>Launch Screen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIRequiresFullScreen</key>
<true/>
<key>UIStatusBarHidden</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>

<!-- Disable state restoration -->
<key>UIApplicationStateRestorationEnabled</key>
<false/>

<!-- Permissions -->
<key>NSDocumentsFolderUsageDescription</key>
<string>This app needs access to the Documents folder to store data.</string>
<key>NSFileProviderDomainUsageDescription</key>
<string>This app needs access to the FileProvider domain to manage files.</string>

</dict>
</plist>
Loading