Skip to content
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
413 changes: 413 additions & 0 deletions Experiences/Experiences.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions Experiences/Experiences/Experience + MKAnnotation.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// Experience+MKAnnotation.swift
// Experiences
//
// Created by Kevin Stewart on 7/23/20.
// Copyright © 2020 Kevin Stewart. All rights reserved.
//

import MapKit

extension Experience: MKAnnotation {
var coordinate: CLLocationCoordinate2D {
return currentLocation
}

var title: String? {
name
}

}
39 changes: 39 additions & 0 deletions Experiences/Experiences/Extra photo Files/UIImage+Scaling.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// UIImage+Scaling.swift
// Experiences
//
// Created by Kevin Stewart on 7/17/20.
// Copyright © 2020 Kevin Stewart. All rights reserved.
//

import Foundation
import UIKit

extension UIImage {

/// Resize the image to a max dimension from size parameter
func imageByScaling(toSize size: CGSize) -> UIImage? {
guard size.width > 0 && size.height > 0 else { return nil }

let originalAspectRatio = self.size.width/self.size.height
var correctedSize = size

if correctedSize.width > correctedSize.width*originalAspectRatio {
correctedSize.width = correctedSize.width*originalAspectRatio
} else {
correctedSize.height = correctedSize.height/originalAspectRatio
}

return UIGraphicsImageRenderer(size: correctedSize, format: imageRendererFormat).image { context in
draw(in: CGRect(origin: .zero, size: correctedSize))
}
}

/// Renders the image if the pixel data was rotated due to orientation of camera
var flattened: UIImage {
if imageOrientation == .up { return self }
return UIGraphicsImageRenderer(size: size, format: imageRendererFormat).image { context in
draw(at: .zero)
}
}
}
74 changes: 74 additions & 0 deletions Experiences/Experiences/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?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>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>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>$(PRODUCT_NAME) uses your location to show where you are on the map.</string>
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) uses the microphone to record audio</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>$(PRODUCT_NAME) uses needs access to camera to add photos</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>$(PRODUCT_NAME) uses the photo library</string>
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) needs access to the camera to record videos</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
79 changes: 79 additions & 0 deletions Experiences/Experiences/LocationServices.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
//
// File.swift
// Experiences
//
// Created by Kevin Stewart on 7/23/20.
// Copyright © 2020 Kevin Stewart. All rights reserved.
//

import Foundation
import CoreLocation

protocol LocationServiceDelegate {
func tracingLocation(_ currentLocation: CLLocation)
func tracingLocationDidFailWithError(_ error: NSError)
}

class LocationService: NSObject, CLLocationManagerDelegate {

static let sharedInstance = LocationService()

var currentLocation: CLLocation?
var locationManager: CLLocationManager?
var delegate: LocationServiceDelegate?

override init() {
super.init()

self.locationManager = CLLocationManager()
guard let locationManager = self.locationManager else {
return
}

if CLLocationManager.authorizationStatus() == .notDetermined {
locationManager.requestAlwaysAuthorization()
}

locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters
locationManager.delegate = self
}

func getOneTimeLocation() {
print("Starting location updates")
self.locationManager?.requestLocation()
}

func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {

guard let location = locations.last else {
return
}

currentLocation = location
updateLocation(location)
}

func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) {

updateLocationDidFailWithError(error as NSError)
}

fileprivate func updateLocation(_ currentLocation: CLLocation) {

guard let delegate = self.delegate else {
return
}

delegate.tracingLocation(currentLocation)
}

fileprivate func updateLocationDidFailWithError(_ error: NSError) {

guard let delegate = self.delegate else {
return
}

delegate.tracingLocationDidFailWithError(error)
}

}
37 changes: 37 additions & 0 deletions Experiences/Experiences/Resources/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//
// AppDelegate.swift
// Experiences
//
// Created by Kevin Stewart on 7/17/20.
// Copyright © 2020 Kevin Stewart. All rights reserved.
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {



func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}

// MARK: UISceneSession Lifecycle

func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}

func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
}


}

Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"images" : [
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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,15 @@
{
"images" : [
{
"filename" : "Record.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "Stop.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
Loading