Skip to content

Commit 184418b

Browse files
committed
Merge pull request #2 from klaus01/Xcode7.2
升级到Xcode7.2 Swift 2环境
2 parents 394507c + 3862644 commit 184418b

File tree

91 files changed

+704
-831
lines changed

Some content is hidden

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

91 files changed

+704
-831
lines changed

Centipede.podspec

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Pod::Spec.new do |s|
2+
s.name = "Centipede"
3+
s.version = "1.1.0"
4+
s.summary = "Swift achieve a pure library closures achieve UIKit assembly delegate and dataSource methods."
5+
s.description = <<-DESC
6+
一个Swift库,使用闭包实现UIKit组件的delegate和dataSource方法。
7+
DESC
8+
s.homepage = "https://github.com/klaus01/Centipede"
9+
s.license = { :type => "MIT", :file => "LICENSE" }
10+
s.author = { "柯磊" => "kelei0017@gmail.com" }
11+
s.social_media_url = "http://twitter.com/kelei0017"
12+
s.platform = :ios, "8.0"
13+
s.source = { :git => "https://github.com/klaus01/Centipede.git", :tag => s.version }
14+
s.source_files = "Centipede/**/*.swift", "Centipede/Centipede.h"
15+
s.public_header_files = "Centipede/Centipede.h"
16+
s.requires_arc = true
17+
end

Centipede.xcodeproj/project.pbxproj

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
240B74AE1B2B14500067475E /* CE_UIScrollView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 240B74561B2B14500067475E /* CE_UIScrollView.swift */; };
3333
240B74AF1B2B14500067475E /* CE_UISearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 240B74571B2B14500067475E /* CE_UISearchBar.swift */; };
3434
240B74B01B2B14500067475E /* CE_UISearchController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 240B74581B2B14500067475E /* CE_UISearchController.swift */; };
35-
240B74B11B2B14500067475E /* CE_UISearchDisplayController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 240B74591B2B14500067475E /* CE_UISearchDisplayController.swift */; };
3635
240B74B21B2B14500067475E /* CE_UISplitViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 240B745A1B2B14500067475E /* CE_UISplitViewController.swift */; };
3736
240B74B31B2B14500067475E /* CE_UITabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 240B745B1B2B14500067475E /* CE_UITabBar.swift */; };
3837
240B74B41B2B14500067475E /* CE_UITabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 240B745C1B2B14500067475E /* CE_UITabBarController.swift */; };
@@ -92,6 +91,8 @@
9291
240B75AF1B2B22140067475E /* CE_SKRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 240B757D1B2B22140067475E /* CE_SKRequest.swift */; };
9392
240B75B01B2B22140067475E /* CE_SKStoreProductViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 240B757E1B2B22140067475E /* CE_SKStoreProductViewController.swift */; };
9493
240B75B21B2B23090067475E /* CE_NSURLSession.swift in Sources */ = {isa = PBXBuildFile; fileRef = 240B75B11B2B23090067475E /* CE_NSURLSession.swift */; };
94+
245CA93D1C59F2490006C533 /* CE_CAAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 245CA93B1C59F2490006C533 /* CE_CAAnimation.swift */; };
95+
245CA93E1C59F2490006C533 /* CE_CALayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 245CA93C1C59F2490006C533 /* CE_CALayer.swift */; };
9596
24E8A74C1B1E056A008D963A /* Centipede.h in Headers */ = {isa = PBXBuildFile; fileRef = 24E8A74B1B1E056A008D963A /* Centipede.h */; settings = {ATTRIBUTES = (Public, ); }; };
9697
/* End PBXBuildFile section */
9798

@@ -121,7 +122,6 @@
121122
240B74561B2B14500067475E /* CE_UIScrollView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CE_UIScrollView.swift; sourceTree = "<group>"; };
122123
240B74571B2B14500067475E /* CE_UISearchBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CE_UISearchBar.swift; sourceTree = "<group>"; };
123124
240B74581B2B14500067475E /* CE_UISearchController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CE_UISearchController.swift; sourceTree = "<group>"; };
124-
240B74591B2B14500067475E /* CE_UISearchDisplayController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CE_UISearchDisplayController.swift; sourceTree = "<group>"; };
125125
240B745A1B2B14500067475E /* CE_UISplitViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CE_UISplitViewController.swift; sourceTree = "<group>"; };
126126
240B745B1B2B14500067475E /* CE_UITabBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CE_UITabBar.swift; sourceTree = "<group>"; };
127127
240B745C1B2B14500067475E /* CE_UITabBarController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CE_UITabBarController.swift; sourceTree = "<group>"; };
@@ -181,6 +181,8 @@
181181
240B757D1B2B22140067475E /* CE_SKRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CE_SKRequest.swift; sourceTree = "<group>"; };
182182
240B757E1B2B22140067475E /* CE_SKStoreProductViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CE_SKStoreProductViewController.swift; sourceTree = "<group>"; };
183183
240B75B11B2B23090067475E /* CE_NSURLSession.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CE_NSURLSession.swift; sourceTree = "<group>"; };
184+
245CA93B1C59F2490006C533 /* CE_CAAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CE_CAAnimation.swift; sourceTree = "<group>"; };
185+
245CA93C1C59F2490006C533 /* CE_CALayer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CE_CALayer.swift; sourceTree = "<group>"; };
184186
24E8A7461B1E056A008D963A /* Centipede.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Centipede.framework; sourceTree = BUILT_PRODUCTS_DIR; };
185187
24E8A74A1B1E056A008D963A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
186188
24E8A74B1B1E056A008D963A /* Centipede.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Centipede.h; sourceTree = "<group>"; };
@@ -232,7 +234,6 @@
232234
240B74561B2B14500067475E /* CE_UIScrollView.swift */,
233235
240B74571B2B14500067475E /* CE_UISearchBar.swift */,
234236
240B74581B2B14500067475E /* CE_UISearchController.swift */,
235-
240B74591B2B14500067475E /* CE_UISearchDisplayController.swift */,
236237
240B745A1B2B14500067475E /* CE_UISplitViewController.swift */,
237238
240B745B1B2B14500067475E /* CE_UITabBar.swift */,
238239
240B745C1B2B14500067475E /* CE_UITabBarController.swift */,
@@ -436,6 +437,15 @@
436437
path = StoreKit;
437438
sourceTree = "<group>";
438439
};
440+
245CA93A1C59F2490006C533 /* QuartzCore */ = {
441+
isa = PBXGroup;
442+
children = (
443+
245CA93B1C59F2490006C533 /* CE_CAAnimation.swift */,
444+
245CA93C1C59F2490006C533 /* CE_CALayer.swift */,
445+
);
446+
path = QuartzCore;
447+
sourceTree = "<group>";
448+
};
439449
24E8A73C1B1E056A008D963A = {
440450
isa = PBXGroup;
441451
children = (
@@ -472,6 +482,7 @@
472482
240B75691B2B22140067475E /* MultipeerConnectivity */,
473483
240B756F1B2B22140067475E /* PassKit */,
474484
240B75721B2B22140067475E /* PushKit */,
485+
245CA93A1C59F2490006C533 /* QuartzCore */,
475486
240B75741B2B22140067475E /* QuickLook */,
476487
240B75761B2B22140067475E /* SceneKit */,
477488
240B75791B2B22140067475E /* SpriteKit */,
@@ -529,7 +540,9 @@
529540
24E8A73D1B1E056A008D963A /* Project object */ = {
530541
isa = PBXProject;
531542
attributes = {
532-
LastUpgradeCheck = 0630;
543+
LastSwiftMigration = 0720;
544+
LastSwiftUpdateCheck = 0720;
545+
LastUpgradeCheck = 0720;
533546
ORGANIZATIONNAME = kelei;
534547
TargetAttributes = {
535548
24E8A7451B1E056A008D963A = {
@@ -602,6 +615,7 @@
602615
240B74BB1B2B14500067475E /* CE_UIWebView.swift in Sources */,
603616
240B75851B2B22140067475E /* CE_CBPeripheralManager.swift in Sources */,
604617
240B74B91B2B14500067475E /* CE_UIVideoEditorController.swift in Sources */,
618+
245CA93D1C59F2490006C533 /* CE_CAAnimation.swift in Sources */,
605619
240B74B81B2B14500067475E /* CE_UIToolbar.swift in Sources */,
606620
240B759A1B2B22140067475E /* CE_HMAccessoryBrowser.swift in Sources */,
607621
240B75A71B2B22140067475E /* CE_PKAddPassesViewController.swift in Sources */,
@@ -629,13 +643,13 @@
629643
240B75AF1B2B22140067475E /* CE_SKRequest.swift in Sources */,
630644
240B74A41B2B14500067475E /* CE_UIImagePickerController.swift in Sources */,
631645
240B74B21B2B14500067475E /* CE_UISplitViewController.swift in Sources */,
646+
245CA93E1C59F2490006C533 /* CE_CALayer.swift in Sources */,
632647
240B74B41B2B14500067475E /* CE_UITabBarController.swift in Sources */,
633648
240B75941B2B22140067475E /* CE_NSUserActivity.swift in Sources */,
634649
240B758D1B2B22140067475E /* CE_NSFileManager.swift in Sources */,
635650
240B759B1B2B22140067475E /* CE_HMHome.swift in Sources */,
636651
240B74B61B2B14500067475E /* CE_UITextField.swift in Sources */,
637652
240B74B71B2B14500067475E /* CE_UITextView.swift in Sources */,
638-
240B74B11B2B14500067475E /* CE_UISearchDisplayController.swift in Sources */,
639653
240B749F1B2B14500067475E /* CE_UIDocumentInteractionController.swift in Sources */,
640654
240B74AD1B2B14500067475E /* CE_UIPrintInteractionController.swift in Sources */,
641655
240B74A31B2B14500067475E /* CE_UIGestureRecognizer.swift in Sources */,
@@ -682,6 +696,7 @@
682696
CURRENT_PROJECT_VERSION = 1;
683697
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
684698
ENABLE_STRICT_OBJC_MSGSEND = YES;
699+
ENABLE_TESTABILITY = YES;
685700
GCC_C_LANGUAGE_STANDARD = gnu99;
686701
GCC_DYNAMIC_NO_PIC = NO;
687702
GCC_NO_COMMON_BLOCKS = YES;
@@ -697,7 +712,7 @@
697712
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
698713
GCC_WARN_UNUSED_FUNCTION = YES;
699714
GCC_WARN_UNUSED_VARIABLE = YES;
700-
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
715+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
701716
MTL_ENABLE_DEBUG_INFO = YES;
702717
ONLY_ACTIVE_ARCH = YES;
703718
SDKROOT = iphoneos;
@@ -739,7 +754,7 @@
739754
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
740755
GCC_WARN_UNUSED_FUNCTION = YES;
741756
GCC_WARN_UNUSED_VARIABLE = YES;
742-
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
757+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
743758
MTL_ENABLE_DEBUG_INFO = NO;
744759
SDKROOT = iphoneos;
745760
TARGETED_DEVICE_FAMILY = "1,2";
@@ -760,6 +775,7 @@
760775
INFOPLIST_FILE = Centipede/Info.plist;
761776
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
762777
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
778+
PRODUCT_BUNDLE_IDENTIFIER = "com.kelei.$(PRODUCT_NAME:rfc1034identifier)";
763779
PRODUCT_NAME = "$(TARGET_NAME)";
764780
SKIP_INSTALL = YES;
765781
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
@@ -777,6 +793,7 @@
777793
INFOPLIST_FILE = Centipede/Info.plist;
778794
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
779795
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
796+
PRODUCT_BUNDLE_IDENTIFIER = "com.kelei.$(PRODUCT_NAME:rfc1034identifier)";
780797
PRODUCT_NAME = "$(TARGET_NAME)";
781798
SKIP_INSTALL = YES;
782799
};

Centipede/AVFoundation/CE_AVAudioPlayer.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public extension AVAudioPlayer {
1313
private struct Static { static var AssociationKey: UInt8 = 0 }
1414
private var _delegate: AVAudioPlayer_Delegate? {
1515
get { return objc_getAssociatedObject(self, &Static.AssociationKey) as? AVAudioPlayer_Delegate }
16-
set { objc_setAssociatedObject(self, &Static.AssociationKey, newValue, objc_AssociationPolicy(OBJC_ASSOCIATION_RETAIN)) }
16+
set { objc_setAssociatedObject(self, &Static.AssociationKey, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN) }
1717
}
1818

1919
private var ce: AVAudioPlayer_Delegate {
@@ -45,7 +45,7 @@ public extension AVAudioPlayer {
4545
rebindingDelegate()
4646
return self
4747
}
48-
public func ce_decodeErrorDidOccur(handle: (player: AVAudioPlayer, error: NSError!) -> Void) -> Self {
48+
public func ce_decodeErrorDidOccur(handle: (player: AVAudioPlayer, error: NSError?) -> Void) -> Self {
4949
ce._decodeErrorDidOccur = handle
5050
rebindingDelegate()
5151
return self
@@ -66,7 +66,7 @@ public extension AVAudioPlayer {
6666
internal class AVAudioPlayer_Delegate: NSObject, AVAudioPlayerDelegate {
6767

6868
var _didFinishPlaying: ((AVAudioPlayer, Bool) -> Void)?
69-
var _decodeErrorDidOccur: ((AVAudioPlayer, NSError!) -> Void)?
69+
var _decodeErrorDidOccur: ((AVAudioPlayer, NSError?) -> Void)?
7070
var _beginInterruption: ((AVAudioPlayer) -> Void)?
7171
var _endInterruption: ((AVAudioPlayer, Int) -> Void)?
7272

@@ -90,7 +90,7 @@ internal class AVAudioPlayer_Delegate: NSObject, AVAudioPlayerDelegate {
9090
@objc func audioPlayerDidFinishPlaying(player: AVAudioPlayer, successfully flag: Bool) {
9191
_didFinishPlaying!(player, flag)
9292
}
93-
@objc func audioPlayerDecodeErrorDidOccur(player: AVAudioPlayer, error: NSError!) {
93+
@objc func audioPlayerDecodeErrorDidOccur(player: AVAudioPlayer, error: NSError?) {
9494
_decodeErrorDidOccur!(player, error)
9595
}
9696
@objc func audioPlayerBeginInterruption(player: AVAudioPlayer) {

Centipede/AVFoundation/CE_AVAudioRecorder.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public extension AVAudioRecorder {
1313
private struct Static { static var AssociationKey: UInt8 = 0 }
1414
private var _delegate: AVAudioRecorder_Delegate? {
1515
get { return objc_getAssociatedObject(self, &Static.AssociationKey) as? AVAudioRecorder_Delegate }
16-
set { objc_setAssociatedObject(self, &Static.AssociationKey, newValue, objc_AssociationPolicy(OBJC_ASSOCIATION_RETAIN)) }
16+
set { objc_setAssociatedObject(self, &Static.AssociationKey, newValue, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN) }
1717
}
1818

1919
private var ce: AVAudioRecorder_Delegate {
@@ -45,7 +45,7 @@ public extension AVAudioRecorder {
4545
rebindingDelegate()
4646
return self
4747
}
48-
public func ce_encodeErrorDidOccur(handle: (recorder: AVAudioRecorder, error: NSError!) -> Void) -> Self {
48+
public func ce_encodeErrorDidOccur(handle: (recorder: AVAudioRecorder, error: NSError?) -> Void) -> Self {
4949
ce._encodeErrorDidOccur = handle
5050
rebindingDelegate()
5151
return self
@@ -66,7 +66,7 @@ public extension AVAudioRecorder {
6666
internal class AVAudioRecorder_Delegate: NSObject, AVAudioRecorderDelegate {
6767

6868
var _didFinishRecording: ((AVAudioRecorder, Bool) -> Void)?
69-
var _encodeErrorDidOccur: ((AVAudioRecorder, NSError!) -> Void)?
69+
var _encodeErrorDidOccur: ((AVAudioRecorder, NSError?) -> Void)?
7070
var _beginInterruption: ((AVAudioRecorder) -> Void)?
7171
var _endInterruption: ((AVAudioRecorder, Int) -> Void)?
7272

@@ -90,7 +90,7 @@ internal class AVAudioRecorder_Delegate: NSObject, AVAudioRecorderDelegate {
9090
@objc func audioRecorderDidFinishRecording(recorder: AVAudioRecorder, successfully flag: Bool) {
9191
_didFinishRecording!(recorder, flag)
9292
}
93-
@objc func audioRecorderEncodeErrorDidOccur(recorder: AVAudioRecorder, error: NSError!) {
93+
@objc func audioRecorderEncodeErrorDidOccur(recorder: AVAudioRecorder, error: NSError?) {
9494
_encodeErrorDidOccur!(recorder, error)
9595
}
9696
@objc func audioRecorderBeginInterruption(recorder: AVAudioRecorder) {

0 commit comments

Comments
 (0)