git.iko.soy/metal-metaballs
on b88fbfc help sign in
PixelImage.xcodeproj/project.pbxproj+24−35
since splitsnapshots
unifiedsplit
@@ -144,6 +144,7 @@
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 */,
147 );
148 );
148 buildRules = (
149 buildRules = (
149 );
150 );
@@ -161,13 +162,13 @@
161 isa = PBXProject;
162 isa = PBXProject;
162 attributes = {
163 attributes = {
163 LastSwiftUpdateCheck = 0720;
164 LastSwiftUpdateCheck = 0720;
164− LastUpgradeCheck = 1020;
165+ LastUpgradeCheck = 0830;
165 ORGANIZATIONNAME = "Vinicius Vendramini";
166 ORGANIZATIONNAME = "Vinicius Vendramini";
166 TargetAttributes = {
167 TargetAttributes = {
167 242686831C63B72A00D62456 = {
168 242686831C63B72A00D62456 = {
168 CreatedOnToolsVersion = 7.2;
169 CreatedOnToolsVersion = 7.2;
169− DevelopmentTeam = 8J63JZYYHZ;
170+ DevelopmentTeam = HHT774898M;
170− LastSwiftMigration = 1020;
171+ LastSwiftMigration = 0830;
171 };
172 };
172 };
173 };
173 };
174 };
@@ -176,7 +177,6 @@
176 developmentRegion = English;
177 developmentRegion = English;
177 hasScannedForEncodings = 0;
178 hasScannedForEncodings = 0;
178 knownRegions = (
179 knownRegions = (
179− English,
180 en,
180 en,
181 Base,
181 Base,
182 );
182 );
@@ -210,16 +210,13 @@
210 files = (
210 files = (
211 );
211 );
212 inputPaths = (
212 inputPaths = (
213− "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
214− "${PODS_ROOT}/Manifest.lock",
215 );
213 );
216 name = "[CP] Check Pods Manifest.lock";
214 name = "[CP] Check Pods Manifest.lock";
217 outputPaths = (
215 outputPaths = (
218− "$(DERIVED_FILE_DIR)/Pods-PixelImage-checkManifestLockResult.txt",
219 );
216 );
220 runOnlyForDeploymentPostprocessing = 0;
217 runOnlyForDeploymentPostprocessing = 0;
221 shellPath = /bin/sh;
218 shellPath = /bin/sh;
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";
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";
223 showEnvVarsInLog = 0;
220 showEnvVarsInLog = 0;
224 };
221 };
225 3CA888DC160972BAEB74EC52 /* [CP] Embed Pods Frameworks */ = {
222 3CA888DC160972BAEB74EC52 /* [CP] Embed Pods Frameworks */ = {
@@ -228,18 +225,30 @@
228 files = (
225 files = (
229 );
226 );
230 inputPaths = (
227 inputPaths = (
231− "${SRCROOT}/Pods/Target Support Files/Pods-PixelImage/Pods-PixelImage-frameworks.sh",
232− "${BUILT_PRODUCTS_DIR}/ChameleonFramework/ChameleonFramework.framework",
233 );
228 );
234 name = "[CP] Embed Pods Frameworks";
229 name = "[CP] Embed Pods Frameworks";
235 outputPaths = (
230 outputPaths = (
236− "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/ChameleonFramework.framework",
237 );
231 );
238 runOnlyForDeploymentPostprocessing = 0;
232 runOnlyForDeploymentPostprocessing = 0;
239 shellPath = /bin/sh;
233 shellPath = /bin/sh;
240 shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PixelImage/Pods-PixelImage-frameworks.sh\"\n";
234 shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-PixelImage/Pods-PixelImage-frameworks.sh\"\n";
241 showEnvVarsInLog = 0;
235 showEnvVarsInLog = 0;
242 };
236 };
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+ };
243/* End PBXShellScriptBuildPhase section */
252/* End PBXShellScriptBuildPhase section */
244
253
245/* Begin PBXSourcesBuildPhase section */
254/* Begin PBXSourcesBuildPhase section */
@@ -290,27 +299,18 @@
290 isa = XCBuildConfiguration;
299 isa = XCBuildConfiguration;
291 buildSettings = {
300 buildSettings = {
292 ALWAYS_SEARCH_USER_PATHS = NO;
301 ALWAYS_SEARCH_USER_PATHS = NO;
293− CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
294 CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
302 CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
295 CLANG_CXX_LIBRARY = "libc++";
303 CLANG_CXX_LIBRARY = "libc++";
296 CLANG_ENABLE_MODULES = YES;
304 CLANG_ENABLE_MODULES = YES;
297 CLANG_ENABLE_OBJC_ARC = YES;
305 CLANG_ENABLE_OBJC_ARC = YES;
298− CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
299 CLANG_WARN_BOOL_CONVERSION = YES;
306 CLANG_WARN_BOOL_CONVERSION = YES;
300− CLANG_WARN_COMMA = YES;
301 CLANG_WARN_CONSTANT_CONVERSION = YES;
307 CLANG_WARN_CONSTANT_CONVERSION = YES;
302− CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
303 CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
308 CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
304 CLANG_WARN_EMPTY_BODY = YES;
309 CLANG_WARN_EMPTY_BODY = YES;
305 CLANG_WARN_ENUM_CONVERSION = YES;
310 CLANG_WARN_ENUM_CONVERSION = YES;
306 CLANG_WARN_INFINITE_RECURSION = YES;
311 CLANG_WARN_INFINITE_RECURSION = YES;
307 CLANG_WARN_INT_CONVERSION = YES;
312 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;
311 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
313 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,7 +338,6 @@
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;
342 TARGETED_DEVICE_FAMILY = "1,2";
341 TARGETED_DEVICE_FAMILY = "1,2";
343 };
342 };
344 name = Debug;
343 name = Debug;
@@ -347,27 +346,18 @@
347 isa = XCBuildConfiguration;
346 isa = XCBuildConfiguration;
348 buildSettings = {
347 buildSettings = {
349 ALWAYS_SEARCH_USER_PATHS = NO;
348 ALWAYS_SEARCH_USER_PATHS = NO;
350− CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
351 CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
349 CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
352 CLANG_CXX_LIBRARY = "libc++";
350 CLANG_CXX_LIBRARY = "libc++";
353 CLANG_ENABLE_MODULES = YES;
351 CLANG_ENABLE_MODULES = YES;
354 CLANG_ENABLE_OBJC_ARC = YES;
352 CLANG_ENABLE_OBJC_ARC = YES;
355− CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
356 CLANG_WARN_BOOL_CONVERSION = YES;
353 CLANG_WARN_BOOL_CONVERSION = YES;
357− CLANG_WARN_COMMA = YES;
358 CLANG_WARN_CONSTANT_CONVERSION = YES;
354 CLANG_WARN_CONSTANT_CONVERSION = YES;
359− CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
360 CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
355 CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
361 CLANG_WARN_EMPTY_BODY = YES;
356 CLANG_WARN_EMPTY_BODY = YES;
362 CLANG_WARN_ENUM_CONVERSION = YES;
357 CLANG_WARN_ENUM_CONVERSION = YES;
363 CLANG_WARN_INFINITE_RECURSION = YES;
358 CLANG_WARN_INFINITE_RECURSION = YES;
364 CLANG_WARN_INT_CONVERSION = YES;
359 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;
368 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
360 CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
369− CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
370− CLANG_WARN_STRICT_PROTOTYPES = YES;
371 CLANG_WARN_SUSPICIOUS_MOVE = YES;
361 CLANG_WARN_SUSPICIOUS_MOVE = YES;
372 CLANG_WARN_UNREACHABLE_CODE = YES;
362 CLANG_WARN_UNREACHABLE_CODE = YES;
373 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
363 CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -388,7 +378,6 @@
388 MTL_ENABLE_DEBUG_INFO = NO;
378 MTL_ENABLE_DEBUG_INFO = NO;
389 SDKROOT = iphoneos;
379 SDKROOT = iphoneos;
390 SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
380 SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
391− SWIFT_SWIFT3_OBJC_INFERENCE = Off;
392 TARGETED_DEVICE_FAMILY = "1,2";
381 TARGETED_DEVICE_FAMILY = "1,2";
393 VALIDATE_PRODUCT = YES;
382 VALIDATE_PRODUCT = YES;
394 };
383 };
@@ -399,12 +388,12 @@
399 baseConfigurationReference = 6659D12A5984961F335BDF69 /* Pods-PixelImage.debug.xcconfig */;
388 baseConfigurationReference = 6659D12A5984961F335BDF69 /* Pods-PixelImage.debug.xcconfig */;
400 buildSettings = {
389 buildSettings = {
401 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
390 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
402− DEVELOPMENT_TEAM = 8J63JZYYHZ;
391+ DEVELOPMENT_TEAM = HHT774898M;
403 INFOPLIST_FILE = PixelImage/Info.plist;
392 INFOPLIST_FILE = PixelImage/Info.plist;
404 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
393 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
405 PRODUCT_BUNDLE_IDENTIFIER = vinivendra.PixelImage;
394 PRODUCT_BUNDLE_IDENTIFIER = vinivendra.PixelImage;
406 PRODUCT_NAME = "$(TARGET_NAME)";
395 PRODUCT_NAME = "$(TARGET_NAME)";
407− SWIFT_VERSION = 5.0;
396+ SWIFT_VERSION = 3.0;
408 };
397 };
409 name = Debug;
398 name = Debug;
410 };
399 };
@@ -413,12 +402,12 @@
413 baseConfigurationReference = 0C9CE70F7D2C2896912B7B14 /* Pods-PixelImage.release.xcconfig */;
402 baseConfigurationReference = 0C9CE70F7D2C2896912B7B14 /* Pods-PixelImage.release.xcconfig */;
414 buildSettings = {
403 buildSettings = {
415 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
404 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
416− DEVELOPMENT_TEAM = 8J63JZYYHZ;
405+ DEVELOPMENT_TEAM = HHT774898M;
417 INFOPLIST_FILE = PixelImage/Info.plist;
406 INFOPLIST_FILE = PixelImage/Info.plist;
418 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
407 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
419 PRODUCT_BUNDLE_IDENTIFIER = vinivendra.PixelImage;
408 PRODUCT_BUNDLE_IDENTIFIER = vinivendra.PixelImage;
420 PRODUCT_NAME = "$(TARGET_NAME)";
409 PRODUCT_NAME = "$(TARGET_NAME)";
421− SWIFT_VERSION = 5.0;
410+ SWIFT_VERSION = 3.0;
422 };
411 };
423 name = Release;
412 name = Release;
424 };
413 };
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: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
16+ func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: 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+1−2
@@ -14,8 +14,7 @@ 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)
18− return (cube * ((linear) * ((linear) * 6 - 15) + 10))
17+ return ((linear) * (linear) * (linear) * ((linear) * ((linear) * 6 - 15) + 10))
19}
18}
20
19
21func createStringKeyframes(_ bounces: Int = 2, elasticity: Double = 1.1, bounceSpeed: Double) -> [(time: Double, position: Double)] {
20func 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.makeDefaultLibrary()!
11+ self.library = device.newDefaultLibrary()!
12− self.commandQueue = device.makeCommandQueue()!
12+ self.commandQueue = device.makeCommandQueue()
13 }
13 }
14}
14}
15
15
PixelImage/MetalMetaballRenderer.swift+16−15
@@ -45,16 +45,15 @@ import ChameleonFramework
45 width: width,
45 width: width,
46 height: height,
46 height: height,
47 mipmapped: false)
47 mipmapped: false)
48− textureDescriptor.usage = .shaderWrite
49
48
50 let texture1 =
49 let texture1 =
51 context.device.makeTexture(descriptor: textureDescriptor)
50 context.device.makeTexture(descriptor: textureDescriptor)
52 activeComputeContext = MTLComputeContext(size: targetView.size,
51 activeComputeContext = MTLComputeContext(size: targetView.size,
53− texture: texture1!)
52+ texture: texture1)
54 let texture2 =
53 let texture2 =
55 context.device.makeTexture(descriptor: textureDescriptor)
54 context.device.makeTexture(descriptor: textureDescriptor)
56 idleComputeContext = MTLComputeContext(size: targetView.size,
55 idleComputeContext = MTLComputeContext(size: targetView.size,
57− texture: texture2!)
56+ texture: texture2)
58 }
57 }
59
58
60 internal func updateTargetView() {
59 internal func updateTargetView() {
@@ -63,7 +62,9 @@ import ChameleonFramework
63
62
64 state = .ending
63 state = .ending
65
64
66− DispatchQueue.main.async { () -> Void in
65+ let userInteractiveQueue =
66+ DispatchQueue.global(qos: DispatchQoS.QoSClass.userInteractive)
67+ userInteractiveQueue.async { () -> Void in
67 let computeContext = self.activeComputeContext
68 let computeContext = self.activeComputeContext
68 swap(&self.activeComputeContext, &self.idleComputeContext)
69 swap(&self.activeComputeContext, &self.idleComputeContext)
69
70
@@ -110,19 +111,19 @@ import ChameleonFramework
110 // Send commands to metal and render
111 // Send commands to metal and render
111 let commandBuffer = context.commandQueue.makeCommandBuffer()
112 let commandBuffer = context.commandQueue.makeCommandBuffer()
112
113
113− let commandEncoder = commandBuffer!.makeComputeCommandEncoder()
114+ let commandEncoder = commandBuffer.makeComputeCommandEncoder()
114− commandEncoder!.setComputePipelineState(pipeline)
115+ commandEncoder.setComputePipelineState(pipeline)
115− commandEncoder!.setTexture(computeContext.texture, index: 0)
116+ commandEncoder.setTexture(computeContext.texture, at: 0)
116 let metaballInfoBuffer = metaballBuffer()
117 let metaballInfoBuffer = metaballBuffer()
117− commandEncoder!.setBuffer(metaballInfoBuffer, offset: 0, index: 0)
118+ commandEncoder.setBuffer(metaballInfoBuffer, offset: 0, at: 0)
118 let edgesBuffer = metaballEdgesBuffer()
119 let edgesBuffer = metaballEdgesBuffer()
119− commandEncoder!.setBuffer(edgesBuffer, offset: 0, index: 1)
120+ commandEncoder.setBuffer(edgesBuffer, offset: 0, at: 1)
120− commandEncoder!.dispatchThreadgroups(threadGroups,
121+ commandEncoder.dispatchThreadgroups(threadGroups,
121 threadsPerThreadgroup: threadGroupCounts)
122 threadsPerThreadgroup: threadGroupCounts)
122− commandEncoder!.endEncoding()
123+ commandEncoder.endEncoding()
123
124
124− commandBuffer!.commit()
125+ commandBuffer.commit()
125− commandBuffer!.waitUntilCompleted()
126+ commandBuffer.waitUntilCompleted()
126 } catch _ {
127 } catch _ {
127 assertionFailure()
128 assertionFailure()
128 }
129 }
@@ -185,7 +186,7 @@ import ChameleonFramework
185 length: bufferLength,
186 length: bufferLength,
186 options: MTLResourceOptions())
187 options: MTLResourceOptions())
187
188
188− return buffer!
189+ return buffer
189 }
190 }
190
191
191 internal func metaballBuffer() -> MTLBuffer {
192 internal func metaballBuffer() -> MTLBuffer {
@@ -227,6 +228,6 @@ import ChameleonFramework
227 length: bufferLength,
228 length: bufferLength,
228 options: MTLResourceOptions())
229 options: MTLResourceOptions())
229
230
230− return buffer!
231+ return buffer
231 }
232 }
232}
233}
PixelImage/SwiftSugar/Numeric.swift+12−5
@@ -4,13 +4,20 @@ 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+
7−protocol Numeric: DoubleValuable, Comparable,
13+protocol Numeric: DoubleValuable, Incrementable, Comparable,
8 ExpressibleByIntegerLiteral {
14 ExpressibleByIntegerLiteral {
9
15
10− static func / (lhs: Self, rhs: Self) -> Self
16+ @warn_unused_result func / (lhs: Self, rhs: Self) -> Self
11− static func - (lhs: Self, rhs: Self) -> Self
17+ @warn_unused_result func - (lhs: Self, rhs: Self) -> Self
12− static func + (lhs: Self, rhs: Self) -> Self
18+ @warn_unused_result func + (lhs: Self, rhs: Self) -> Self
13− static func * (lhs: Self, rhs: Self) -> Self
19+ @warn_unused_result func * (lhs: Self, rhs: Self) -> Self
20+ postfix func ++ (_: inout Self) -> Self
14}
21}
15
22
16protocol FastNumeric: Numeric {}
23protocol 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: UIView.AnimationOptions(),
83+ options: UIViewAnimationOptions(),
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: UIView.AnimationOptions(),
101+ options: UIViewAnimationOptions(),
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− @objc func animateMetaball(withTimer timer: Timer) {
139+ 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− @objc func animateEdge(withTimer timer: Timer) {
177+ 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− @objc func handlePan(_ recognizer: UIPanGestureRecognizer) {
202+ 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: 6dd284bde21ea2e7f9fd89bc36f40df16e16369d
15+ :commit: acc480fbe023c6e5fe40f68593f4a70a8c4c7ad5
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.5.2
23+COCOAPODS: 1.2.0