Skip to content

Commit fe7fdfb

Browse files
Add support for Swift 4 and Xcode 9
1 parent 837da52 commit fe7fdfb

File tree

5 files changed

+58
-19
lines changed

5 files changed

+58
-19
lines changed

Example/ParticlesLoadingView.xcodeproj/project.pbxproj

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,12 @@
161161
isa = PBXProject;
162162
attributes = {
163163
LastSwiftUpdateCheck = 0720;
164-
LastUpgradeCheck = 0810;
164+
LastUpgradeCheck = 0900;
165165
ORGANIZATIONNAME = CocoaPods;
166166
TargetAttributes = {
167167
607FACCF1AFB9204008FA782 = {
168168
CreatedOnToolsVersion = 6.3.1;
169-
LastSwiftMigration = 0800;
169+
LastSwiftMigration = 0900;
170170
};
171171
};
172172
};
@@ -291,14 +291,20 @@
291291
CLANG_CXX_LIBRARY = "libc++";
292292
CLANG_ENABLE_MODULES = YES;
293293
CLANG_ENABLE_OBJC_ARC = YES;
294+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
294295
CLANG_WARN_BOOL_CONVERSION = YES;
296+
CLANG_WARN_COMMA = YES;
295297
CLANG_WARN_CONSTANT_CONVERSION = YES;
296298
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
297299
CLANG_WARN_EMPTY_BODY = YES;
298300
CLANG_WARN_ENUM_CONVERSION = YES;
299301
CLANG_WARN_INFINITE_RECURSION = YES;
300302
CLANG_WARN_INT_CONVERSION = YES;
303+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
304+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
301305
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
306+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
307+
CLANG_WARN_STRICT_PROTOTYPES = YES;
302308
CLANG_WARN_SUSPICIOUS_MOVE = YES;
303309
CLANG_WARN_UNREACHABLE_CODE = YES;
304310
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -338,14 +344,20 @@
338344
CLANG_CXX_LIBRARY = "libc++";
339345
CLANG_ENABLE_MODULES = YES;
340346
CLANG_ENABLE_OBJC_ARC = YES;
347+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
341348
CLANG_WARN_BOOL_CONVERSION = YES;
349+
CLANG_WARN_COMMA = YES;
342350
CLANG_WARN_CONSTANT_CONVERSION = YES;
343351
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
344352
CLANG_WARN_EMPTY_BODY = YES;
345353
CLANG_WARN_ENUM_CONVERSION = YES;
346354
CLANG_WARN_INFINITE_RECURSION = YES;
347355
CLANG_WARN_INT_CONVERSION = YES;
356+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
357+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
348358
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
359+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
360+
CLANG_WARN_STRICT_PROTOTYPES = YES;
349361
CLANG_WARN_SUSPICIOUS_MOVE = YES;
350362
CLANG_WARN_UNREACHABLE_CODE = YES;
351363
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -392,7 +404,8 @@
392404
PODS_FRAMEWORK_BUILD_PATH = "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods-ParticlesLoadingView_Example";
393405
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
394406
PRODUCT_NAME = ParticlesLoadingView_Example;
395-
SWIFT_VERSION = 3.0;
407+
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
408+
SWIFT_VERSION = 4.0;
396409
};
397410
name = Debug;
398411
};
@@ -420,7 +433,8 @@
420433
PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)";
421434
PRODUCT_NAME = ParticlesLoadingView_Example;
422435
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
423-
SWIFT_VERSION = 3.0;
436+
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
437+
SWIFT_VERSION = 4.0;
424438
};
425439
name = Release;
426440
};

Example/ParticlesLoadingView.xcodeproj/xcshareddata/xcschemes/ParticlesLoadingView-Example.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 = "0810"
3+
LastUpgradeVersion = "0900"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Example/Pods/Pods.xcodeproj/project.pbxproj

Lines changed: 33 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pod/Classes/ParticlesLoadingView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,17 @@ public class ParticlesLoadingView: UIView {
8282
}
8383

8484
/// Start the particles emission and the animation around the border of the view.
85-
public override func startAnimating() {
85+
@objc public override func startAnimating() {
8686
scene.startAnimating()
8787
}
8888

8989
/// Stop the particles emission.
90-
public override func stopAnimating() {
90+
@objc public override func stopAnimating() {
9191
scene.stopAnimating()
9292
}
9393

9494
/// Returns true if the view is emmitting particles, otherwise false.
95-
public override func isEmitting() -> Bool {
95+
@objc public override func isEmitting() -> Bool {
9696
return scene.isEmitting()
9797
}
9898

Pod/Classes/UIView+ParticlesAnimation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public extension UIView {
4242
}
4343

4444
/// Start animating the emitter node.
45-
public func startAnimating() {
45+
@objc public func startAnimating() {
4646
for case let spriteKitView as SKView in subviews {
4747
if let scene = spriteKitView.scene, let particlesScene = scene as? ParticlesScene {
4848
particlesScene.startAnimating()
@@ -51,7 +51,7 @@ public extension UIView {
5151
}
5252

5353
/// Stop animating the emitter node.
54-
public func stopAnimating() {
54+
@objc public func stopAnimating() {
5555
for case let spriteKitView as SKView in subviews {
5656
if let scene = spriteKitView.scene, let particlesScene = scene as? ParticlesScene {
5757
particlesScene.stopAnimating()
@@ -60,7 +60,7 @@ public extension UIView {
6060
}
6161

6262
/// Returns true if the animation is ongoing, otherwise false.
63-
public func isEmitting() -> Bool {
63+
@objc public func isEmitting() -> Bool {
6464
for case let spriteKitView as SKView in subviews {
6565
if let scene = spriteKitView.scene, let particlesScene = scene as? ParticlesScene {
6666
return particlesScene.isEmitting()

0 commit comments

Comments
 (0)