diff --git a/Cartfile b/Cartfile index a9e8bed0..ab370253 100644 --- a/Cartfile +++ b/Cartfile @@ -1,16 +1,16 @@ -github "OpenStack-Mobile/SwiftFoundation" "Swift.2.2" +github "PureSwift/JSON" "master" +github "PureSwift/Predicate" "master" github "OpenStack-Mobile/aerogear-ios-http" "master" github "OpenStack-Mobile/aerogear-ios-oauth2" "openstack" github "JonasGessner/JGProgressHUD" -github "OpenStack-Mobile/XLPagerTabStrip" "master" +github "xmartlabs/XLPagerTabStrip" github "OpenStack-Mobile/SWRevealViewController" "master" -github "OpenStack-Mobile/R.swift.Library" "OpenStack" +github "mac-cain13/R.swift.Library" github "OpenStack-Mobile/HanekeSwift" "master" github "OpenStack-Mobile/KTCenterFlowLayout" "master" github "OpenStack-Mobile/AFHorizontalDayPicker" "master" -github "OpenStack-Mobile/Cosmos" "swift-2.3" -github "OpenStack-Mobile/AHKActionSheet" "master" -github "OpenStack-Mobile/ImageSlideshow" "master" +github "marketplacer/Cosmos" +github "zvonicek/ImageSlideshow" github "OpenStack-Mobile/XCDYouTubeKit" github "OpenStack-Mobile/MTDates" "master" -github "OpenStack-mobile/SlackTextViewController" +github "OpenStack-Mobile/SlackTextViewController" diff --git a/Cartfile.resolved b/Cartfile.resolved index 12458ecd..82b7763e 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,17 +1,17 @@ -github "OpenStack-Mobile/AHKActionSheet" "4ac799305b10ac39306dfdf45a359f88c94cc41d" -github "OpenStack-Mobile/Cosmos" "2ee4a896fcbdc915e95bcb7456f996c27492fb34" -github "OpenStack-Mobile/HanekeSwift" "9854d345ecb620299b9c2eb1c2f94cbda6e692d6" -github "OpenStack-Mobile/ImageSlideshow" "38587ee81532ffafff989a18f45cb0be399fa078" +github "marketplacer/Cosmos" "9.0.0" +github "OpenStack-Mobile/HanekeSwift" "e97c06307fd8cd5b3a03875d0950d73db688f2bd" +github "zvonicek/ImageSlideshow" "1.3.0" github "JonasGessner/JGProgressHUD" "v1.4.1" -github "PureSwift/JSON-C" "cb04249de9ed23ecc5e3ea772a4c6c46f86b3d86" +github "PureSwift/JSON" "e208ddd1df2749d4f2fc5bc2392d8bebd1edafb8" github "OpenStack-Mobile/KTCenterFlowLayout" "603f33180563cfa4fcab99a0623bbde21e49665b" github "OpenStack-Mobile/MTDates" "def729947a5f07d6440ce9b97f2761af299bc13c" -github "OpenStack-Mobile/R.swift.Library" "45bfbc29afc2ac9115187a4b4f869339f2447648" +github "AliSoftware/OHHTTPStubs" "6.0.0" +github "PureSwift/Predicate" "36141936dfcacd847f6b5a3a0a08b38e22354576" +github "mac-cain13/R.swift.Library" "v3.0.2" github "OpenStack-Mobile/SWRevealViewController" "c3113e1508597ee2d9ea7081d97caa5117dddf00" -github "OpenStack-mobile/SlackTextViewController" "v1.9.5" +github "OpenStack-Mobile/SlackTextViewController" "v1.9.5" github "OpenStack-Mobile/XCDYouTubeKit" "2.5.3" -github "OpenStack-Mobile/XLPagerTabStrip" "dd31ec30fc71d7cd534cf81662b9f1ff3875b7d0" -github "OpenStack-Mobile/aerogear-ios-http" "274b560fbf9fb902fbb329bdbd20a728521fd186" +github "xmartlabs/XLPagerTabStrip" "7.0.0" github "OpenStack-Mobile/AFHorizontalDayPicker" "74c3521f935039b2b6e945380ecd06752076ec8a" -github "OpenStack-Mobile/SwiftFoundation" "6288d7a238fd503498fd26cf199c17ed3894c508" -github "OpenStack-Mobile/aerogear-ios-oauth2" "8a3a5599adea4586e28f0ac7a1540bbc09af4c8d" +github "OpenStack-Mobile/aerogear-ios-http" "baeeaf6947d1afb58e3235a732b50c5a58923cad" +github "OpenStack-Mobile/aerogear-ios-oauth2" "6a134a2e68ea612960ba10e18524280aa69ca356" diff --git a/OpenStack Summit/CoreSummit/Affiliation.swift b/OpenStack Summit/CoreSummit/Affiliation.swift index d3e1f653..0928acd7 100644 --- a/OpenStack Summit/CoreSummit/Affiliation.swift +++ b/OpenStack Summit/CoreSummit/Affiliation.swift @@ -6,7 +6,7 @@ // Copyright © 2017 OpenStack. All rights reserved. // -import struct SwiftFoundation.Date +import struct Foundation.Date public struct Affiliation: Unique { diff --git a/OpenStack Summit/CoreSummit/AffiliationJSON.swift b/OpenStack Summit/CoreSummit/AffiliationJSON.swift index 8513c720..aa91ab8d 100644 --- a/OpenStack Summit/CoreSummit/AffiliationJSON.swift +++ b/OpenStack Summit/CoreSummit/AffiliationJSON.swift @@ -6,7 +6,7 @@ // Copyright © 2017 OpenStack. All rights reserved. // -import SwiftFoundation +import JSON public extension Affiliation { @@ -18,14 +18,14 @@ public extension Affiliation { extension Affiliation: JSONDecodable { - public init?(JSONValue: JSON.Value) { + public init?(json JSONValue: JSON.Value) { guard let JSONObject = JSONValue.objectValue, - let identifier = JSONObject[JSONKey.id.rawValue]?.rawValue as? Int, + let identifier = JSONObject[JSONKey.id.rawValue]?.integerValue, let isCurrent = JSONObject[JSONKey.is_current.rawValue]?.rawValue as? Bool, let organizationJSON = JSONObject[JSONKey.organization.rawValue], - let organization = AffiliationOrganization(JSONValue: organizationJSON), - let member = JSONObject[JSONKey.owner_id.rawValue]?.rawValue as? Int + let organization = AffiliationOrganization(json: organizationJSON), + let member = JSONObject[JSONKey.owner_id.rawValue]?.integerValue else { return nil } self.identifier = identifier @@ -35,7 +35,7 @@ extension Affiliation: JSONDecodable { // optional values - if let startDate = JSONObject[JSONKey.start_date.rawValue]?.rawValue as? Int { + if let startDate = JSONObject[JSONKey.start_date.rawValue]?.integerValue { self.start = Date(timeIntervalSince1970: TimeInterval(startDate)) @@ -44,7 +44,7 @@ extension Affiliation: JSONDecodable { self.start = nil } - if let endDate = JSONObject[JSONKey.end_date.rawValue]?.rawValue as? Int { + if let endDate = JSONObject[JSONKey.end_date.rawValue]?.integerValue { self.end = Date(timeIntervalSince1970: TimeInterval(endDate)) diff --git a/OpenStack Summit/CoreSummit/AffiliationManagedObject.swift b/OpenStack Summit/CoreSummit/AffiliationManagedObject.swift index e682c0d4..624382c9 100644 --- a/OpenStack Summit/CoreSummit/AffiliationManagedObject.swift +++ b/OpenStack Summit/CoreSummit/AffiliationManagedObject.swift @@ -7,15 +7,15 @@ // import CoreData -import SwiftFoundation +import Foundation public final class AffiliationManagedObject: Entity { @NSManaged public var member: MemberManagedObject - @NSManaged public var start: NSDate? + @NSManaged public var start: Date? - @NSManaged public var end: NSDate? + @NSManaged public var end: Date? @NSManaged public var isCurrent: Bool @@ -26,14 +26,14 @@ extension Affiliation: CoreDataDecodable { public init(managedObject: AffiliationManagedObject) { - self.identifier = managedObject.identifier + self.identifier = managedObject.id self.isCurrent = managedObject.isCurrent - self.member = managedObject.member.identifier + self.member = managedObject.member.id self.organization = AffiliationOrganization(managedObject: managedObject.organization) if let startDate = managedObject.start { - self.start = Date(foundation: startDate) + self.start = startDate } else { @@ -42,7 +42,7 @@ extension Affiliation: CoreDataDecodable { if let endDate = managedObject.end { - self.end = Date(foundation: endDate) + self.end = endDate } else { @@ -53,12 +53,12 @@ extension Affiliation: CoreDataDecodable { extension Affiliation: CoreDataEncodable { - public func save(context: NSManagedObjectContext) throws -> AffiliationManagedObject { + public func save(_ context: NSManagedObjectContext) throws -> AffiliationManagedObject { let managedObject = try cached(context) - managedObject.start = start?.toFoundation() - managedObject.end = end?.toFoundation() + managedObject.start = start + managedObject.end = end managedObject.isCurrent = isCurrent managedObject.member = try context.relationshipFault(member) managedObject.organization = try context.relationshipFault(organization) diff --git a/OpenStack Summit/CoreSummit/AffiliationOrganizationJSON.swift b/OpenStack Summit/CoreSummit/AffiliationOrganizationJSON.swift index 0340097f..0a3d88e6 100644 --- a/OpenStack Summit/CoreSummit/AffiliationOrganizationJSON.swift +++ b/OpenStack Summit/CoreSummit/AffiliationOrganizationJSON.swift @@ -6,7 +6,7 @@ // Copyright © 2017 OpenStack. All rights reserved. // -import SwiftFoundation +import JSON public extension AffiliationOrganization { @@ -18,10 +18,10 @@ public extension AffiliationOrganization { extension AffiliationOrganization: JSONDecodable { - public init?(JSONValue: JSON.Value) { + public init?(json JSONValue: JSON.Value) { guard let JSONObject = JSONValue.objectValue, - let identifier = JSONObject[JSONKey.id.rawValue]?.rawValue as? Int, + let identifier = JSONObject[JSONKey.id.rawValue]?.integerValue, let name = JSONObject[JSONKey.name.rawValue]?.rawValue as? String else { return nil } diff --git a/OpenStack Summit/CoreSummit/AffiliationOrganizationManagedObject.swift b/OpenStack Summit/CoreSummit/AffiliationOrganizationManagedObject.swift index f07cf2c5..55f1dd50 100644 --- a/OpenStack Summit/CoreSummit/AffiliationOrganizationManagedObject.swift +++ b/OpenStack Summit/CoreSummit/AffiliationOrganizationManagedObject.swift @@ -17,14 +17,14 @@ extension AffiliationOrganization: CoreDataDecodable { public init(managedObject: AffiliationOrganizationManagedObject) { - self.identifier = managedObject.identifier + self.identifier = managedObject.id self.name = managedObject.name } } extension AffiliationOrganization: CoreDataEncodable { - public func save(context: NSManagedObjectContext) throws -> AffiliationOrganizationManagedObject { + public func save(_ context: NSManagedObjectContext) throws -> AffiliationOrganizationManagedObject { let managedObject = try cached(context) diff --git a/OpenStack Summit/CoreSummit/AttendeeJSON.swift b/OpenStack Summit/CoreSummit/AttendeeJSON.swift index 3c3ba345..63a98b09 100644 --- a/OpenStack Summit/CoreSummit/AttendeeJSON.swift +++ b/OpenStack Summit/CoreSummit/AttendeeJSON.swift @@ -6,7 +6,7 @@ // Copyright © 2016 OpenStack. All rights reserved. // -import SwiftFoundation +import JSON public extension Attendee { @@ -18,15 +18,15 @@ public extension Attendee { extension Attendee: JSONDecodable { - public init?(JSONValue: JSON.Value) { + public init?(json JSONValue: JSON.Value) { guard let JSONObject = JSONValue.objectValue, - let identifier = JSONObject[JSONKey.id.rawValue]?.rawValue as? Int, - let member = JSONObject[JSONKey.member_id.rawValue]?.rawValue as? Int, + let identifier = JSONObject[JSONKey.id.rawValue]?.integerValue, + let member = JSONObject[JSONKey.member_id.rawValue]?.integerValue, let scheduledEventsJSONArray = JSONObject[JSONKey.schedule.rawValue]?.arrayValue, - let scheduledEvents = Identifier.fromJSON(scheduledEventsJSONArray), + let scheduledEvents = Identifier.from(json: scheduledEventsJSONArray), let ticketsJSONArray = JSONObject[JSONKey.tickets.rawValue]?.arrayValue, - let tickets = Identifier.fromJSON(ticketsJSONArray) + let tickets = Identifier.from(json: ticketsJSONArray) else { return nil } self.identifier = identifier diff --git a/OpenStack Summit/CoreSummit/AttendeeManagedObject.swift b/OpenStack Summit/CoreSummit/AttendeeManagedObject.swift index d9770a76..d78f9851 100644 --- a/OpenStack Summit/CoreSummit/AttendeeManagedObject.swift +++ b/OpenStack Summit/CoreSummit/AttendeeManagedObject.swift @@ -22,8 +22,8 @@ extension Attendee: CoreDataDecodable { public init(managedObject: AttendeeManagedObject) { - self.identifier = managedObject.identifier - self.member = managedObject.member.identifier + self.identifier = managedObject.id + self.member = managedObject.member.id self.tickets = managedObject.tickets.identifiers self.schedule = managedObject.schedule.identifiers } @@ -31,7 +31,7 @@ extension Attendee: CoreDataDecodable { extension Attendee: CoreDataEncodable { - public func save(context: NSManagedObjectContext) throws -> AttendeeManagedObject { + public func save(_ context: NSManagedObjectContext) throws -> AttendeeManagedObject { let managedObject = try cached(context) diff --git a/OpenStack Summit/CoreSummit/CollectionType.swift b/OpenStack Summit/CoreSummit/CollectionType.swift index 5457e273..7e4250c3 100644 --- a/OpenStack Summit/CoreSummit/CollectionType.swift +++ b/OpenStack Summit/CoreSummit/CollectionType.swift @@ -6,16 +6,7 @@ // Copyright © 2016 OpenStack. All rights reserved. // -public extension CollectionType { - - @inline(__always) - func firstMatching(@noescape predicate: (Self.Generator.Element) throws -> Bool) rethrows -> Self.Generator.Element? { - - guard let index = try self.indexOf(predicate) - else { return nil } - - return self[index] - } +public extension Collection { /// Attempt to reduce and convert the contents of the collection to another type. func reduce(to type: T.Type) -> [T] { @@ -32,4 +23,4 @@ public extension CollectionType { return newTypeArray } -} \ No newline at end of file +} diff --git a/OpenStack Summit/CoreSummit/CompanyJSON.swift b/OpenStack Summit/CoreSummit/CompanyJSON.swift index 37b22d3c..d3a78b80 100644 --- a/OpenStack Summit/CoreSummit/CompanyJSON.swift +++ b/OpenStack Summit/CoreSummit/CompanyJSON.swift @@ -6,7 +6,7 @@ // Copyright © 2016 OpenStack. All rights reserved. // -import SwiftFoundation +import JSON public extension Company { @@ -18,14 +18,14 @@ public extension Company { extension Company: JSONDecodable { - public init?(JSONValue: JSON.Value) { + public init?(json JSONValue: JSON.Value) { guard let JSONObject = JSONValue.objectValue, - let identifier = JSONObject[JSONKey.id.rawValue]?.rawValue as? Int, + let identifier = JSONObject[JSONKey.id.rawValue]?.integerValue, let name = JSONObject[JSONKey.name.rawValue]?.rawValue as? String else { return nil } self.identifier = identifier self.name = name } -} \ No newline at end of file +} diff --git a/OpenStack Summit/CoreSummit/CompanyManagedObject.swift b/OpenStack Summit/CoreSummit/CompanyManagedObject.swift index a1ff637a..c34141d1 100644 --- a/OpenStack Summit/CoreSummit/CompanyManagedObject.swift +++ b/OpenStack Summit/CoreSummit/CompanyManagedObject.swift @@ -24,14 +24,14 @@ extension Company: CoreDataDecodable { public init(managedObject: CompanyManagedObject) { - self.identifier = managedObject.identifier + self.identifier = managedObject.id self.name = managedObject.name } } extension Company: CoreDataEncodable { - public func save(context: NSManagedObjectContext) throws -> CompanyManagedObject { + public func save(_ context: NSManagedObjectContext) throws -> CompanyManagedObject { let managedObject = try cached(context) diff --git a/OpenStack Summit/CoreSummit/Comparison.swift b/OpenStack Summit/CoreSummit/Comparison.swift deleted file mode 100644 index 34320a82..00000000 --- a/OpenStack Summit/CoreSummit/Comparison.swift +++ /dev/null @@ -1,270 +0,0 @@ -// -// Comparison.swift -// Predicate -// -// Created by Alsey Coleman Miller on 4/2/17. -// Copyright © 2017 PureSwift. All rights reserved. -// - -public struct Comparision { - - public var expression: (left: Expression, right: Expression) - - public var type: Operator - - public var modifier: Modifier? - - public var options: Set