-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from pyconjp/release/v1.0.0
release v1.0.0 into master
- Loading branch information
Showing
69 changed files
with
1,906 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# PyCon JP use Library | ||
github "Alamofire/Alamofire" ~> 3.4 | ||
github "Alamofire/Alamofire" ~> 3.5 | ||
github "Alamofire/AlamofireImage" ~> 2.5 | ||
github "realm/realm-cocoa" ~> 1.0 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+11.8 KB
(180%)
PyConJP2016/Assets.xcassets/App/Image/Map/Floor/FirstFloorMap.imageset/floor_1.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
BIN
+43 KB
(260%)
...P2016/Assets.xcassets/App/Image/Map/Floor/FirstFloorMap.imageset/floor_1@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
BIN
+93.8 KB
(350%)
...P2016/Assets.xcassets/App/Image/Map/Floor/FirstFloorMap.imageset/floor_1@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
BIN
+15.4 KB
(190%)
...nJP2016/Assets.xcassets/App/Image/Map/Floor/SecondFloorMap.imageset/floor_2.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
BIN
+49.5 KB
(240%)
...2016/Assets.xcassets/App/Image/Map/Floor/SecondFloorMap.imageset/floor_2@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
BIN
+104 KB
(320%)
...2016/Assets.xcassets/App/Image/Map/Floor/SecondFloorMap.imageset/floor_2@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
BIN
+9.39 KB
(220%)
PyConJP2016/Assets.xcassets/App/Image/Map/Floor/ThirdFloorMap.imageset/floor_3.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
BIN
+29.3 KB
(300%)
...P2016/Assets.xcassets/App/Image/Map/Floor/ThirdFloorMap.imageset/floor_3@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
BIN
+62.9 KB
(380%)
...P2016/Assets.xcassets/App/Image/Map/Floor/ThirdFloorMap.imageset/floor_3@3x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, StaffListAPIType { | ||
|
||
let reuseIdentifier = "StaffTableViewCell" | ||
|
||
var teams: [Team] = [] | ||
|
||
let facebookAction: ((url: String) -> (() -> Void)) | ||
let twitterAction: ((url: String) -> (() -> Void)) | ||
|
||
init(facebookAction: ((url: String) -> (() -> Void)), twitterAction: ((url: String) -> (() -> Void))) { | ||
self.facebookAction = facebookAction | ||
self.twitterAction = twitterAction | ||
} | ||
|
||
func refreshData(completionHandler: (Result<Void, NSError> -> 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.enumerate() { | ||
weakSelf.teams.append(Team(name: teamNames[tuple.index], staffs: staffs.filter({ $0.team == teamNames[tuple.index] }))) | ||
} | ||
completionHandler(.Success()) | ||
case .Failure(let error): | ||
completionHandler(.Failure(error)) | ||
} | ||
} | ||
} | ||
|
||
// MARK: - Table View Controller Data Source | ||
|
||
func numberOfSectionsInTableView(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, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { | ||
guard let cell = tableView.dequeueReusableCellWithIdentifier(reuseIdentifier, forIndexPath: indexPath) as? StaffTableViewCell else { | ||
fatalError("Could not create StaffTableViewCell") | ||
} | ||
cell.fill(teams[indexPath.section].staffs[indexPath.row], | ||
onFacebookButton: facebookAction(url: teams[indexPath.section].staffs[indexPath.row].facebook), | ||
onTwitterButton: twitterAction(url: teams[indexPath.section].staffs[indexPath.row].twitter)) | ||
return cell | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
PyConJP2016/DataSource/TalkDetail/SpeakersCollectionViewDataSource.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// 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] = [] | ||
|
||
func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { | ||
return speakers.count | ||
} | ||
|
||
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell { | ||
let cell = collectionView.dequeueReusableCellWithReuseIdentifier(reuseIdentifier, forIndexPath: indexPath) as! SpeakerCollectionViewCell | ||
cell.fill(speakers[indexPath.row]) | ||
return cell | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// Staff.swift | ||
// PyConJP2016 | ||
// | ||
// Created by Yutaro Muta on 9/10/16. | ||
// Copyright © 2016 PyCon JP. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
|
||
struct Staff { | ||
|
||
let team: String | ||
let name: String | ||
let role: String | ||
let twitter: String | ||
let facebook: String | ||
|
||
} | ||
|
||
extension Staff { | ||
|
||
init(dictionary: Dictionary<String, AnyObject>) { | ||
self.init(team: dictionary["team"] as? String ?? "", | ||
name: dictionary["name"] as? String ?? "", | ||
role: dictionary["title"] as? String ?? "", | ||
twitter: dictionary["twitter"] as? String ?? "", | ||
facebook: dictionary["facebook"] as? String ?? "") | ||
} | ||
|
||
} |
Oops, something went wrong.