git.iko.soy/metal-metaballs
on master help sign in
PixelImage.xcodeproj/project.pbxproj+35−24
since splitsnapshots
unifiedsplit
@@ -144,7 +144,6 @@
144 242686811C63B72A00D62456 /* Frameworks */,
144 242686811C63B72A00D62456 /* Frameworks */,
145 242686821C63B72A00D62456 /* Resources */,
145 242686821C63B72A00D62456 /* Resources */,
146 3CA888DC160972BAEB74EC52 /* [CP] Embed Pods Frameworks */,
146 3CA888DC160972BAEB74EC52 /* [CP] Embed Pods Frameworks */,
147− 47F9F13E3CB75C7B4B0136A5 /* [CP] Copy Pods Resources */,
148 );
147 );
149 buildRules = (
148 buildRules = (
150 );
149 );
@@ -162,13 +161,13 @@
162 isa = PBXProject;
161 isa = PBXProject;
163 attributes = {
162 attributes = {
164 LastSwiftUpdateCheck = 0720;
163 LastSwiftUpdateCheck = 0720;
165− LastUpgradeCheck = 0830;
164+ LastUpgradeCheck = 1020;
166 ORGANIZATIONNAME = "Vinicius Vendramini";
165 ORGANIZATIONNAME = "Vinicius Vendramini";
167 TargetAttributes = {
166 TargetAttributes = {
168 242686831C63B72A00D62456 = {
167 242686831C63B72A00D62456 = {
169 CreatedOnToolsVersion = 7.2;
168 CreatedOnToolsVersion = 7.2;
170− DevelopmentTeam = HHT774898M;
169+ DevelopmentTeam = 8J63JZYYHZ;
171− LastSwiftMigration = 0830;
170+ LastSwiftMigration = 1020;
172 };
171 };
173 };
172 };
174 };
173 };
@@ -177,6 +176,7 @@
177 developmentRegion = English;
176 developmentRegion = English;
178 hasScannedForEncodings = 0;
177 hasScannedForEncodings = 0;
179 knownRegions = (
178 knownRegions = (
179+ English,
180 en,
180 en,
181 Base,
181 Base,
182 );
182 );
@@ -210,13 +210,16 @@
210 files = (
210 files = (
211 );
211 );
212 inputPaths = (
212 inputPaths = (
213+ "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
214+ "${PODS_ROOT}/Manifest.lock",
213 );
215 );
214 name = "[CP] Check Pods Manifest.lock";
216 name = "[CP] Check Pods Manifest.lock";
215 outputPaths = (
217 outputPaths = (
218+ "$(DERIVED_FILE_DIR)/Pods-PixelImage-checkManifestLockResult.txt",
216 );
219 );
217 runOnlyForDeploymentPostprocessing = 0;
220 runOnlyForDeploymentPostprocessing = 0;
218 shellPath = /bin/sh;
221 shellPath = /bin/sh;
219− shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
222+ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
220 showEnvVarsInLog = 0;
223 showEnvVarsInLog = 0;
221 };
224 };
222 3CA888DC160972BAEB74EC52 /* [CP] Embed Pods Frameworks */ = {
225 3CA888DC160972BAEB74EC52 /* [CP] Embed Pods Frameworks */ = {
@@ -225,30 +228,18 @@
225 files = (
228 files = (
226 );
229 );
227 inputPaths = (
230 inputPaths = (
231+ "${SRCROOT}/Pods/Target Support Files/Pods-PixelImage/Pods-PixelImage-frameworks.sh",
232+ "${BUILT_PRODUCTS_DIR}/ChameleonFramework/ChameleonFramework.framework",
228 );
233 );
229 name = "[CP] Embed Pods Frameworks";
234 name = "[CP] Embed Pods Frameworks";
230 outputPaths = (
235 outputPaths = (
236+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ChameleonFramework.framework",
231 );
237 );
232 runOnlyForDeploymentPostprocessing = 0;
238 runOnlyForDeploymentPostprocessing = 0;
233 shellPath = /bin/sh;
239 shellPath = /bin/sh;
234 shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PixelImage/Pods-PixelImage-frameworks.sh\"\n";
240 shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PixelImage/Pods-PixelImage-frameworks.sh\"\n";
235 showEnvVarsInLog = 0;
241 showEnvVarsInLog = 0;
236 };
242 };
237− 47F9F13E3CB75C7B4B0136A5 /* [CP] Copy Pods Resources */ = {
238− isa = PBXShellScriptBuildPhase;
239− buildActionMask = 2147483647;
240− files = (
241− );
242− inputPaths = (
243− );
244− name = "[CP] Copy Pods Resources";
245− outputPaths = (
246− );
247− runOnlyForDeploymentPostprocessing = 0;
248− shellPath = /bin/sh;
249− shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PixelImage/Pods-PixelImage-resources.sh\"\n";
250− showEnvVarsInLog = 0;
251− };
252/* End PBXShellScriptBuildPhase section */
243/* End PBXShellScriptBuildPhase section */
253
244
254/* Begin PBXSourcesBuildPhase section */
245/* Begin PBXSourcesBuildPhase section */
@@ -299,18 +290,27 @@
299 isa = XCBuildConfiguration;
290 isa = XCBuildConfiguration;
300 buildSettings = {
291 buildSettings = {
301 ALWAYS_SEARCH_USER_PATHS = NO;
292 ALWAYS_SEARCH_USER_PATHS = NO;
293+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
302 CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
294 CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
303 CLANG_CXX_LIBRARY = "libc++";
295 CLANG_CXX_LIBRARY = "libc++";
304 CLANG_ENABLE_MODULES = YES;
296 CLANG_ENABLE_MODULES = YES;
305 CLANG_ENABLE_OBJC_ARC = YES;
297 CLANG_ENABLE_OBJC_ARC = YES;
298+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
306 CLANG_WARN_BOOL_CONVERSION = YES;
299 CLANG_WARN_BOOL_CONVERSION = YES;
300+ CLANG_WARN_COMMA = YES;
307 CLANG_WARN_CONSTANT_CONVERSION = YES;
301 CLANG_WARN_CONSTANT_CONVERSION = YES;
302+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
308 CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
303 CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
309 CLANG_WARN_EMPTY_BODY = YES;
304 CLANG_WARN_EMPTY_BODY = YES;
310 CLANG_WARN_ENUM_CONVERSION = YES;
305 CLANG_WARN_ENUM_CONVERSION = YES;
311 CLANG_WARN_INFINITE_RECURSION = YES;
306 CLANG_WARN_INFINITE_RECURSION = YES;
312 CLANG_WARN_INT_CONVERSION = YES;
307 CLANG_WARN_INT_CONVERSION = YES;
308+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
309+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
310+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
313 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
311 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
312+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
313+ CLANG_WARN_STRICT_PROTOTYPES = YES;
314 CLANG_WARN_SUSPICIOUS_MOVE = YES;
314 CLANG_WARN_SUSPICIOUS_MOVE = YES;
315 CLANG_WARN_UNREACHABLE_CODE = YES;
315 CLANG_WARN_UNREACHABLE_CODE = YES;
316 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
316 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -338,6 +338,7 @@
338 ONLY_ACTIVE_ARCH = YES;
338 ONLY_ACTIVE_ARCH = YES;
339 SDKROOT = iphoneos;
339 SDKROOT = iphoneos;
340 SWIFT_OPTIMIZATION_LEVEL = "-Onone";
340 SWIFT_OPTIMIZATION_LEVEL = "-Onone";
341+ SWIFT_SWIFT3_OBJC_INFERENCE = Off;
341 TARGETED_DEVICE_FAMILY = "1,2";
342 TARGETED_DEVICE_FAMILY = "1,2";
342 };
343 };
343 name = Debug;
344 name = Debug;
@@ -346,18 +347,27 @@
346 isa = XCBuildConfiguration;
347 isa = XCBuildConfiguration;
347 buildSettings = {
348 buildSettings = {
348 ALWAYS_SEARCH_USER_PATHS = NO;
349 ALWAYS_SEARCH_USER_PATHS = NO;
350+ CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
349 CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
351 CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
350 CLANG_CXX_LIBRARY = "libc++";
352 CLANG_CXX_LIBRARY = "libc++";
351 CLANG_ENABLE_MODULES = YES;
353 CLANG_ENABLE_MODULES = YES;
352 CLANG_ENABLE_OBJC_ARC = YES;
354 CLANG_ENABLE_OBJC_ARC = YES;
355+ CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
353 CLANG_WARN_BOOL_CONVERSION = YES;
356 CLANG_WARN_BOOL_CONVERSION = YES;
357+ CLANG_WARN_COMMA = YES;
354 CLANG_WARN_CONSTANT_CONVERSION = YES;
358 CLANG_WARN_CONSTANT_CONVERSION = YES;
359+ CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
355 CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
360 CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
356 CLANG_WARN_EMPTY_BODY = YES;
361 CLANG_WARN_EMPTY_BODY = YES;
357 CLANG_WARN_ENUM_CONVERSION = YES;
362 CLANG_WARN_ENUM_CONVERSION = YES;
358 CLANG_WARN_INFINITE_RECURSION = YES;
363 CLANG_WARN_INFINITE_RECURSION = YES;
359 CLANG_WARN_INT_CONVERSION = YES;
364 CLANG_WARN_INT_CONVERSION = YES;
365+ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
366+ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
367+ CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
360 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
368 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
369+ CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
370+ CLANG_WARN_STRICT_PROTOTYPES = YES;
361 CLANG_WARN_SUSPICIOUS_MOVE = YES;
371 CLANG_WARN_SUSPICIOUS_MOVE = YES;
362 CLANG_WARN_UNREACHABLE_CODE = YES;
372 CLANG_WARN_UNREACHABLE_CODE = YES;
363 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
373 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -378,6 +388,7 @@
378 MTL_ENABLE_DEBUG_INFO = NO;
388 MTL_ENABLE_DEBUG_INFO = NO;
379 SDKROOT = iphoneos;
389 SDKROOT = iphoneos;
380 SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
390 SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
391+ SWIFT_SWIFT3_OBJC_INFERENCE = Off;
381 TARGETED_DEVICE_FAMILY = "1,2";
392 TARGETED_DEVICE_FAMILY = "1,2";
382 VALIDATE_PRODUCT = YES;
393 VALIDATE_PRODUCT = YES;
383 };
394 };
@@ -388,12 +399,12 @@
388 baseConfigurationReference = 6659D12A5984961F335BDF69 /* Pods-PixelImage.debug.xcconfig */;
399 baseConfigurationReference = 6659D12A5984961F335BDF69 /* Pods-PixelImage.debug.xcconfig */;
389 buildSettings = {
400 buildSettings = {
390 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
401 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
391− DEVELOPMENT_TEAM = HHT774898M;
402+ DEVELOPMENT_TEAM = 8J63JZYYHZ;
392 INFOPLIST_FILE = PixelImage/Info.plist;
403 INFOPLIST_FILE = PixelImage/Info.plist;
393 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
404 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
394 PRODUCT_BUNDLE_IDENTIFIER = vinivendra.PixelImage;
405 PRODUCT_BUNDLE_IDENTIFIER = vinivendra.PixelImage;
395 PRODUCT_NAME = "$(TARGET_NAME)";
406 PRODUCT_NAME = "$(TARGET_NAME)";
396− SWIFT_VERSION = 3.0;
407+ SWIFT_VERSION = 5.0;
397 };
408 };
398 name = Debug;
409 name = Debug;
399 };
410 };
@@ -402,12 +413,12 @@
402 baseConfigurationReference = 0C9CE70F7D2C2896912B7B14 /* Pods-PixelImage.release.xcconfig */;
413 baseConfigurationReference = 0C9CE70F7D2C2896912B7B14 /* Pods-PixelImage.release.xcconfig */;
403 buildSettings = {
414 buildSettings = {
404 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
415 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
405− DEVELOPMENT_TEAM = HHT774898M;
416+ DEVELOPMENT_TEAM = 8J63JZYYHZ;
406 INFOPLIST_FILE = PixelImage/Info.plist;
417 INFOPLIST_FILE = PixelImage/Info.plist;
407 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
418 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
408 PRODUCT_BUNDLE_IDENTIFIER = vinivendra.PixelImage;
419 PRODUCT_BUNDLE_IDENTIFIER = vinivendra.PixelImage;
409 PRODUCT_NAME = "$(TARGET_NAME)";
420 PRODUCT_NAME = "$(TARGET_NAME)";
410− SWIFT_VERSION = 3.0;
421+ SWIFT_VERSION = 5.0;
411 };
422 };
412 name = Release;
423 name = Release;
413 };
424 };
PixelImage/AppDelegate.swift+1−1
@@ -13,7 +13,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
13
13
14 var window: UIWindow?
14 var window: UIWindow?
15
15
16− func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
16+ func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
17 // Override point for customization after application launch.
17 // Override point for customization after application launch.
18 return true
18 return true
19 }
19 }
PixelImage/Interpolation.swift+2−1
@@ -14,7 +14,8 @@ func interpolateSquareEaseOut<T: Numeric>(_ linear: T) -> T {
14}
14}
15
15
16func interpolateSmooth<T: Numeric>(_ linear: T) -> T {
16func interpolateSmooth<T: Numeric>(_ linear: T) -> T {
17+ let cube = (linear) * (linear) * (linear)
17− return ((linear) * (linear) * (linear) * ((linear) * ((linear) * 6 - 15) + 10))
18+ return (cube * ((linear) * ((linear) * 6 - 15) + 10))
18}
19}
19
20
20func createStringKeyframes(_ bounces: Int = 2, elasticity: Double = 1.1, bounceSpeed: Double) -> [(time: Double, position: Double)] {
21func createStringKeyframes(_ bounces: Int = 2, elasticity: Double = 1.1, bounceSpeed: Double) -> [(time: Double, position: Double)] {
PixelImage/Metal.swift+2−2
@@ -8,8 +8,8 @@ class MTLContext {
8
8
9 init(device: MTLDevice = MTLCreateSystemDefaultDevice()!) {
9 init(device: MTLDevice = MTLCreateSystemDefaultDevice()!) {
10 self.device = device
10 self.device = device
11− self.library = device.newDefaultLibrary()!
11+ self.library = device.makeDefaultLibrary()!
12− self.commandQueue = device.makeCommandQueue()
12+ self.commandQueue = device.makeCommandQueue()!
13 }
13 }
14}
14}
15
15
PixelImage/MetalMetaballRenderer.swift+15−16
@@ -45,15 +45,16 @@ import ChameleonFramework
45 width: width,
45 width: width,
46 height: height,
46 height: height,
47 mipmapped: false)
47 mipmapped: false)
48+ textureDescriptor.usage = .shaderWrite
48
49
49 let texture1 =
50 let texture1 =
50 context.device.makeTexture(descriptor: textureDescriptor)
51 context.device.makeTexture(descriptor: textureDescriptor)
51 activeComputeContext = MTLComputeContext(size: targetView.size,
52 activeComputeContext = MTLComputeContext(size: targetView.size,
52− texture: texture1)
53+ texture: texture1!)
53 let texture2 =
54 let texture2 =
54 context.device.makeTexture(descriptor: textureDescriptor)
55 context.device.makeTexture(descriptor: textureDescriptor)
55 idleComputeContext = MTLComputeContext(size: targetView.size,
56 idleComputeContext = MTLComputeContext(size: targetView.size,
56− texture: texture2)
57+ texture: texture2!)
57 }
58 }
58
59
59 internal func updateTargetView() {
60 internal func updateTargetView() {
@@ -62,9 +63,7 @@ import ChameleonFramework
62
63
63 state = .ending
64 state = .ending
64
65
65− let userInteractiveQueue =
66+ DispatchQueue.main.async { () -> Void in
66− DispatchQueue.global(qos: DispatchQoS.QoSClass.userInteractive)
67− userInteractiveQueue.async { () -> Void in
68 let computeContext = self.activeComputeContext
67 let computeContext = self.activeComputeContext
69 swap(&self.activeComputeContext, &self.idleComputeContext)
68 swap(&self.activeComputeContext, &self.idleComputeContext)
70
69
@@ -111,19 +110,19 @@ import ChameleonFramework
111 // Send commands to metal and render
110 // Send commands to metal and render
112 let commandBuffer = context.commandQueue.makeCommandBuffer()
111 let commandBuffer = context.commandQueue.makeCommandBuffer()
113
112
114− let commandEncoder = commandBuffer.makeComputeCommandEncoder()
113+ let commandEncoder = commandBuffer!.makeComputeCommandEncoder()
115− commandEncoder.setComputePipelineState(pipeline)
114+ commandEncoder!.setComputePipelineState(pipeline)
116− commandEncoder.setTexture(computeContext.texture, at: 0)
115+ commandEncoder!.setTexture(computeContext.texture, index: 0)
117 let metaballInfoBuffer = metaballBuffer()
116 let metaballInfoBuffer = metaballBuffer()
118− commandEncoder.setBuffer(metaballInfoBuffer, offset: 0, at: 0)
117+ commandEncoder!.setBuffer(metaballInfoBuffer, offset: 0, index: 0)
119 let edgesBuffer = metaballEdgesBuffer()
118 let edgesBuffer = metaballEdgesBuffer()
120− commandEncoder.setBuffer(edgesBuffer, offset: 0, at: 1)
119+ commandEncoder!.setBuffer(edgesBuffer, offset: 0, index: 1)
121− commandEncoder.dispatchThreadgroups(threadGroups,
120+ commandEncoder!.dispatchThreadgroups(threadGroups,
122 threadsPerThreadgroup: threadGroupCounts)
121 threadsPerThreadgroup: threadGroupCounts)
123− commandEncoder.endEncoding()
122+ commandEncoder!.endEncoding()
124
123
125− commandBuffer.commit()
124+ commandBuffer!.commit()
126− commandBuffer.waitUntilCompleted()
125+ commandBuffer!.waitUntilCompleted()
127 } catch _ {
126 } catch _ {
128 assertionFailure()
127 assertionFailure()
129 }
128 }
@@ -186,7 +185,7 @@ import ChameleonFramework
186 length: bufferLength,
185 length: bufferLength,
187 options: MTLResourceOptions())
186 options: MTLResourceOptions())
188
187
189− return buffer
188+ return buffer!
190 }
189 }
191
190
192 internal func metaballBuffer() -> MTLBuffer {
191 internal func metaballBuffer() -> MTLBuffer {
@@ -228,6 +227,6 @@ import ChameleonFramework
228 length: bufferLength,
227 length: bufferLength,
229 options: MTLResourceOptions())
228 options: MTLResourceOptions())
230
229
231− return buffer
230+ return buffer!
232 }
231 }
233}
232}
PixelImage/SwiftSugar/Numeric.swift+5−12
@@ -4,20 +4,13 @@ protocol DoubleValuable {
4 static func fromDouble(_ double: Double) -> Self
4 static func fromDouble(_ double: Double) -> Self
5}
5}
6
6
7−postfix operator ++ { }
8−
9−protocol Incrementable {
10− postfix func ++ (_: inout Self) -> Self
11−}
12−
13−protocol Numeric: DoubleValuable, Incrementable, Comparable,
7+protocol Numeric: DoubleValuable, Comparable,
14 ExpressibleByIntegerLiteral {
8 ExpressibleByIntegerLiteral {
15
9
16− @warn_unused_result func / (lhs: Self, rhs: Self) -> Self
10+ static func / (lhs: Self, rhs: Self) -> Self
17− @warn_unused_result func - (lhs: Self, rhs: Self) -> Self
11+ static func - (lhs: Self, rhs: Self) -> Self
18− @warn_unused_result func + (lhs: Self, rhs: Self) -> Self
12+ static func + (lhs: Self, rhs: Self) -> Self
19− @warn_unused_result func * (lhs: Self, rhs: Self) -> Self
13+ static func * (lhs: Self, rhs: Self) -> Self
20− postfix func ++ (_: inout Self) -> Self
21}
14}
22
15
23protocol FastNumeric: Numeric {}
16protocol FastNumeric: Numeric {}
PixelImage/ViewController.swift+5−5
@@ -80,7 +80,7 @@ class ViewController: UIViewController, MetaballDataSource {
80 delay(4) {
80 delay(4) {
81 for i in 1...5 {
81 for i in 1...5 {
82 UIView.animate(withDuration: 1.0, delay: 0,
82 UIView.animate(withDuration: 1.0, delay: 0,
83− options: UIViewAnimationOptions(),
83+ options: UIView.AnimationOptions(),
84 animations: { () -> Void in
84 animations: { () -> Void in
85 let sine = sin(Double(i) * 2 * .pi / 5)
85 let sine = sin(Double(i) * 2 * .pi / 5)
86 let cosine = cos(Double(i) * 2 * .pi / 5)
86 let cosine = cos(Double(i) * 2 * .pi / 5)
@@ -98,7 +98,7 @@ class ViewController: UIViewController, MetaballDataSource {
98 UIView.animate(withDuration: 1.0, delay: 0,
98 UIView.animate(withDuration: 1.0, delay: 0,
99 usingSpringWithDamping: 0.5,
99 usingSpringWithDamping: 0.5,
100 initialSpringVelocity: 0,
100 initialSpringVelocity: 0,
101− options: UIViewAnimationOptions(),
101+ options: UIView.AnimationOptions(),
102 animations: { () -> Void in
102 animations: { () -> Void in
103 let sine = sin(Double(i) * 2 * .pi / 5)
103 let sine = sin(Double(i) * 2 * .pi / 5)
104 let cosine = cos(Double(i) * 2 * .pi / 5)
104 let cosine = cos(Double(i) * 2 * .pi / 5)
@@ -136,7 +136,7 @@ class ViewController: UIViewController, MetaballDataSource {
136 repeats: true)
136 repeats: true)
137 }
137 }
138
138
139− func animateMetaball(withTimer timer: Timer) {
139+ @objc func animateMetaball(withTimer timer: Timer) {
140 guard let userInfo = timer.userInfo as? VertexAnimationParameters else {
140 guard let userInfo = timer.userInfo as? VertexAnimationParameters else {
141 preconditionFailure()
141 preconditionFailure()
142 }
142 }
@@ -174,7 +174,7 @@ class ViewController: UIViewController, MetaballDataSource {
174 repeats: true)
174 repeats: true)
175 }
175 }
176
176
177− func animateEdge(withTimer timer: Timer) {
177+ @objc func animateEdge(withTimer timer: Timer) {
178 guard let userInfo = timer.userInfo as? EdgeAnimationParameters else {
178 guard let userInfo = timer.userInfo as? EdgeAnimationParameters else {
179 preconditionFailure()
179 preconditionFailure()
180 }
180 }
@@ -199,7 +199,7 @@ class ViewController: UIViewController, MetaballDataSource {
199 renderer.state = .running
199 renderer.state = .running
200 }
200 }
201
201
202− func handlePan(_ recognizer: UIPanGestureRecognizer) {
202+ @objc func handlePan(_ recognizer: UIPanGestureRecognizer) {
203 let location = recognizer.location(in: metaballView)
203 let location = recognizer.location(in: metaballView)
204
204
205 if selectedMetaball == nil {
205 if selectedMetaball == nil {
Podfile.lock+2−2
@@ -12,7 +12,7 @@ EXTERNAL SOURCES:
12
12
13CHECKOUT OPTIONS:
13CHECKOUT OPTIONS:
14 ChameleonFramework:
14 ChameleonFramework:
15− :commit: acc480fbe023c6e5fe40f68593f4a70a8c4c7ad5
15+ :commit: 6dd284bde21ea2e7f9fd89bc36f40df16e16369d
16 :git: https://github.com/ViccAlexander/Chameleon.git
16 :git: https://github.com/ViccAlexander/Chameleon.git
17
17
18SPEC CHECKSUMS:
18SPEC CHECKSUMS:
@@ -20,4 +20,4 @@ SPEC CHECKSUMS:
20
20
21PODFILE CHECKSUM: 01ad8f20bdbed983c319dde08426f855f26bc5a0
21PODFILE CHECKSUM: 01ad8f20bdbed983c319dde08426f855f26bc5a0
22
22
23−COCOAPODS: 1.2.0
23+COCOAPODS: 1.5.2