Skip to content

Commit ef0ee1a

Browse files
Merge pull request #84 from pyconjp/release/v2.0.0
Release for v2.0.0
2 parents 93f1fee + a4b6785 commit ef0ee1a

File tree

174 files changed

+3310
-2143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+3310
-2143
lines changed

.swiftlint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
disabled_rules:
2-
# FourceCastを許可
2+
# ForceCastを許可
33
- force_cast
44
# FourceTryを許可
55
- force_try

Cartfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# PyCon JP use Library
2-
github "Alamofire/Alamofire" ~> 4.0
3-
github "Alamofire/AlamofireImage" ~> 3.0
2+
github "ishkawa/APIKit" ~> 3.0
3+
github "antitypical/Result" ~> 3.0
4+
github "onevcat/Kingfisher" ~> 3.0
45
github "realm/realm-cocoa" ~> 2.0
6+
github "kishikawakatsumi/SpreadsheetView"

PyConJP.xcodeproj/project.pbxproj

Lines changed: 357 additions & 230 deletions
Large diffs are not rendered by default.

PyConJP.xcodeproj/xcshareddata/xcschemes/PyConJP2016.xcscheme renamed to PyConJP.xcodeproj/xcshareddata/xcschemes/PyConJP.xcscheme

File renamed without changes.
Lines changed: 26 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,57 @@
11
//
22
// AppDelegate.swift
3-
// PyConJP2016
3+
// PyConJP
44
//
55
// Created by Yutaro Muta on 2016/02/16.
66
// Copyright © 2016 PyCon JP. All rights reserved.
77
//
88

99
import UIKit
10+
import APIKit
1011
import RealmSwift
1112

1213
@UIApplicationMain
13-
class AppDelegate: UIResponder, UIApplicationDelegate, TalksAPIProtocol, ErrorAlertProtocol {
14+
class AppDelegate: UIResponder, UIApplicationDelegate, ReceiveLocalNotificationProtocol, ErrorAlertProtocol {
1415

1516
var window: UIWindow?
1617

1718
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
18-
// let settings = UIUserNotificationSettings(forTypes: [UIUserNotificationType.Alert, UIUserNotificationType.Badge, UIUserNotificationType.Sound], categories: nil)
19-
// UIApplication.sharedApplication().registerUserNotificationSettings(settings)
20-
//
21-
// if let _ = launchOptions![UIApplicationLaunchOptionsURLKey] as? [NSObject : AnyObject] {
22-
// if let osVersion = Float64(UIDevice.currentDevice().systemVersion) {
23-
// if osVersion >= 9.0 {
24-
// }
25-
// }
26-
// }
27-
// if let launchOptions = launchOptions {
28-
// if let localNotification = launchOptions[UIApplicationLaunchOptionsLocalNotificationKey] as? UILocalNotification {
29-
// self.application(application, didReceiveLocalNotification: localNotification)
30-
// }
31-
// }
3219

33-
getTalks { result in
34-
switch result {
35-
case .success:
36-
NotificationCenter.default.post(name: Notification.Name(rawValue: PCJNotificationConfig.CompleteFetchDataNotification), object: nil)
37-
case .failure(let error):
38-
self.showErrorAlart(with: error)
39-
}
40-
}
20+
getTalksFromAPI()
4121

42-
UINavigationBar.appearance().barTintColor = UIColor.PyConJP2016.red
22+
UINavigationBar.appearance().barTintColor = UIColor.PyConJP2017.navy
4323
UINavigationBar.appearance().tintColor = .white
4424
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName: UIColor.white]
4525

46-
UITabBar.appearance().tintColor = UIColor.PyConJP2016.blue
47-
UITabBarItem.appearance().setTitleTextAttributes([NSFontAttributeName: UIFont.boldSystemFont(ofSize: 10), NSForegroundColorAttributeName: UIColor.PyConJP2016.blue], for: .selected)
26+
UITabBar.appearance().tintColor = UIColor.PyConJP2017.yellow
27+
UITabBarItem.appearance().setTitleTextAttributes([NSFontAttributeName: UIFont.boldSystemFont(ofSize: 10), NSForegroundColorAttributeName: UIColor.PyConJP2017.yellow], for: .selected)
28+
29+
let configuration = Realm.Configuration(schemaVersion: 1, deleteRealmIfMigrationNeeded: true)
30+
Realm.Configuration.defaultConfiguration = configuration
4831

4932
return true
5033
}
5134

52-
func applicationWillResignActive(_ application: UIApplication) {
53-
}
54-
55-
func applicationDidEnterBackground(_ application: UIApplication) {
56-
}
57-
58-
func applicationWillEnterForeground(_ application: UIApplication) {
59-
}
60-
61-
func applicationDidBecomeActive(_ application: UIApplication) {
62-
UIApplication.shared.applicationIconBadgeNumber = 0
35+
func application(_ application: UIApplication, didReceive notification: UILocalNotification) {
36+
handle(application, didReceiveLocalNotification: notification)
37+
UIApplication.shared.cancelLocalNotification(notification)
6338
}
6439

65-
func applicationWillTerminate(_ application: UIApplication) {
66-
}
40+
}
41+
42+
extension AppDelegate {
6743

68-
func application(_ application: UIApplication, didReceive notification: UILocalNotification) {
69-
if let userInfo = notification.userInfo {
70-
let receiveLocalNotificationManager = ReceiveLocalNotificationManager()
71-
receiveLocalNotificationManager.application(application, didReceiveLocalNotification: userInfo)
44+
fileprivate func getTalksFromAPI() {
45+
let request = TalksAPIRequest()
46+
Session.send(request) { [weak self](result) in
47+
switch result {
48+
case .success(let talks):
49+
try? SaveTalksRequest().save(talks: talks)
50+
NotificationCenter.default.post(name: Notification.Name(rawValue: PCJNotificationConfig.completeFetchDataNotification), object: nil)
51+
case .failure(let error):
52+
self?.showErrorAlart(with: error)
53+
}
7254
}
73-
74-
UIApplication.shared.cancelLocalNotification(notification)
7555
}
7656

7757
}

PyConJP/Application/PCJConfig.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
//
22
// PCJConfig.swift
3-
// PyConJP2016
3+
// PyConJP
44
//
55
// Created by Yutaro Muta on 8/30/2016.
66
// Copyright © 2016 PyCon JP. All rights reserved.
77
//
88

9-
import UIKit
9+
import Foundation
1010

1111
enum PCJConfig {
1212

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
//
22
// PCJNotificationConfig.swift
3-
// PyConJP2016
3+
// PyConJP
44
//
55
// Created by Yutaro Muta on 2016/07/21.
66
// Copyright © 2016 PyCon JP. All rights reserved.
77
//
88

9-
import UIKit
9+
import Foundation
1010

1111
enum PCJNotificationConfig {
1212

13-
static let CompleteFetchDataNotification = "CompleteFetchDateNotification"
13+
static let completeFetchDataNotification = "CompleteFetchDateNotification"
1414

1515
}

PyConJP/Assets.xcassets/App/Image/Launch.imageset/Contents.json

Lines changed: 0 additions & 23 deletions
This file was deleted.
-6.78 KB
Binary file not shown.
-13.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)