diff --git a/Musgravite.xcworkspace/xcuserdata/Luna.xcuserdatad/UserInterfaceState.xcuserstate b/Musgravite.xcworkspace/xcuserdata/Luna.xcuserdatad/UserInterfaceState.xcuserstate index 7b9129d..353dab8 100644 Binary files a/Musgravite.xcworkspace/xcuserdata/Luna.xcuserdatad/UserInterfaceState.xcuserstate and b/Musgravite.xcworkspace/xcuserdata/Luna.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Musgravite.xcworkspace/xcuserdata/Luna.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Musgravite.xcworkspace/xcuserdata/Luna.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 1f20758..13fffeb 100644 --- a/Musgravite.xcworkspace/xcuserdata/Luna.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Musgravite.xcworkspace/xcuserdata/Luna.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -10,11 +10,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Musgravite/Controller/DetailViewController.swift" - timestampString = "564861121.219802" + timestampString = "564862025.403434" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "205" - endingLineNumber = "205" + startingLineNumber = "195" + endingLineNumber = "195" landmarkName = "getData(_:_:_:)" landmarkType = "7"> @@ -42,11 +42,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Musgravite/Controller/DetailViewController.swift" - timestampString = "564861121.220378" + timestampString = "564862025.403586" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "206" - endingLineNumber = "206" + startingLineNumber = "196" + endingLineNumber = "196" landmarkName = "getData(_:_:_:)" landmarkType = "7"> diff --git a/Musgravite/Assets.xcassets/Buletin/buletin-lab.imageset/Contents.json b/Musgravite/Assets.xcassets/Buletin/buletin-lab.imageset/Contents.json new file mode 100644 index 0000000..7418023 --- /dev/null +++ b/Musgravite/Assets.xcassets/Buletin/buletin-lab.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "buletin-lab.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "buletin-lab@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "buletin-lab@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Musgravite/Assets.xcassets/Buletin/buletin-lab.imageset/buletin-lab.png b/Musgravite/Assets.xcassets/Buletin/buletin-lab.imageset/buletin-lab.png new file mode 100644 index 0000000..37f0ca1 Binary files /dev/null and b/Musgravite/Assets.xcassets/Buletin/buletin-lab.imageset/buletin-lab.png differ diff --git a/Musgravite/Assets.xcassets/Buletin/buletin-lab.imageset/buletin-lab@2x.png b/Musgravite/Assets.xcassets/Buletin/buletin-lab.imageset/buletin-lab@2x.png new file mode 100644 index 0000000..730cc37 Binary files /dev/null and b/Musgravite/Assets.xcassets/Buletin/buletin-lab.imageset/buletin-lab@2x.png differ diff --git a/Musgravite/Assets.xcassets/Buletin/buletin-lab.imageset/buletin-lab@3x.png b/Musgravite/Assets.xcassets/Buletin/buletin-lab.imageset/buletin-lab@3x.png new file mode 100644 index 0000000..6ab882d Binary files /dev/null and b/Musgravite/Assets.xcassets/Buletin/buletin-lab.imageset/buletin-lab@3x.png differ diff --git a/Musgravite/Controller/CharacterCreatorViewController.swift b/Musgravite/Controller/CharacterCreatorViewController.swift index f27f409..d623310 100644 --- a/Musgravite/Controller/CharacterCreatorViewController.swift +++ b/Musgravite/Controller/CharacterCreatorViewController.swift @@ -67,9 +67,10 @@ class CharacterCreatorViewController: UIViewController, UIImagePickerControllerD } override func viewDidAppear(_ animated: Bool) { - if UserDefaults.standard.bool(forKey: "characterLaunchedBefore") { + if !UserDefaults.standard.bool(forKey: "characterLaunchedBefore") { inBulletin.backgroundViewStyle = .dimmed inBulletin.showBulletin(above: self) + UserDefaults.standard.set(true, forKey: "characterLaunchedBefore") } } diff --git a/Musgravite/Controller/DetailViewController.swift b/Musgravite/Controller/DetailViewController.swift index 63a4508..2f815c0 100644 --- a/Musgravite/Controller/DetailViewController.swift +++ b/Musgravite/Controller/DetailViewController.swift @@ -81,16 +81,6 @@ class DetailViewController: UIViewController, UICollectionViewDelegate, UICollec } func displayMapDirections(){ - /* Request Location */ - locationManager.requestAlwaysAuthorization() - locationManager.requestWhenInUseAuthorization() - - if CLLocationManager.locationServicesEnabled() { - locationManager.delegate = self - locationManager.desiredAccuracy = kCLLocationAccuracyBest - locationManager.startUpdatingLocation() - } - let sourceCoordinates = locationManager.location?.coordinate let destinationCoordinates = CLLocationCoordinate2D(latitude: 19.2833333, longitude: -99.1352777777779) let sourcePlacemark = MKPlacemark(coordinate: sourceCoordinates!) diff --git a/Musgravite/Controller/ViewController.swift b/Musgravite/Controller/ViewController.swift index 12e16dd..db1a5bf 100644 --- a/Musgravite/Controller/ViewController.swift +++ b/Musgravite/Controller/ViewController.swift @@ -26,7 +26,7 @@ extension UIImageView { } } -class ViewController: UIViewController, CLLocationManagerDelegate, UICollectionViewDelegate, UICollectionViewDataSource, WCSessionDelegate{ +class ViewController: UIViewController, CLLocationManagerDelegate, UICollectionViewDelegate, UICollectionViewDataSource, WCSessionDelegate { /* Apple Watch Required Sources */ func session(_ session: WCSession, activationDidCompleteWith activationState: WCSessionActivationState, error: Error?) {} func sessionDidBecomeInactive(_ session: WCSession) {} @@ -104,7 +104,7 @@ class ViewController: UIViewController, CLLocationManagerDelegate, UICollectionV } override func viewDidAppear(_ animated: Bool) { - if (appHasBeenLaunchedBefore()){ + if !appHasBeenLaunchedBefore() { self.notification.notificationOccurred(.warning) bulletinManager.backgroundViewStyle = .dimmed bulletinManager.showBulletin(above: self) diff --git a/Musgravite/Model/MainMenuCards.swift b/Musgravite/Model/MainMenuCards.swift index 1b8bc85..5b4828a 100644 --- a/Musgravite/Model/MainMenuCards.swift +++ b/Musgravite/Model/MainMenuCards.swift @@ -8,8 +8,10 @@ import Foundation import BLTNBoard +import CoreLocation class MainMenuCards { + /* Haptic Feeback */ public let impact = UIImpactFeedbackGenerator() public let notification = UINotificationFeedbackGenerator() @@ -19,7 +21,8 @@ class MainMenuCards { let titles = ["Crea tu propio avatar","Busca laboratorios","Acerca de la aplicacion"] let subtitles = ["Personaliza tu experiencia virtual","¡Crea tu siguiente inovacion ahora!","Autores detras de este proyecto"] let targets = ["CharacterCreatorViewController","LaboratorySearchViewController","AboutPageViewController"] - + /* Location */ + let locationManager = CLLocationManager() /** This launches the onboarding experience on first launch @@ -61,38 +64,29 @@ class MainMenuCards { page.actionButtonTitle = "Crear perfil" page.textInputHandler = {(item,text) in //We need to store it in CoreData + self.selection.selectionChanged() UtilityFunctions().storeUserName(text!) - let next = self.createLocationServicesBLTNPage() + let next = self.showAvatarPageBLTNPage() item.manager?.push(item: next) } return page } - /** - This launches the location services BLTN Page - - Returns: OnboardingBLTNPageItem - - Remark: This should call our support file for location services - - Requires: It requires to be called by another BTLNPage and is not the first page to show - */ - func createLocationServicesBLTNPage() -> BLTNPageItem { - let firstPage = BLTNPageItem(title: "Servicios de Localizacion") - firstPage.image = UIImage(named: "buletin-2") - firstPage.descriptionText = "Para personalizar tu experiencia necesitamos tu localizacion. Esta informacion sera enviada a nuestros servidores de forma anonima. Puedes cambiar de opinion mas adelante en las preferencias de la aplicacion." - firstPage.actionButtonTitle = "Activar Localizacion" - firstPage.alternativeButtonTitle = "Ahora no" - firstPage.requiresCloseButton = false - firstPage.isDismissable = false - firstPage.appearance.shouldUseCompactDescriptionText = true - firstPage.next = createNotificationServicesBLTNPage() - firstPage.actionHandler = { item in - self.selection.selectionChanged() - item.manager?.displayNextItem() - } - firstPage.alternativeHandler = { item in + func showAvatarPageBLTNPage() -> BLTNPageItem { + let page = BLTNPageItem(title:"Crea tu propio avatar!") + page.isDismissable = true + page.image = UIImage(named: "buletin-character") + page.descriptionText = "Selecciona en la primer opción el creador de Avatares dentro de la aplicación, este te seguirá a todos tus dispositivos" + page.appearance.actionButtonColor = UIColor(red:0.20, green:0.14, blue:0.14, alpha:1.0) + page.actionButtonTitle = "Continuar" + page.requiresCloseButton = false + page.appearance.shouldUseCompactDescriptionText = true + page.next = showLabSearchBLTNPage() + page.actionHandler = { item in self.selection.selectionChanged() item.manager?.displayNextItem() } - return firstPage + return page } /** This launches the Notification services BLTN Page @@ -101,19 +95,18 @@ class MainMenuCards { - Requires : It requires to be called by another BLTNPage and is not our first page */ - func createNotificationServicesBLTNPage() -> BLTNPageItem { - let firstPage = BLTNPageItem(title: "Notificaciones Push") - firstPage.image = UIImage(named: "buletin-3") - firstPage.descriptionText = "Recibe notificaciones push cuando cambios en la aplicacion sucedan." - firstPage.actionButtonTitle = "Activar notificaciones" - firstPage.alternativeButtonTitle = "Ahora no" + func showLabSearchBLTNPage() -> BLTNPageItem { + let firstPage = BLTNPageItem(title: "Encuentra los laboratorios") + firstPage.image = UIImage(named: "buletin-lab") + firstPage.descriptionText = "Presiona el segundo elemento en el menu para ver los diferentes salones divididos por pisos de CDTC" + firstPage.actionButtonTitle = "Continuar" firstPage.requiresCloseButton = false firstPage.isDismissable = false firstPage.appearance.shouldUseCompactDescriptionText = true - firstPage.next = createJSONDownloadBLTNPage() + firstPage.next = createLocationServicesBLTNPage() firstPage.actionHandler = { item in - item.manager?.displayNextItem() - self.notification.notificationOccurred(.success) + item.manager?.displayNextItem() + self.notification.notificationOccurred(.success) } firstPage.alternativeHandler = { item in item.manager?.displayNextItem() @@ -122,27 +115,36 @@ class MainMenuCards { return firstPage } - - /* Shows that the JSON's were succesfully downloaded - - Returns : OnboardingBLTNPageItem - - Remartk: This should subsequently call the next file + /** + This launches the location services BLTN Page + - Returns: OnboardingBLTNPageItem + - Remark: This should call our support file for location services + - Requires: It requires to be called by another BTLNPage and is not the first page to show */ - func createJSONDownloadBLTNPage() -> BLTNPageItem { - let firstPage = BLTNPageItem(title: "Datos descargados") - firstPage.image = UIImage(named: "buletin-5") - firstPage.descriptionText = "Se han descargado los datos necesarios para usar la aplicacion" - firstPage.actionButtonTitle = "Continuar" + func createLocationServicesBLTNPage() -> BLTNPageItem { + let firstPage = BLTNPageItem(title: "Servicios de Localizacion") + firstPage.image = UIImage(named: "buletin-2") + firstPage.descriptionText = "Para personalizar tu experiencia necesitamos tu localizacion. Esta informacion sera enviada a nuestros servidores de forma anonima. Puedes cambiar de opinion mas adelante en las preferencias de la aplicacion." + firstPage.actionButtonTitle = "Activar Localizacion" + firstPage.alternativeButtonTitle = "Ahora no" firstPage.requiresCloseButton = false firstPage.isDismissable = false - firstPage.appearance.shouldUseCompactDescriptionText = false - firstPage.appearance.actionButtonColor = UIColor(red:0.31, green:0.89, blue:0.76, alpha:1.0) + firstPage.appearance.shouldUseCompactDescriptionText = true firstPage.next = createSuccessBLTNPage() firstPage.actionHandler = { item in + /* Request Location */ + self.locationManager.requestAlwaysAuthorization() + self.locationManager.requestWhenInUseAuthorization() + self.selection.selectionChanged() + item.manager?.displayNextItem() + } + firstPage.alternativeHandler = { item in + self.selection.selectionChanged() item.manager?.displayNextItem() - self.notification.notificationOccurred(.success) } return firstPage } + /** This launches the Success BLTN Page - Returns : OnboardingBLTNPageItem