Skip to content

Commit

Permalink
Merge pull request #84 from pyconjp/release/v2.0.0
Browse files Browse the repository at this point in the history
Release for v2.0.0
  • Loading branch information
yutailang0119 authored Sep 6, 2017
2 parents 93f1fee + a4b6785 commit ef0ee1a
Show file tree
Hide file tree
Showing 174 changed files with 3,310 additions and 2,143 deletions.
2 changes: 1 addition & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
disabled_rules:
# FourceCastを許可
# ForceCastを許可
- force_cast
# FourceTryを許可
- force_try
Expand Down
6 changes: 4 additions & 2 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# PyCon JP use Library
github "Alamofire/Alamofire" ~> 4.0
github "Alamofire/AlamofireImage" ~> 3.0
github "ishkawa/APIKit" ~> 3.0
github "antitypical/Result" ~> 3.0
github "onevcat/Kingfisher" ~> 3.0
github "realm/realm-cocoa" ~> 2.0
github "kishikawakatsumi/SpreadsheetView"
587 changes: 357 additions & 230 deletions PyConJP.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

72 changes: 26 additions & 46 deletions PyConJP/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,77 +1,57 @@
//
// AppDelegate.swift
// PyConJP2016
// PyConJP
//
// Created by Yutaro Muta on 2016/02/16.
// Copyright © 2016 PyCon JP. All rights reserved.
//

import UIKit
import APIKit
import RealmSwift

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, TalksAPIProtocol, ErrorAlertProtocol {
class AppDelegate: UIResponder, UIApplicationDelegate, ReceiveLocalNotificationProtocol, ErrorAlertProtocol {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// let settings = UIUserNotificationSettings(forTypes: [UIUserNotificationType.Alert, UIUserNotificationType.Badge, UIUserNotificationType.Sound], categories: nil)
// UIApplication.sharedApplication().registerUserNotificationSettings(settings)
//
// if let _ = launchOptions![UIApplicationLaunchOptionsURLKey] as? [NSObject : AnyObject] {
// if let osVersion = Float64(UIDevice.currentDevice().systemVersion) {
// if osVersion >= 9.0 {
// }
// }
// }
// if let launchOptions = launchOptions {
// if let localNotification = launchOptions[UIApplicationLaunchOptionsLocalNotificationKey] as? UILocalNotification {
// self.application(application, didReceiveLocalNotification: localNotification)
// }
// }

getTalks { result in
switch result {
case .success:
NotificationCenter.default.post(name: Notification.Name(rawValue: PCJNotificationConfig.CompleteFetchDataNotification), object: nil)
case .failure(let error):
self.showErrorAlart(with: error)
}
}
getTalksFromAPI()

UINavigationBar.appearance().barTintColor = UIColor.PyConJP2016.red
UINavigationBar.appearance().barTintColor = UIColor.PyConJP2017.navy
UINavigationBar.appearance().tintColor = .white
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName: UIColor.white]

UITabBar.appearance().tintColor = UIColor.PyConJP2016.blue
UITabBarItem.appearance().setTitleTextAttributes([NSFontAttributeName: UIFont.boldSystemFont(ofSize: 10), NSForegroundColorAttributeName: UIColor.PyConJP2016.blue], for: .selected)
UITabBar.appearance().tintColor = UIColor.PyConJP2017.yellow
UITabBarItem.appearance().setTitleTextAttributes([NSFontAttributeName: UIFont.boldSystemFont(ofSize: 10), NSForegroundColorAttributeName: UIColor.PyConJP2017.yellow], for: .selected)

let configuration = Realm.Configuration(schemaVersion: 1, deleteRealmIfMigrationNeeded: true)
Realm.Configuration.defaultConfiguration = configuration

return true
}

func applicationWillResignActive(_ application: UIApplication) {
}

func applicationDidEnterBackground(_ application: UIApplication) {
}

func applicationWillEnterForeground(_ application: UIApplication) {
}

func applicationDidBecomeActive(_ application: UIApplication) {
UIApplication.shared.applicationIconBadgeNumber = 0
func application(_ application: UIApplication, didReceive notification: UILocalNotification) {
handle(application, didReceiveLocalNotification: notification)
UIApplication.shared.cancelLocalNotification(notification)
}

func applicationWillTerminate(_ application: UIApplication) {
}
}

extension AppDelegate {

func application(_ application: UIApplication, didReceive notification: UILocalNotification) {
if let userInfo = notification.userInfo {
let receiveLocalNotificationManager = ReceiveLocalNotificationManager()
receiveLocalNotificationManager.application(application, didReceiveLocalNotification: userInfo)
fileprivate func getTalksFromAPI() {
let request = TalksAPIRequest()
Session.send(request) { [weak self](result) in
switch result {
case .success(let talks):
try? SaveTalksRequest().save(talks: talks)
NotificationCenter.default.post(name: Notification.Name(rawValue: PCJNotificationConfig.completeFetchDataNotification), object: nil)
case .failure(let error):
self?.showErrorAlart(with: error)
}
}

UIApplication.shared.cancelLocalNotification(notification)
}

}
4 changes: 2 additions & 2 deletions PyConJP/Application/PCJConfig.swift
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//
// PCJConfig.swift
// PyConJP2016
// PyConJP
//
// Created by Yutaro Muta on 8/30/2016.
// Copyright © 2016 PyCon JP. All rights reserved.
//

import UIKit
import Foundation

enum PCJConfig {

Expand Down
6 changes: 3 additions & 3 deletions PyConJP/Application/PCJNotificationConfig.swift
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
//
// PCJNotificationConfig.swift
// PyConJP2016
// PyConJP
//
// Created by Yutaro Muta on 2016/07/21.
// Copyright © 2016 PyCon JP. All rights reserved.
//

import UIKit
import Foundation

enum PCJNotificationConfig {

static let CompleteFetchDataNotification = "CompleteFetchDateNotification"
static let completeFetchDataNotification = "CompleteFetchDateNotification"

}
23 changes: 0 additions & 23 deletions PyConJP/Assets.xcassets/App/Image/Launch.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"images" : [
{
"idiom" : "universal",
"filename" : "floor_1.png",
"filename" : "1st-floor@1x.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "floor_1@2x.png",
"filename" : "1st-floor@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "floor_1@3x.png",
"filename" : "1st-floor@3x.png",
"scale" : "3x"
}
],
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"images" : [
{
"idiom" : "universal",
"filename" : "floor_2.png",
"filename" : "2nd-floor@1x.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "floor_2@2x.png",
"filename" : "2nd-floor@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "floor_2@3x.png",
"filename" : "2nd-floor@3x.png",
"scale" : "3x"
}
],
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"images" : [
{
"idiom" : "universal",
"filename" : "floor_3.png",
"filename" : "3rd-floor@1x.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "floor_3@2x.png",
"filename" : "3rd-floor@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "floor_3@3x.png",
"filename" : "3rd-floor@3x.png",
"scale" : "3x"
}
],
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified PyConJP/Assets.xcassets/AppIcon.appiconset/icon@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PyConJP/Assets.xcassets/AppIcon.appiconset/icon@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PyConJP/Assets.xcassets/AppIcon.appiconset/spotlight@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified PyConJP/Assets.xcassets/AppIcon.appiconset/spotlight@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions PyConJP/Assets.xcassets/LaunchImage.launchimage/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"images" : [
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "Portrait 5.5.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "Landscape 5.png",
"minimum-system-version" : "8.0",
"orientation" : "landscape",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "667h",
"filename" : "Portrait 4.7.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "Portrait 3.5.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "retina4",
"filename" : "Portrait 4.png",
"minimum-system-version" : "7.0",
"orientation" : "portrait",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
34 changes: 0 additions & 34 deletions PyConJP/DataSource/Timeline/Bookmark/BookmarkListDataSource.swift

This file was deleted.

This file was deleted.

Loading

0 comments on commit ef0ee1a

Please sign in to comment.