Skip to content

Commit

Permalink
Merge pull request #72 from pyconjp/develop
Browse files Browse the repository at this point in the history
Final merge for 2016
  • Loading branch information
yutailang0119 authored Feb 18, 2017
2 parents f562ee7 + ce1549a commit 93f1fee
Show file tree
Hide file tree
Showing 230 changed files with 3,801 additions and 3,201 deletions.
58 changes: 41 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,42 +1,66 @@
##Xcode
#BuildFile
# Xcode
## Build generated
build/
DerivedData
DerivedData/

#PrivateSetting
## Various settings
xcuserdata/

## Private setting
*.pbxuser
*mode1v3
*mode2v3
*perspectivev3
*moved-aside
*xcuserstate
*xccheckout

#DefaultSetting
## Default setting
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3

#CustomScheme
PyConJP2016.xcodeproj/xcuserdata
PyConJP2016.xcworkspace/xcuserdata
## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint

## CustomScheme
*.xcodeproj/xcuserdata
*.xcworkspace/xcuserdata

#Bundler
# Bundler
.bundle
Gemfile.lock
vendor

##cocoaPods
# CocoaPods
Pods/*
Podfile.lock
!default.xcworkspace
*.xcworkspace

#Carthage
# Carthage
Carthage/*
Cartfile.resolved

##AppCode
.idea
# fastlane
fastlane/*
!fastlane/Fastfile

# AppCode
## User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml

##OSX
## Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/dataSources.local.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml

# macOS
.DS_Store
.AppleDouble
.LSOverride

6 changes: 3 additions & 3 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PyCon JP use Library
github "Alamofire/Alamofire" ~> 3.5
github "Alamofire/AlamofireImage" ~> 2.5
github "realm/realm-cocoa" ~> 1.0
github "Alamofire/Alamofire" ~> 4.0
github "Alamofire/AlamofireImage" ~> 3.0
github "realm/realm-cocoa" ~> 2.0
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# frozen_string_literal: true
source "https://rubygems.org"

gem "fastlane"
1,703 changes: 1,703 additions & 0 deletions PyConJP.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0720"
LastUpgradeVersion = "0810"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -15,9 +15,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DBA1C0A81C7228E2004F0C8D"
BuildableName = "PyConJP2016.app"
BlueprintName = "PyConJP2016"
ReferencedContainer = "container:PyConJP2016.xcodeproj">
BuildableName = "PyConJP.app"
BlueprintName = "PyConJP"
ReferencedContainer = "container:PyConJP.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
Expand All @@ -33,29 +33,39 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DBA1C0BC1C7228E2004F0C8D"
BuildableName = "PyConJP2016Tests.xctest"
BlueprintName = "PyConJP2016Tests"
ReferencedContainer = "container:PyConJP2016.xcodeproj">
BuildableName = "PyConJPTests.xctest"
BlueprintName = "PyConJPTests"
ReferencedContainer = "container:PyConJP.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DBA1C0C71C7228E2004F0C8D"
BuildableName = "PyConJP2016UITests.xctest"
BlueprintName = "PyConJP2016UITests"
ReferencedContainer = "container:PyConJP2016.xcodeproj">
BuildableName = "PyConJPUITests.xctest"
BlueprintName = "PyConJPUITests"
ReferencedContainer = "container:PyConJP.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DB77FD511E06720D00504869"
BuildableName = "WebAPIFrameworkTests.xctest"
BlueprintName = "WebAPIFrameworkTests"
ReferencedContainer = "container:PyConJP.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DBA1C0A81C7228E2004F0C8D"
BuildableName = "PyConJP2016.app"
BlueprintName = "PyConJP2016"
ReferencedContainer = "container:PyConJP2016.xcodeproj">
BuildableName = "PyConJP.app"
BlueprintName = "PyConJP"
ReferencedContainer = "container:PyConJP.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
Expand All @@ -76,9 +86,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DBA1C0A81C7228E2004F0C8D"
BuildableName = "PyConJP2016.app"
BlueprintName = "PyConJP2016"
ReferencedContainer = "container:PyConJP2016.xcodeproj">
BuildableName = "PyConJP.app"
BlueprintName = "PyConJP"
ReferencedContainer = "container:PyConJP.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
Expand All @@ -95,9 +105,9 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DBA1C0A81C7228E2004F0C8D"
BuildableName = "PyConJP2016.app"
BlueprintName = "PyConJP2016"
ReferencedContainer = "container:PyConJP2016.xcodeproj">
BuildableName = "PyConJP.app"
BlueprintName = "PyConJP"
ReferencedContainer = "container:PyConJP.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import UIKit
import RealmSwift

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, TalksAPIType, ErrorAlertType {
class AppDelegate: UIResponder, UIApplicationDelegate, TalksAPIProtocol, ErrorAlertProtocol {

var window: UIWindow?

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
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)
//
Expand All @@ -32,46 +32,46 @@ class AppDelegate: UIResponder, UIApplicationDelegate, TalksAPIType, ErrorAlertT

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

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

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

return true
}

func applicationWillResignActive(application: UIApplication) {
func applicationWillResignActive(_ application: UIApplication) {
}

func applicationDidEnterBackground(application: UIApplication) {
func applicationDidEnterBackground(_ application: UIApplication) {
}

func applicationWillEnterForeground(application: UIApplication) {
func applicationWillEnterForeground(_ application: UIApplication) {
}

func applicationDidBecomeActive(application: UIApplication) {
UIApplication.sharedApplication().applicationIconBadgeNumber = 0
func applicationDidBecomeActive(_ application: UIApplication) {
UIApplication.shared.applicationIconBadgeNumber = 0
}

func applicationWillTerminate(application: UIApplication) {
func applicationWillTerminate(_ application: UIApplication) {
}

func application(application: UIApplication, didReceiveLocalNotification notification: UILocalNotification) {
func application(_ application: UIApplication, didReceive notification: UILocalNotification) {
if let userInfo = notification.userInfo {
let receiveLocalNotificationManager = ReceiveLocalNotificationManager()
receiveLocalNotificationManager.application(application, didReceiveLocalNotification: userInfo)
}

UIApplication.sharedApplication().cancelLocalNotification(notification)
UIApplication.shared.cancelLocalNotification(notification)
}

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

import UIKit

enum PCJConfig {

static let mailAddress = "symposion@pycon.jp"

}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
Expand Down
File renamed without changes.
65 changes: 65 additions & 0 deletions PyConJP/DataSource/More/StaffListDataSource.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
//
// StaffListDataSource.swift
// PyConJP2016
//
// Created by Yutaro Muta on 9/10/16.
// Copyright © 2016 PyCon JP. All rights reserved.
//

import UIKit

class StaffListDataSource: NSObject, UITableViewDataSource, StaffListAPIProtocol {

let reuseIdentifier = "StaffTableViewCell"

var teams: [Team] = []

let facebookAction: ((_ url: String) -> (() -> Void))
let twitterAction: ((_ url: String) -> (() -> Void))

init(facebookAction: @escaping ((_ url: String) -> (() -> Void)), twitterAction: @escaping ((_ url: String) -> (() -> Void))) {
self.facebookAction = facebookAction
self.twitterAction = twitterAction
}

func refreshData(completionHandler: @escaping ((Result<Void>) -> Void)) {
getStaffs { [weak self](result) in
guard let weakSelf = self else { return }
switch result {
case .success(let staffs):
weakSelf.teams.removeAll()
let teamNames = staffs.map({ $0.team }).unique()
for tuple in teamNames.enumerated() {
weakSelf.teams.append(Team(name: teamNames[tuple.offset], staffs: staffs.filter({ $0.team == teamNames[tuple.offset] })))
}
completionHandler(.success())
case .failure(let error):
completionHandler(.failure(error))
}
}
}

// MARK: - Table View Controller Data Source

func numberOfSections(in tableView: UITableView) -> Int {
return teams.count
}

func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
return teams[section].name
}

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return teams[section].staffs.count
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let cell = tableView.dequeueReusableCell(withIdentifier: reuseIdentifier, for: indexPath) as? StaffTableViewCell else {
fatalError("Could not create StaffTableViewCell")
}
cell.fill(staff: teams[(indexPath as NSIndexPath).section].staffs[(indexPath as NSIndexPath).row],
onFacebookButton: facebookAction(teams[(indexPath as NSIndexPath).section].staffs[(indexPath as NSIndexPath).row].facebook),
onTwitterButton: twitterAction(teams[(indexPath as NSIndexPath).section].staffs[(indexPath as NSIndexPath).row].twitter))
return cell
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//
// SpeakersCollectionViewDataSource.swift
// PyConJP2016
//
// Created by Yutaro Muta on 9/8/16.
// Copyright © 2016 PyCon JP. All rights reserved.
//

import UIKit

class SpeakersCollectionViewDataSource: NSObject, UICollectionViewDataSource {

let reuseIdentifier = "SpeakerCollectionViewCell"

var speakers: [Speaker] = []

// MARK: - Collection View DataSource

func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return speakers.count
}

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath) as! SpeakerCollectionViewCell
cell.fill(speaker: speakers[(indexPath as NSIndexPath).row])
return cell
}
}
Loading

0 comments on commit 93f1fee

Please sign in to comment.