diff --git a/OpenStack Summit/CoreSummit/FeedbackRequest.swift b/OpenStack Summit/CoreSummit/FeedbackRequest.swift index c9eb62cf..641832f7 100644 --- a/OpenStack Summit/CoreSummit/FeedbackRequest.swift +++ b/OpenStack Summit/CoreSummit/FeedbackRequest.swift @@ -92,7 +92,7 @@ public extension Store { managedObject.averageFeedback = averageFeedback - try context.validateAndSave() + try context.save() } } diff --git a/OpenStack Summit/CoreSummit/Level.swift b/OpenStack Summit/CoreSummit/Level.swift new file mode 100644 index 00000000..2567f886 --- /dev/null +++ b/OpenStack Summit/CoreSummit/Level.swift @@ -0,0 +1,37 @@ +// +// Level.swift +// OpenStack Summit +// +// Created by Gabriel Horacio Cutrini on 4/18/17. +// Copyright © 2017 OpenStack. All rights reserved. +// + +public enum Level: String, Comparable { + + case Beginner + case Intermediate + case Advanced + case NotApplicable = "N/A" + + public var order: Int { + + switch self { + case .Beginner: return 0 + case .Intermediate: return 1 + case .Advanced: return 2 + case .NotApplicable: return 3 + } + } +} + +// MARK: - Comparable + +public func == (lhs: Level, rhs: Level) -> Bool { + + return lhs.order == rhs.order +} + +public func < (lhs: Level, rhs: Level) -> Bool { + + return lhs.order < rhs.order +} diff --git a/OpenStack Summit/CoreSummit/Presentation.swift b/OpenStack Summit/CoreSummit/Presentation.swift index 8e4b102f..498147f7 100644 --- a/OpenStack Summit/CoreSummit/Presentation.swift +++ b/OpenStack Summit/CoreSummit/Presentation.swift @@ -17,19 +17,6 @@ public struct Presentation: Unique, Equatable { public var speakers: Set } -// MARK: - Supporting Types - -public extension Presentation { - - public enum Level: String { - - case Beginner - case Intermediate - case Advanced - case NotApplicable = "N/A" - } -} - // MARK: - Equatable public func == (lhs: Presentation, rhs: Presentation) -> Bool { diff --git a/OpenStack Summit/CoreSummit/PresentationDataUpdate.swift b/OpenStack Summit/CoreSummit/PresentationDataUpdate.swift index b4e91462..97c88086 100644 --- a/OpenStack Summit/CoreSummit/PresentationDataUpdate.swift +++ b/OpenStack Summit/CoreSummit/PresentationDataUpdate.swift @@ -10,7 +10,7 @@ public struct PresentationDataUpdate: Unique { public let identifier: Identifier - public let level: Presentation.Level? + public let level: Level? public let moderator: Identifier? diff --git a/OpenStack Summit/CoreSummit/PresentationDataUpdateJSON.swift b/OpenStack Summit/CoreSummit/PresentationDataUpdateJSON.swift index 25321d09..55083c23 100644 --- a/OpenStack Summit/CoreSummit/PresentationDataUpdateJSON.swift +++ b/OpenStack Summit/CoreSummit/PresentationDataUpdateJSON.swift @@ -36,7 +36,7 @@ extension PresentationDataUpdate: JSONDecodable { if let levelString = JSONObject[JSONKey.level.rawValue]?.rawValue as? String { - guard let level = Presentation.Level(rawValue: levelString) + guard let level = Level(rawValue: levelString) else { return nil } self.level = level diff --git a/OpenStack Summit/OpenStack Summit.xcodeproj/project.pbxproj b/OpenStack Summit/OpenStack Summit.xcodeproj/project.pbxproj index bd9151d6..c05073e8 100644 --- a/OpenStack Summit/OpenStack Summit.xcodeproj/project.pbxproj +++ b/OpenStack Summit/OpenStack Summit.xcodeproj/project.pbxproj @@ -1074,6 +1074,10 @@ 9DABFF941DA6A75B00B3101A /* VenueFloorJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D1CE1071DA48BB60064B3B1 /* VenueFloorJSON.swift */; }; 9DABFF951DA6A75C00B3101A /* VenueFloorJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D1CE1071DA48BB60064B3B1 /* VenueFloorJSON.swift */; }; 9DABFF961DA6A75E00B3101A /* VenueFloorJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9D1CE1071DA48BB60064B3B1 /* VenueFloorJSON.swift */; }; + 9DEF130D1EA67153001798D4 /* Level.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DEF130C1EA67153001798D4 /* Level.swift */; }; + 9DEF130E1EA67153001798D4 /* Level.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DEF130C1EA67153001798D4 /* Level.swift */; }; + 9DEF130F1EA67153001798D4 /* Level.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DEF130C1EA67153001798D4 /* Level.swift */; }; + 9DEF13101EA67153001798D4 /* Level.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9DEF130C1EA67153001798D4 /* Level.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1758,6 +1762,7 @@ 6EFE54EB1E612BDD005EAB86 /* JSON.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JSON.framework; sourceTree = ""; }; 6EFE54EF1E612BDD005EAB86 /* SwiftFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = SwiftFoundation.framework; sourceTree = ""; }; 6EFE54F11E612BDD005EAB86 /* XCDYouTubeKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = XCDYouTubeKit.framework; sourceTree = ""; }; + 9D13D0A51EB39C3D00991DD2 /* GoogleService-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 9D1CE1051DA43DCF0064B3B1 /* VenueFloor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VenueFloor.swift; sourceTree = ""; }; 9D1CE1071DA48BB60064B3B1 /* VenueFloorJSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VenueFloorJSON.swift; sourceTree = ""; }; 9D4B1C231E84B01F00F98ECB /* AffiliationOrganization.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AffiliationOrganization.swift; sourceTree = ""; }; @@ -1770,6 +1775,7 @@ 9D6AADA81DBE4ABE0057888E /* DataUpdates6.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = DataUpdates6.json; sourceTree = ""; }; 9D6AADAB1DBE563A0057888E /* VenueRoomDataUpdateJSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VenueRoomDataUpdateJSON.swift; sourceTree = ""; }; 9D6AADAD1DBE56CB0057888E /* VenueRoomDataUpdate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VenueRoomDataUpdate.swift; sourceTree = ""; }; + 9DEF130C1EA67153001798D4 /* Level.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Level.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -2010,9 +2016,9 @@ 6E9B22D71D40171800D25271 /* Venue.storyboard */, 6E8D109C1DF8957100A0BBDC /* Teams.storyboard */, 6EEED02C1E3A4DAD00795B3D /* Notifications.storyboard */, + 6ED495821D792F7800749940 /* Debug.entitlements */, 6E5BE4191D76996600E323D3 /* Beta.entitlements */, 6ED495811D792F7800749940 /* Release.entitlements */, - 6ED495821D792F7800749940 /* Debug.entitlements */, 6E104D3D1D1061AC00541E84 /* Info.plist */, 6E5DEDB51E2D300C00F45602 /* GoogleServices */, 6EF147ED1D1357A100D5EEF9 /* Controller */, @@ -2107,6 +2113,7 @@ 6E10A52B1D10675C008CBD0C /* NonConfirmedAttendee.swift */, 6E10A52D1D10675C008CBD0C /* Person.swift */, 6E10A52E1D10675C008CBD0C /* Presentation.swift */, + 9DEF130C1EA67153001798D4 /* Level.swift */, 6E10A5301D10675C008CBD0C /* Speaker.swift */, 6E10A5481D10675C008CBD0C /* Summit.swift */, 6E10A5491D10675C008CBD0C /* Attendee.swift */, @@ -2403,8 +2410,9 @@ 6E5DEDB51E2D300C00F45602 /* GoogleServices */ = { isa = PBXGroup; children = ( - 6EEED02F1E3A60E900795B3D /* Beta */, 6E5DEDB61E2D300C00F45602 /* Debug */, + 6EEED02F1E3A60E900795B3D /* Beta */, + 9D13D0A41EB39C3D00991DD2 /* Release */, ); path = GoogleServices; sourceTree = SOURCE_ROOT; @@ -2937,6 +2945,14 @@ path = ../../Carthage/Build/Mac; sourceTree = ""; }; + 9D13D0A41EB39C3D00991DD2 /* Release */ = { + isa = PBXGroup; + children = ( + 9D13D0A51EB39C3D00991DD2 /* GoogleService-Info.plist */, + ); + path = Release; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -3980,6 +3996,7 @@ 6EE954551E92A0BC006B1330 /* Compound.swift in Sources */, 6EB1FDF51E1C073E0048045D /* TeamInvitationRequest.swift in Sources */, 6EBC49051E1394FE0077806B /* TeamMessageJSON.swift in Sources */, + 9DEF13101EA67153001798D4 /* Level.swift in Sources */, 9DABFF911DA6A74C00B3101A /* VenueFloor.swift in Sources */, 6E0B5F0A1D77C8950005F6CE /* Video.swift in Sources */, 6E1BCFF11E37A5FE00059E94 /* MemberJSON.swift in Sources */, @@ -4169,6 +4186,7 @@ 6EF4F86B1DC8D1D300D31A99 /* CoreDataDecodable.swift in Sources */, 6E10A58C1D10675D008CBD0C /* Attendee.swift in Sources */, 6EFC6E691D2322E70087057A /* EventScheduleRequest.swift in Sources */, + 9DEF130D1EA67153001798D4 /* Level.swift in Sources */, 6E10A55F1D10675D008CBD0C /* ErrorValue.swift in Sources */, 6E570A361D67753D00189992 /* PresentationDataUpdate.swift in Sources */, 9D6AADB21DBE58030057888E /* VenueRoomDataUpdateJSON.swift in Sources */, @@ -4401,6 +4419,7 @@ 6E2923D21D7AF8C900D14F0A /* Configuration.swift in Sources */, 6E2923D31D7AF8C900D14F0A /* EventType.swift in Sources */, 6E2923D41D7AF8C900D14F0A /* Venue.swift in Sources */, + 9DEF130F1EA67153001798D4 /* Level.swift in Sources */, 6E2923D51D7AF8C900D14F0A /* TicketTypeJSON.swift in Sources */, 6E2923D61D7AF8C900D14F0A /* TicketOrderRequest.swift in Sources */, 6E99B8AB1DC7D68F009CE28D /* Model.xcdatamodeld in Sources */, @@ -4533,6 +4552,7 @@ 6E7557B81E58C48C003B6844 /* CoreDataDecodable.swift in Sources */, 6E7557B91E58C48C003B6844 /* Attendee.swift in Sources */, 6E7557BA1E58C48C003B6844 /* EventScheduleRequest.swift in Sources */, + 9DEF130E1EA67153001798D4 /* Level.swift in Sources */, 6E7557BB1E58C48C003B6844 /* ErrorValue.swift in Sources */, 6E7557BC1E58C48C003B6844 /* PresentationDataUpdate.swift in Sources */, 6E7557BD1E58C48C003B6844 /* VenueRoomDataUpdateJSON.swift in Sources */, diff --git a/OpenStack Summit/OpenStack Summit/AppDelegate.swift b/OpenStack Summit/OpenStack Summit/AppDelegate.swift index 046d5f9b..2a85ace4 100644 --- a/OpenStack Summit/OpenStack Summit/AppDelegate.swift +++ b/OpenStack Summit/OpenStack Summit/AppDelegate.swift @@ -167,7 +167,12 @@ final class AppDelegate: UIResponder, UIApplicationDelegate, SummitActivityHandl // Print full message. print("Recieved remote notification: \(userInfo)") - PushNotificationManager.shared.process(userInfo as! [String: String]) + var notification = userInfo + notification.removeValueForKey("aps") + + if let notification = notification as? [String: String] { + PushNotificationManager.shared.process(notification) + } completionHandler(.NewData) } diff --git a/OpenStack Summit/OpenStack Summit/AttendeeConfirmViewController.swift b/OpenStack Summit/OpenStack Summit/AttendeeConfirmViewController.swift index 12d4851c..09625e95 100644 --- a/OpenStack Summit/OpenStack Summit/AttendeeConfirmViewController.swift +++ b/OpenStack Summit/OpenStack Summit/AttendeeConfirmViewController.swift @@ -277,6 +277,8 @@ final class AttendeeConfirmViewController: UITableViewController, MessageEnabled let cell = tableView.dequeueReusableCellWithIdentifier(R.reuseIdentifier.attendeeConfirmSelectionTableViewCell)! + cell.pickerView.reloadAllComponents() + return cell case .action: diff --git a/OpenStack Summit/OpenStack Summit/Event.storyboard b/OpenStack Summit/OpenStack Summit/Event.storyboard index cc4b0bec..6ad3f77c 100644 --- a/OpenStack Summit/OpenStack Summit/Event.storyboard +++ b/OpenStack Summit/OpenStack Summit/Event.storyboard @@ -1,5 +1,5 @@ - + @@ -188,9 +188,9 @@