Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfe99330

Browse files
authored
Merge pull request#11 from ReSwift/swift-3
Swift 3 Changes
2 parents0327586 +77b138a commitfe99330

File tree

2,182 files changed

+43926
-105825
lines changed

Some content is hidden

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

2,182 files changed

+43926
-105825
lines changed

‎Cartfile‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
github "nerdishbynature/octokit.swift"
1+
github "nerdishbynature/octokit.swift" ~> 0.7.0
22
github "Quick/Quick"
33
github "Quick/Nimble"
44
github "soffes/SSKeychain"
55
github "Ben-G/ListKit"
6-
github "ReSwift/ReSwift"
7-
github "ReSwift/ReSwiftRouter"
6+
github "ReSwift/ReSwift" ~> 3.0.0
7+
github "ReSwift/ReSwiftRouter" ~> 0.5.0

‎Cartfile.resolved‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
github "Ben-G/ListKit" "1.0.0"
2-
github "Quick/Nimble" "v4.1.0"
3-
github "Quick/Quick" "v0.9.2"
4-
github "ReSwift/ReSwift" "2.0.0"
5-
github "nerdishbynature/RequestKit" "0.3.0"
6-
github "soffes/SSKeychain" "v1.4.0"
7-
github "ReSwift/ReSwiftRouter" "0.3.1"
8-
github "nerdishbynature/octokit.swift" "0.6.1"
1+
github "Ben-G/ListKit" "2.0.0"
2+
github "Quick/Nimble" "v5.1.1"
3+
github "Quick/Quick" "v1.0.0"
4+
github "ReSwift/ReSwift" "3.0.0"
5+
github "nerdishbynature/RequestKit" "2.0.0"
6+
github "soffes/SSKeychain" "v1.5.2"
7+
github "ReSwift/ReSwiftRouter" "0.5.1"
8+
github "nerdishbynature/octokit.swift" "0.7.0"

‎Carthage/Checkouts/ListKit/.gitignore‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ xcuserdata
2222
*.moved-aside
2323
*.xcuserstate
2424
*.xcscmblueprint
25+
*.DS_Store
2526

2627
## Obj-C/Swift specific
2728
*.hmap
@@ -48,4 +49,4 @@ Carthage/Build
4849
# screenshots whenever they are needed.
4950

5051
fastlane/report.xml
51-
fastlane/screenshots
52+
fastlane/screenshots
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
Pod::Spec.newdo |s|
22
s.name="ListKit"
3-
s.version="1.0.0"
3+
s.version="2.0.0"
44
s.summary="A libary that helps you build table views without re-inventing the data source"
55
s.description="A libary that helps you build table views without re-inventing the data source."
66
s.homepage="https://github.com/Ben-G/ListKit"
77
s.license={:type=>"MIT",:file=>"LICENSE.md"}
88
s.author={"Benjamin Encz"=>"me@benjamin-encz.de"}
99
s.social_media_url="http://twitter.com/benjaminencz"
1010
s.source={:git=>"https://github.com/Ben-G/ListKit.git",:tag=>s.version.to_s}
11-
11+
1212
s.platforms={:ios=>"8.0"}
1313
s.requires_arc=true
1414

1515
s.source_files='ListKit/*.{swift}'
1616

17-
end
17+
end

‎Carthage/Checkouts/ListKit/ListKit.xcodeproj/project.pbxproj‎

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,21 +389,24 @@
389389
attributes = {
390390
LastSwiftMigration = 0700;
391391
LastSwiftUpdateCheck = 0700;
392-
LastUpgradeCheck =0700;
392+
LastUpgradeCheck =0800;
393393
ORGANIZATIONNAME = "Benjamin Encz";
394394
TargetAttributes = {
395395
626518111A96473700F1D760 = {
396396
CreatedOnToolsVersion = 6.1.1;
397+
LastSwiftMigration = 0810;
397398
};
398399
626518261A96473700F1D760 = {
399400
CreatedOnToolsVersion = 6.1.1;
400401
TestTargetID = 626518111A96473700F1D760;
401402
};
402403
6265183B1A96474900F1D760 = {
403404
CreatedOnToolsVersion = 6.1.1;
405+
LastSwiftMigration = 0810;
404406
};
405407
626518451A96474900F1D760 = {
406408
CreatedOnToolsVersion = 6.1.1;
409+
LastSwiftMigration = 0810;
407410
};
408411
};
409412
};
@@ -572,8 +575,10 @@
572575
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
573576
CLANG_WARN_EMPTY_BODY = YES;
574577
CLANG_WARN_ENUM_CONVERSION = YES;
578+
CLANG_WARN_INFINITE_RECURSION = YES;
575579
CLANG_WARN_INT_CONVERSION = YES;
576580
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
581+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
577582
CLANG_WARN_UNREACHABLE_CODE = YES;
578583
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
579584
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
@@ -582,6 +587,7 @@
582587
ENABLE_TESTABILITY = YES;
583588
GCC_C_LANGUAGE_STANDARD = gnu99;
584589
GCC_DYNAMIC_NO_PIC = NO;
590+
GCC_NO_COMMON_BLOCKS = YES;
585591
GCC_OPTIMIZATION_LEVEL = 0;
586592
GCC_PREPROCESSOR_DEFINITIONS = (
587593
"DEBUG=1",
@@ -616,15 +622,18 @@
616622
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
617623
CLANG_WARN_EMPTY_BODY = YES;
618624
CLANG_WARN_ENUM_CONVERSION = YES;
625+
CLANG_WARN_INFINITE_RECURSION = YES;
619626
CLANG_WARN_INT_CONVERSION = YES;
620627
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
628+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
621629
CLANG_WARN_UNREACHABLE_CODE = YES;
622630
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
623631
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
624632
COPY_PHASE_STRIP = YES;
625633
ENABLE_NS_ASSERTIONS = NO;
626634
ENABLE_STRICT_OBJC_MSGSEND = YES;
627635
GCC_C_LANGUAGE_STANDARD = gnu99;
636+
GCC_NO_COMMON_BLOCKS = YES;
628637
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
629638
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
630639
GCC_WARN_UNDECLARED_SELECTOR = YES;
@@ -634,6 +643,7 @@
634643
IPHONEOS_DEPLOYMENT_TARGET = 8.1;
635644
MTL_ENABLE_DEBUG_INFO = NO;
636645
SDKROOT = iphoneos;
646+
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
637647
TARGETED_DEVICE_FAMILY = "1,2";
638648
VALIDATE_PRODUCT = YES;
639649
};
@@ -642,26 +652,28 @@
642652
626518321A96473700F1D760 /* Debug */ = {
643653
isa = XCBuildConfiguration;
644654
buildSettings = {
655+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
645656
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
646-
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
647657
INFOPLIST_FILE = ListKitDemo/Info.plist;
648658
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
649659
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
650660
PRODUCT_BUNDLE_IDENTIFIER = "Benjamin-Encz.$(PRODUCT_NAME:rfc1034identifier)";
651661
PRODUCT_NAME = ListKitDemo;
662+
SWIFT_VERSION = 3.0;
652663
};
653664
name = Debug;
654665
};
655666
626518331A96473700F1D760 /* Release */ = {
656667
isa = XCBuildConfiguration;
657668
buildSettings = {
669+
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
658670
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
659-
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
660671
INFOPLIST_FILE = ListKitDemo/Info.plist;
661672
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
662673
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
663674
PRODUCT_BUNDLE_IDENTIFIER = "Benjamin-Encz.$(PRODUCT_NAME:rfc1034identifier)";
664675
PRODUCT_NAME = ListKitDemo;
676+
SWIFT_VERSION = 3.0;
665677
};
666678
name = Release;
667679
};
@@ -705,6 +717,7 @@
705717
isa = XCBuildConfiguration;
706718
buildSettings = {
707719
CLANG_ENABLE_MODULES = YES;
720+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
708721
CURRENT_PROJECT_VERSION = 1;
709722
DEFINES_MODULE = YES;
710723
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -722,6 +735,7 @@
722735
PRODUCT_NAME = "$(TARGET_NAME)";
723736
SKIP_INSTALL = YES;
724737
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
738+
SWIFT_VERSION = 3.0;
725739
VERSIONING_SYSTEM = "apple-generic";
726740
VERSION_INFO_PREFIX = "";
727741
};
@@ -731,6 +745,7 @@
731745
isa = XCBuildConfiguration;
732746
buildSettings = {
733747
CLANG_ENABLE_MODULES = YES;
748+
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
734749
CURRENT_PROJECT_VERSION = 1;
735750
DEFINES_MODULE = YES;
736751
DYLIB_COMPATIBILITY_VERSION = 1;
@@ -743,6 +758,7 @@
743758
PRODUCT_BUNDLE_IDENTIFIER = "Benjamin-Encz.$(PRODUCT_NAME:rfc1034identifier)";
744759
PRODUCT_NAME = "$(TARGET_NAME)";
745760
SKIP_INSTALL = YES;
761+
SWIFT_VERSION = 3.0;
746762
VERSIONING_SYSTEM = "apple-generic";
747763
VERSION_INFO_PREFIX = "";
748764
};
@@ -760,6 +776,7 @@
760776
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
761777
PRODUCT_BUNDLE_IDENTIFIER = "Benjamin-Encz.$(PRODUCT_NAME:rfc1034identifier)";
762778
PRODUCT_NAME = "$(TARGET_NAME)";
779+
SWIFT_VERSION = 3.0;
763780
};
764781
name = Debug;
765782
};
@@ -771,6 +788,7 @@
771788
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
772789
PRODUCT_BUNDLE_IDENTIFIER = "Benjamin-Encz.$(PRODUCT_NAME:rfc1034identifier)";
773790
PRODUCT_NAME = "$(TARGET_NAME)";
791+
SWIFT_VERSION = 3.0;
774792
};
775793
name = Release;
776794
};

‎Carthage/Checkouts/ListKit/ListKit.xcodeproj/xcshareddata/xcschemes/ListKit.xcscheme‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion ="0700"
3+
LastUpgradeVersion ="0800"
44
version ="1.3">
55
<BuildAction
66
parallelizeBuildables ="YES"

‎Carthage/Checkouts/ListKit/ListKit/ArrayDataSource.swift‎

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
import Foundation
1010
import UIKit
1111

12-
/// A `UITableViewCell`adopoting this type can be used together
12+
/// A `UITableViewCell`adopting this type can be used together
1313
/// with the `ArrayDataSource` class.
1414
publicprotocolListKitCellProtocol{
15-
typealias CellType
15+
associatedtypeCellType
1616

1717
/// Stores the content that is represented within the cell.
1818
/// Types adopting this protocol should update the UI when this
@@ -23,14 +23,14 @@ public protocol ListKitCellProtocol {
2323
/// Implements the `UITableViewDataSource` protocol. Needs to be initialized with a custom cell class.
2424
/// Optionally you can provide a NIB file from which the cell should be created. You define the content
2525
/// of the table view by setting the `array` property.
26-
publicclassArrayDataSource<U, Twhere U:ListKitCellProtocol, U:UITableViewCell, T==U.CellType>:NSObject,UITableViewDataSource{
26+
openclassArrayDataSource<U, T>:NSObject,UITableViewDataSourcewhere U:ListKitCellProtocol, U:UITableViewCell, T==U.CellType{
2727

2828
letcellIdentifier="arrayDataSourceCell"
2929

30-
privateletnib:UINib?
30+
fileprivateletnib:UINib?
3131

3232
/// The content represented in the table view
33-
publicvararray:Array<T>
33+
openvararray:Array<T>
3434

3535
/// Initialize with a custom cell type
3636
publicinit(array:Array<T>=[], cellType:U.Type){
@@ -45,29 +45,30 @@ public class ArrayDataSource<U, T where U:ListKitCellProtocol, U:UITableViewCell
4545
self.nib= nib
4646
}
4747

48-
publicfunc tableView(tableView:UITableView, numberOfRowsInSection section:Int)->Int{
48+
openfunc tableView(_tableView:UITableView, numberOfRowsInSection section:Int)->Int{
4949
return array.count
5050
}
5151

52-
publicfunc tableView(tableView:UITableView,cellForRowAtIndexPath indexPath:NSIndexPath)->UITableViewCell{
53-
varcell= tableView.dequeueReusableCellWithIdentifier(cellIdentifier)as!U?
52+
openfunc tableView(_tableView:UITableView,cellForRowAt indexPath:IndexPath)->UITableViewCell{
53+
varnullableCell= tableView.dequeueReusableCell(withIdentifier:cellIdentifier)as?U
5454

55-
ifvar cell= cell{
56-
cell.model=array[indexPath.row]
57-
}else{
55+
if nullableCell==nil{
5856
iflet nib= nib{
59-
// if nib was registered, load from there
60-
tableView.registerNib(nib, forCellReuseIdentifier: cellIdentifier)
61-
cell= tableView.dequeueReusableCellWithIdentifier(cellIdentifier)as?U
62-
cell!.model=array[indexPath.row]
57+
tableView.register(nib, forCellReuseIdentifier: cellIdentifier)
58+
nullableCell= tableView.dequeueReusableCell(withIdentifier: cellIdentifier)as?U
6359
}else{
64-
// else, create cell programatically
65-
cell=U(style:.Default, reuseIdentifier: cellIdentifier)
66-
cell!.model=array[indexPath.row]
60+
nullableCell=U(style:.default, reuseIdentifier: cellIdentifier)
6761
}
6862
}
6963

70-
return cell!
64+
// This can only be invalid if `nib` specifies a cell with the wrong class and the first dequeue didn't work
65+
guardvar cell= nullableCellelse{
66+
fatalError("Unable to dequeue valid cell of type\(U.self) from reuse identifier\(cellIdentifier) or create cell of type\(U.self) from nib\(nib)")
67+
}
68+
69+
cell.model=array[(indexPathasNSIndexPath).row]
70+
71+
return cell
7172
}
7273

73-
}
74+
}

‎Carthage/Checkouts/ListKit/ListKit/Info.plist‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.0</string>
18+
<string>2.0</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

‎Carthage/Checkouts/ListKit/ListKitDemo/AppDelegate.swift‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,30 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
1414
varwindow:UIWindow?
1515

1616

17-
func application(application:UIApplication, didFinishLaunchingWithOptions launchOptions:[NSObject:AnyObject]?)->Bool{
17+
func application(_application:UIApplication, didFinishLaunchingWithOptions launchOptions:[UIApplicationLaunchOptionsKey:Any]?)->Bool{
1818
// Override point for customization after application launch.
1919
returntrue
2020
}
2121

22-
func applicationWillResignActive(application:UIApplication){
22+
func applicationWillResignActive(_application:UIApplication){
2323
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
2424
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
2525
}
2626

27-
func applicationDidEnterBackground(application:UIApplication){
27+
func applicationDidEnterBackground(_application:UIApplication){
2828
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
2929
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
3030
}
3131

32-
func applicationWillEnterForeground(application:UIApplication){
32+
func applicationWillEnterForeground(_application:UIApplication){
3333
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
3434
}
3535

36-
func applicationDidBecomeActive(application:UIApplication){
36+
func applicationDidBecomeActive(_application:UIApplication){
3737
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
3838
}
3939

40-
func applicationWillTerminate(application:UIApplication){
40+
func applicationWillTerminate(_application:UIApplication){
4141
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
4242
}
4343

‎Carthage/Checkouts/ListKit/ListKitDemo/Demos/CityDemo/CityViewController.swift‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,19 @@ class CityViewController: UIViewController {
3333

3434
letcities=[city1, city2]
3535

36-
letnib=UINib(nibName:"CityCell", bundle:NSBundle.mainBundle())
36+
letnib=UINib(nibName:"CityCell", bundle:Bundle.main)
3737

3838
dataSource=ArrayDataSource(array: cities, cellType:CityCell.self, nib: nib)
3939
tableView.dataSource= dataSource
4040
}
4141

42-
overridefunc viewWillAppear(animated:Bool){
42+
overridefunc viewWillAppear(_animated:Bool){
4343
super.viewWillAppear(animated)
4444

4545
tableView.reloadData()
4646
}
4747

48-
@IBActionfunc addButtonTapped(sender:AnyObject){
48+
@IBActionfunc addButtonTapped(_sender:AnyObject){
4949
letadditionalCity=City(
5050
name:"Tokyo",
5151
country:"Japan",
@@ -56,4 +56,4 @@ class CityViewController: UIViewController {
5656
tableView.reloadData()
5757
}
5858

59-
}
59+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp