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

Swift 3 Migration #106

Merged
merged 68 commits into from
May 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
a2ad91d
Merge branch 'develop' into swift3
colemancda Apr 12, 2017
cfe191b
Merge branch 'develop' into swift3
colemancda Apr 12, 2017
5e24551
migrating to Swift 3
colemancda Apr 12, 2017
8b12c12
Merge branch 'develop' into swift3
colemancda Apr 13, 2017
77f0d73
migrating to Swift 3
colemancda Apr 14, 2017
7d29e7a
migrating to Swift 3
colemancda Apr 14, 2017
bf32ce6
migrating to Swift 3
colemancda Apr 14, 2017
41953a2
migrating to Swift 3
colemancda Apr 14, 2017
6650d3e
migrating to Swift 3
colemancda May 11, 2017
b31d1b2
migrating to Swift 3
colemancda May 11, 2017
e1db4bb
migrating to Swift 3
colemancda May 11, 2017
616afd4
migrating to Swift 3
colemancda May 11, 2017
576f608
migrating to Swift 3
colemancda May 11, 2017
495e994
Merge branch 'develop' into swift3
colemancda May 11, 2017
343f44c
Merge branch 'develop' into swift3
colemancda May 11, 2017
5f9146a
migrating to Swift 3
colemancda May 11, 2017
6bdb9e2
Merge branch 'develop' into swift3
colemancda May 11, 2017
35a6990
Merge branch 'develop' into swift3
colemancda May 11, 2017
333e785
migrating to Swift 3
colemancda May 11, 2017
076f72d
migrating to Swift 3
colemancda May 11, 2017
b3a5b14
migrating to Swift 3
colemancda May 11, 2017
9526d56
migrating to Swift 3
colemancda May 11, 2017
ddeb010
migrating to Swift 3
colemancda May 12, 2017
529f584
migrating to Swift 3
colemancda May 12, 2017
4ce4694
migrating to Swift 3
colemancda May 12, 2017
cb73ff7
migrating to Swift 3
colemancda May 12, 2017
de03676
migrating to Swift 3
colemancda May 12, 2017
f355de7
migrating to Swift 3
colemancda May 12, 2017
983eecf
migrating to Swift 3
colemancda May 12, 2017
33d56ed
migrating to Swift 3
colemancda May 13, 2017
5cbf12c
migrating to Swift 3
colemancda May 13, 2017
56f6b2a
migrating to Swift 3
colemancda May 13, 2017
8a3431c
migrating to Swift 3
colemancda May 13, 2017
12b9437
migrating to Swift 3
colemancda May 13, 2017
cf80178
[iOS] Added `UIAppFonts` to Info.plist
colemancda May 13, 2017
d743aec
Migrating to Swift 3
colemancda May 13, 2017
5a2b163
[iOS] Fixed `-[_SwiftValue unsignedIntegerValue]: unrecognized select…
colemancda May 13, 2017
6d06ad0
[iOS] Fixed images not loading in staging
colemancda May 13, 2017
bf4d52d
Updated dependencies
colemancda May 13, 2017
7ba5f17
[tvOS] [macOS] Removed `SwiftFoundation`
colemancda May 13, 2017
f35f824
[tvOS] Migrating to Swift 3
colemancda May 13, 2017
72ecc02
[tvOS] Migrating to Swift 3
colemancda May 13, 2017
872985e
[tvOS] Use 16:9 aspect ratio for videos
colemancda May 13, 2017
6884358
[tvOS] Fixed YouTube video not playing
colemancda May 13, 2017
1271c25
[macOS] Migrating to Swift 3
colemancda May 13, 2017
ae4b938
[macOS] Migrating to Swift 3
colemancda May 13, 2017
66a01a4
[macOS] Migrating to Swift 3
colemancda May 13, 2017
8bd224f
[CoreSummit] Fixed `SummitExternalLocation` Data Update
colemancda May 13, 2017
0d5d9fe
[iOS] Fixed `XLPagerTabStrip` crash
colemancda May 13, 2017
ae92f6b
[iOS] Fixed showing pushing navigation controller twice
colemancda May 13, 2017
4a34c9a
Migrating to Swift 3
colemancda May 13, 2017
4625268
[iOS] Fixed localized description of `time ago`
colemancda May 13, 2017
9063b00
[iOS] Fixed crash when loading `PersonDetailViewController`
colemancda May 13, 2017
0f375dc
[iOS] Fixed empty`LevelScheduleViewController`
colemancda May 13, 2017
5ceba7a
[tvOS] Poll for `DataUpdate`
colemancda May 13, 2017
9506bb5
[iOS] Fixed `PushNotificationManager` compilation error
colemancda May 13, 2017
10761cf
[tvOS] Include video's event description text for video meta data
colemancda May 13, 2017
b963a6f
[tvOS] Poll for `DataUpdate`
colemancda May 13, 2017
8aa430d
[tvOS] Improved video loading performance
colemancda May 14, 2017
9da7e02
[CoreSummit] Fixed missing references
colemancda May 14, 2017
04670a2
Store CoreData DB in caches subdirectory
colemancda May 14, 2017
bc30b11
[CoreSummit] change `toWebpage()` to `webpage(for:)`
colemancda May 14, 2017
89a90f8
[macOS] Fixed `SummitViewController`
colemancda May 14, 2017
04940b6
[CoreSummit] `EntityController` handle inserted objects
colemancda May 14, 2017
b78c6b0
Version bump
colemancda May 14, 2017
99c0b5c
Replacing `NSPredicate` with `Predicate`
colemancda May 15, 2017
f78f536
Replacing `NSPredicate` with `Predicate`
colemancda May 15, 2017
8e8b302
Replacing `NSPredicate` with `Predicate`
colemancda May 15, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 7 additions & 7 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -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"
22 changes: 11 additions & 11 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion OpenStack Summit/CoreSummit/Affiliation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2017 OpenStack. All rights reserved.
//

import struct SwiftFoundation.Date
import struct Foundation.Date

public struct Affiliation: Unique {

Expand Down
14 changes: 7 additions & 7 deletions OpenStack Summit/CoreSummit/AffiliationJSON.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2017 OpenStack. All rights reserved.
//

import SwiftFoundation
import JSON

public extension Affiliation {

Expand All @@ -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
Expand All @@ -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))

Expand All @@ -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))

Expand Down
20 changes: 10 additions & 10 deletions OpenStack Summit/CoreSummit/AffiliationManagedObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 {

Expand All @@ -42,7 +42,7 @@ extension Affiliation: CoreDataDecodable {

if let endDate = managedObject.end {

self.end = Date(foundation: endDate)
self.end = endDate

} else {

Expand All @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions OpenStack Summit/CoreSummit/AffiliationOrganizationJSON.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2017 OpenStack. All rights reserved.
//

import SwiftFoundation
import JSON

public extension AffiliationOrganization {

Expand All @@ -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 }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
12 changes: 6 additions & 6 deletions OpenStack Summit/CoreSummit/AttendeeJSON.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2016 OpenStack. All rights reserved.
//

import SwiftFoundation
import JSON

public extension Attendee {

Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions OpenStack Summit/CoreSummit/AttendeeManagedObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ 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
}
}

extension Attendee: CoreDataEncodable {

public func save(context: NSManagedObjectContext) throws -> AttendeeManagedObject {
public func save(_ context: NSManagedObjectContext) throws -> AttendeeManagedObject {

let managedObject = try cached(context)

Expand Down
13 changes: 2 additions & 11 deletions OpenStack Summit/CoreSummit/CollectionType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>(to type: T.Type) -> [T] {
Expand All @@ -32,4 +23,4 @@ public extension CollectionType {

return newTypeArray
}
}
}
8 changes: 4 additions & 4 deletions OpenStack Summit/CoreSummit/CompanyJSON.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Copyright © 2016 OpenStack. All rights reserved.
//

import SwiftFoundation
import JSON

public extension Company {

Expand All @@ -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
}
}
}
4 changes: 2 additions & 2 deletions OpenStack Summit/CoreSummit/CompanyManagedObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading