From 5d821efaef0d2d3f83b935c6d0ef06cf8ed8c5b3 Mon Sep 17 00:00:00 2001 From: Intergalactic Igor Date: Sat, 31 Aug 2024 17:23:19 +0000 Subject: [PATCH] Update examples for v1.34.0 --- CESDK-Showcases.xcodeproj/project.pbxproj | 23 ++++++++++--------- camera-guides-quickstart/CameraSwiftUI.swift | 1 + camera-guides-quickstart/CameraUIKit.swift | 3 ++- .../CustomAssetLibrary.swift | 4 ++-- .../BasicEditorSolution.swift | 2 +- .../CallbacksEditorSolution.swift | 1 + .../ColorPaletteEditorSolution.swift | 2 +- editor-guides-quickstart/EditorSwiftUI.swift | 1 + editor-guides-quickstart/EditorUIKit.swift | 3 ++- .../ApparelEditorSolution.swift | 1 + .../DesignEditorSolution.swift | 1 + .../PhotoEditorSolution.swift | 1 + .../PostcardEditorSolution.swift | 1 + .../VideoEditorSolution.swift | 1 + .../CustomAssetSource.swift | 6 ++--- .../ExportingBlocks.swift | 2 +- .../LoadSceneFromBlob.swift | 2 +- .../LoadSceneFromString.swift | 2 +- engine-guides-source-sets/SourceSets.swift | 6 ++--- .../StoreMetadata.swift | 2 +- .../TextProperties.swift | 2 +- .../IntegrateWithAppKit.swift | 8 ++++--- .../IntegrateWithSwiftUI.swift | 1 + integrate-with-uikit/IntegrateWithUIKit.swift | 7 +++--- .../View/Examples/CustomPhotoEditor.swift | 2 +- .../View/Examples/CustomPostcardEditor.swift | 10 ++++---- .../View/Examples/CustomVideoEditor.swift | 6 ++--- showcases-app/View/PhotoSelection.swift | 4 ++-- showcases-app/View/ShowcaseMode.swift | 4 ++-- third-party/RemoteAssetSource.swift | 6 ++--- third-party/UnsplashAssetSource.swift | 6 ++--- 31 files changed, 68 insertions(+), 53 deletions(-) diff --git a/CESDK-Showcases.xcodeproj/project.pbxproj b/CESDK-Showcases.xcodeproj/project.pbxproj index d30b436..04a53b7 100644 --- a/CESDK-Showcases.xcodeproj/project.pbxproj +++ b/CESDK-Showcases.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -1036,7 +1036,7 @@ path = "engine-guides-uri-resolver"; sourceTree = ""; }; - "TEMP_8149283E-67A4-4B2E-944D-1684B8465881" /* build_github */ = { + "TEMP_155BE681-5361-4D9D-98B6-87ADAFB46B5A" /* cesdk_swift_examples */ = { isa = PBXGroup; children = ( 582BF90249D09687E7CFACDC /* editor-guides-solutions-video-editor */, @@ -1090,7 +1090,7 @@ 17668B475F84FBE03AEB5DE6 /* integrate-with-swiftui */, 566A7FBBF8D9A35991DA1421 /* engine-guides-exporting-blocks */, ); - path = build_github; + path = cesdk_swift_examples; sourceTree = ""; }; /* End PBXGroup section */ @@ -1142,12 +1142,13 @@ AA8555A8977E7AA9B19540FE /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1200; + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1430; TargetAttributes = { }; }; buildConfigurationList = E8E062FB538017B95F1DA23E /* Build configuration list for PBXProject "CESDK-Showcases" */; - compatibilityVersion = "Xcode 11.0"; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( @@ -1461,7 +1462,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 16.0; - MARKETING_VERSION = 1.33.0; + MARKETING_VERSION = 1.34.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1551,7 +1552,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; GENERATE_INFOPLIST_FILE = YES; IPHONEOS_DEPLOYMENT_TARGET = 16.0; - MARKETING_VERSION = 1.33.0; + MARKETING_VERSION = 1.34.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -1626,7 +1627,7 @@ repositoryURL = "https://github.com/imgly/IMGLYUI-swift"; requirement = { kind = exactVersion; - version = 1.33.0; + version = 1.34.0; }; }; 10597E39A033ABD8B233CD14 /* XCRemoteSwiftPackageReference "IMGLYEngine-swift" */ = { @@ -1634,7 +1635,7 @@ repositoryURL = "https://github.com/imgly/IMGLYEngine-swift"; requirement = { kind = exactVersion; - version = 1.33.0; + version = 1.34.0; }; }; 150F161C090426538C39E173 /* XCRemoteSwiftPackageReference "Kingfisher" */ = { @@ -1642,7 +1643,7 @@ repositoryURL = "https://github.com/onevcat/Kingfisher"; requirement = { kind = exactVersion; - version = 7.11.0; + version = 7.12.0; }; }; 4D2B057734A5412CF39C2B92 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */ = { @@ -1650,7 +1651,7 @@ repositoryURL = "https://github.com/siteline/SwiftUI-Introspect"; requirement = { kind = exactVersion; - version = 1.1.3; + version = 1.3.0; }; }; /* End XCRemoteSwiftPackageReference section */ diff --git a/camera-guides-quickstart/CameraSwiftUI.swift b/camera-guides-quickstart/CameraSwiftUI.swift index 79390b0..b6408a1 100644 --- a/camera-guides-quickstart/CameraSwiftUI.swift +++ b/camera-guides-quickstart/CameraSwiftUI.swift @@ -1,5 +1,6 @@ // highlight-import import IMGLYCamera + // highlight-import import SwiftUI diff --git a/camera-guides-quickstart/CameraUIKit.swift b/camera-guides-quickstart/CameraUIKit.swift index 5a5f42a..a32c276 100644 --- a/camera-guides-quickstart/CameraUIKit.swift +++ b/camera-guides-quickstart/CameraUIKit.swift @@ -1,5 +1,6 @@ // highlight-import import IMGLYCamera + // highlight-import import SwiftUI @@ -42,7 +43,7 @@ class CameraUIKit: UIViewController { button.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ button.centerXAnchor.constraint(equalTo: view.centerXAnchor), - button.centerYAnchor.constraint(equalTo: view.centerYAnchor) + button.centerYAnchor.constraint(equalTo: view.centerYAnchor), ]) } } diff --git a/editor-guides-configuration-asset-library/CustomAssetLibrary.swift b/editor-guides-configuration-asset-library/CustomAssetLibrary.swift index a06e0e7..9bb81a6 100644 --- a/editor-guides-configuration-asset-library/CustomAssetLibrary.swift +++ b/editor-guides-configuration-asset-library/CustomAssetLibrary.swift @@ -52,9 +52,9 @@ struct CustomAssetLibrary: AssetLibrary { @AssetLibraryBuilder var stickers: AssetLibraryContent { AssetLibrarySource.sticker(.titleForGroup { group in if let name = group?.split(separator: "/").last { - return name.capitalized + name.capitalized } else { - return "Stickers" + "Stickers" } }, source: .init(defaultSource: .sticker)) } diff --git a/editor-guides-configuration-basics/BasicEditorSolution.swift b/editor-guides-configuration-basics/BasicEditorSolution.swift index bb40eeb..7d33b80 100644 --- a/editor-guides-configuration-basics/BasicEditorSolution.swift +++ b/editor-guides-configuration-basics/BasicEditorSolution.swift @@ -8,7 +8,7 @@ struct BasicEditorSolution: View { // highlight-userID userID: "", // highlight-baseURL - baseURL: URL(string: "https://cdn.img.ly/packages/imgly/cesdk-engine/1.33.0/assets")! + baseURL: URL(string: "https://cdn.img.ly/packages/imgly/cesdk-engine/1.34.0/assets")! ) var editor: some View { diff --git a/editor-guides-configuration-callbacks/CallbacksEditorSolution.swift b/editor-guides-configuration-callbacks/CallbacksEditorSolution.swift index 3605ed9..2192d0d 100644 --- a/editor-guides-configuration-callbacks/CallbacksEditorSolution.swift +++ b/editor-guides-configuration-callbacks/CallbacksEditorSolution.swift @@ -3,6 +3,7 @@ // highlight-import import IMGLYDesignEditor import IMGLYEngine + // highlight-import import SwiftUI diff --git a/editor-guides-configuration-color-palette/ColorPaletteEditorSolution.swift b/editor-guides-configuration-color-palette/ColorPaletteEditorSolution.swift index b6bbcab..74a6a44 100644 --- a/editor-guides-configuration-color-palette/ColorPaletteEditorSolution.swift +++ b/editor-guides-configuration-color-palette/ColorPaletteEditorSolution.swift @@ -22,7 +22,7 @@ struct ColorPaletteEditorSolution: View { .init("Red", .imgly.red), .init("Black", .imgly.black), .init("White", .imgly.white), - .init("Gray", .imgly.gray) + .init("Gray", .imgly.gray), ]) // highlight-colorPalette } diff --git a/editor-guides-quickstart/EditorSwiftUI.swift b/editor-guides-quickstart/EditorSwiftUI.swift index a10fbd8..cf36108 100644 --- a/editor-guides-quickstart/EditorSwiftUI.swift +++ b/editor-guides-quickstart/EditorSwiftUI.swift @@ -1,5 +1,6 @@ // highlight-import import IMGLYDesignEditor + // highlight-import import SwiftUI diff --git a/editor-guides-quickstart/EditorUIKit.swift b/editor-guides-quickstart/EditorUIKit.swift index 5fa067e..13d6d65 100644 --- a/editor-guides-quickstart/EditorUIKit.swift +++ b/editor-guides-quickstart/EditorUIKit.swift @@ -1,5 +1,6 @@ // highlight-import import IMGLYDesignEditor + // highlight-import import SwiftUI @@ -34,7 +35,7 @@ class EditorUIKit: UIViewController { button.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ button.centerXAnchor.constraint(equalTo: view.centerXAnchor), - button.centerYAnchor.constraint(equalTo: view.centerYAnchor) + button.centerYAnchor.constraint(equalTo: view.centerYAnchor), ]) } } diff --git a/editor-guides-solutions-apparel-editor/ApparelEditorSolution.swift b/editor-guides-solutions-apparel-editor/ApparelEditorSolution.swift index e3767ca..c6a0870 100644 --- a/editor-guides-solutions-apparel-editor/ApparelEditorSolution.swift +++ b/editor-guides-solutions-apparel-editor/ApparelEditorSolution.swift @@ -1,5 +1,6 @@ // highlight-import import IMGLYApparelEditor + // highlight-import import SwiftUI diff --git a/editor-guides-solutions-design-editor/DesignEditorSolution.swift b/editor-guides-solutions-design-editor/DesignEditorSolution.swift index 0ece939..2c2d70c 100644 --- a/editor-guides-solutions-design-editor/DesignEditorSolution.swift +++ b/editor-guides-solutions-design-editor/DesignEditorSolution.swift @@ -1,5 +1,6 @@ // highlight-import import IMGLYDesignEditor + // highlight-import import SwiftUI diff --git a/editor-guides-solutions-photo-editor/PhotoEditorSolution.swift b/editor-guides-solutions-photo-editor/PhotoEditorSolution.swift index a8e3371..8e25e24 100644 --- a/editor-guides-solutions-photo-editor/PhotoEditorSolution.swift +++ b/editor-guides-solutions-photo-editor/PhotoEditorSolution.swift @@ -1,6 +1,7 @@ // highlight-import import IMGLYEngine import IMGLYPhotoEditor + // highlight-import import SwiftUI diff --git a/editor-guides-solutions-postcard-editor/PostcardEditorSolution.swift b/editor-guides-solutions-postcard-editor/PostcardEditorSolution.swift index 26c9904..b7f060a 100644 --- a/editor-guides-solutions-postcard-editor/PostcardEditorSolution.swift +++ b/editor-guides-solutions-postcard-editor/PostcardEditorSolution.swift @@ -1,5 +1,6 @@ // highlight-import import IMGLYPostcardEditor + // highlight-import import SwiftUI diff --git a/editor-guides-solutions-video-editor/VideoEditorSolution.swift b/editor-guides-solutions-video-editor/VideoEditorSolution.swift index a689e87..add2b67 100644 --- a/editor-guides-solutions-video-editor/VideoEditorSolution.swift +++ b/editor-guides-solutions-video-editor/VideoEditorSolution.swift @@ -1,5 +1,6 @@ // highlight-import import IMGLYVideoEditor + // highlight-import import SwiftUI diff --git a/engine-guides-custom-asset-source/CustomAssetSource.swift b/engine-guides-custom-asset-source/CustomAssetSource.swift index 1efb7da..658f09e 100644 --- a/engine-guides-custom-asset-source/CustomAssetSource.swift +++ b/engine-guides-custom-asset-source/CustomAssetSource.swift @@ -32,15 +32,15 @@ func customAssetSource(engine: Engine) async throws { "thumbUri": "https://example.com/thumbnails/ocean-waves-1.jpg", "mimeType": "video/mp4", "width": "1920", - "height": "1080" + "height": "1080", ], label: [ "en": "relaxing ocean waves", - "es": "olas del mar relajantes" + "es": "olas del mar relajantes", ], tags: [ "en": ["ocean", "waves", "soothing", "slow"], - "es": ["mar", "olas", "calmante", "lento"] + "es": ["mar", "olas", "calmante", "lento"], ]) try engine.asset.addAsset(to: "background-videos", asset: asset) // highlight-add-asset-to-source diff --git a/engine-guides-exporting-blocks/ExportingBlocks.swift b/engine-guides-exporting-blocks/ExportingBlocks.swift index c2bd058..3e7a311 100644 --- a/engine-guides-exporting-blocks/ExportingBlocks.swift +++ b/engine-guides-exporting-blocks/ExportingBlocks.swift @@ -9,7 +9,7 @@ import IMGLYEngine @MainActor func exportingBlocks(engine: Engine) async throws { - try engine.editor.setSettingString("basePath", value: "https://cdn.img.ly/packages/imgly/cesdk-engine/1.33.0/assets") + try engine.editor.setSettingString("basePath", value: "https://cdn.img.ly/packages/imgly/cesdk-engine/1.34.0/assets") try await engine.addDefaultAssetSources() let sceneUrl = URL(string: "https://cdn.img.ly/assets/demo/v1/ly.img.template/templates/cesdk_postcard_1.scene")! diff --git a/engine-guides-load-scene-from-blob/LoadSceneFromBlob.swift b/engine-guides-load-scene-from-blob/LoadSceneFromBlob.swift index 56147ed..4b15905 100644 --- a/engine-guides-load-scene-from-blob/LoadSceneFromBlob.swift +++ b/engine-guides-load-scene-from-blob/LoadSceneFromBlob.swift @@ -10,7 +10,7 @@ func loadSceneFromBlob(engine: Engine) async throws { // highlight-fetch-blob // highlight-read-blob - let blobString = String(data: sceneBlob, encoding: .utf8)! + let blobString = String(decoding: sceneBlob, as: UTF8.self) // highlight-read-blob // highlight-load diff --git a/engine-guides-load-scene-from-string/LoadSceneFromString.swift b/engine-guides-load-scene-from-string/LoadSceneFromString.swift index 404f8a7..5f9cc70 100644 --- a/engine-guides-load-scene-from-string/LoadSceneFromString.swift +++ b/engine-guides-load-scene-from-string/LoadSceneFromString.swift @@ -7,7 +7,7 @@ func loadSceneFromString(engine: Engine) async throws { let sceneURL = URL(string: "https://cdn.img.ly/assets/demo/v1/ly.img.template/templates/cesdk_postcard_1.scene")! let sceneBlob = try await URLSession.shared.data(from: sceneURL).0 - let blobString = String(data: sceneBlob, encoding: .utf8)! + let blobString = String(decoding: sceneBlob, as: UTF8.self) // highlight-fetch-string // highlight-load diff --git a/engine-guides-source-sets/SourceSets.swift b/engine-guides-source-sets/SourceSets.swift index 09c3f15..f49f95f 100644 --- a/engine-guides-source-sets/SourceSets.swift +++ b/engine-guides-source-sets/SourceSets.swift @@ -32,7 +32,7 @@ func sourceSets(engine: Engine) async throws { uri: URL(string: "https://img.ly/static/ubq_samples/sample_1_2048x1366.jpg")!, width: 2048, height: 1366 - ) + ), ]) try engine.block.setFill(block, fill: imageFill) try engine.block.appendChild(to: page, child: block) @@ -43,7 +43,7 @@ func sourceSets(engine: Engine) async throws { id: "my-image", meta: [ "kind": "image", - "fillType": "//ly.img.ubq/fill/image" + "fillType": "//ly.img.ubq/fill/image", ], payload: .init(sourceSet: [ .init( @@ -60,7 +60,7 @@ func sourceSets(engine: Engine) async throws { uri: URL(string: "https://img.ly/static/ubq_samples/sample_1_2048x1366.jpg")!, width: 2048, height: 1366 - ) + ), ]) ) // highlight-asset-definition diff --git a/engine-guides-store-metadata/StoreMetadata.swift b/engine-guides-store-metadata/StoreMetadata.swift index e4c4e09..ecf8d6a 100644 --- a/engine-guides-store-metadata/StoreMetadata.swift +++ b/engine-guides-store-metadata/StoreMetadata.swift @@ -25,7 +25,7 @@ func storeMetadata(engine: Engine) async throws { try engine.block.setMetadata( block, key: "payment", - value: String(data: JSONEncoder().encode(payment), encoding: .utf8)! + value: String(decoding: JSONEncoder().encode(payment), as: UTF8.self) ) // highlight-setMetadata diff --git a/engine-guides-text-properties/TextProperties.swift b/engine-guides-text-properties/TextProperties.swift index 3cad087..fef3719 100644 --- a/engine-guides-text-properties/TextProperties.swift +++ b/engine-guides-text-properties/TextProperties.swift @@ -76,7 +76,7 @@ func textProperties(engine: Engine) async throws { subFamily: "Regular", weight: .normal, style: .normal - ) + ), ] ) try engine.block.setFont(text, fontFileURL: typeface.fonts[3].uri, typeface: typeface) diff --git a/integrate-with-appkit/IntegrateWithAppKit.swift b/integrate-with-appkit/IntegrateWithAppKit.swift index 76b5f51..70dde4a 100644 --- a/integrate-with-appkit/IntegrateWithAppKit.swift +++ b/integrate-with-appkit/IntegrateWithAppKit.swift @@ -1,7 +1,9 @@ #if os(macOS) import Cocoa + // highlight-import import IMGLYEngine + // highlight-import import MetalKit @@ -28,7 +30,7 @@ canvas.leftAnchor.constraint(equalTo: view.leftAnchor), canvas.rightAnchor.constraint(equalTo: view.rightAnchor), canvas.topAnchor.constraint(equalTo: view.topAnchor), - canvas.bottomAnchor.constraint(equalTo: view.bottomAnchor) + canvas.bottomAnchor.constraint(equalTo: view.bottomAnchor), ]) // highlight-view @@ -36,7 +38,7 @@ spinner.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ spinner.centerXAnchor.constraint(equalTo: view.centerXAnchor), - spinner.centerYAnchor.constraint(equalTo: view.centerYAnchor) + spinner.centerYAnchor.constraint(equalTo: view.centerYAnchor), ]) spinner.startAnimation(self) spinner.isDisplayedWhenStopped = false @@ -45,7 +47,7 @@ button.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ button.centerXAnchor.constraint(equalTo: view.centerXAnchor), - button.centerYAnchor.constraint(equalTo: view.centerYAnchor) + button.centerYAnchor.constraint(equalTo: view.centerYAnchor), ]) button.isHidden = true } diff --git a/integrate-with-swiftui/IntegrateWithSwiftUI.swift b/integrate-with-swiftui/IntegrateWithSwiftUI.swift index ed5d845..60a11f9 100644 --- a/integrate-with-swiftui/IntegrateWithSwiftUI.swift +++ b/integrate-with-swiftui/IntegrateWithSwiftUI.swift @@ -1,5 +1,6 @@ // highlight-import import IMGLYEngine + // highlight-import import SwiftUI diff --git a/integrate-with-uikit/IntegrateWithUIKit.swift b/integrate-with-uikit/IntegrateWithUIKit.swift index 5f1f753..8cf3f18 100644 --- a/integrate-with-uikit/IntegrateWithUIKit.swift +++ b/integrate-with-uikit/IntegrateWithUIKit.swift @@ -1,6 +1,7 @@ #if os(iOS) // highlight-import import IMGLYEngine + // highlight-import import MetalKit import UIKit @@ -41,7 +42,7 @@ canvas.leftAnchor.constraint(equalTo: view.leftAnchor), canvas.rightAnchor.constraint(equalTo: view.rightAnchor), canvas.topAnchor.constraint(equalTo: view.topAnchor), - canvas.bottomAnchor.constraint(equalTo: view.bottomAnchor) + canvas.bottomAnchor.constraint(equalTo: view.bottomAnchor), ]) // highlight-view @@ -49,7 +50,7 @@ spinner.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ spinner.centerXAnchor.constraint(equalTo: view.centerXAnchor), - spinner.centerYAnchor.constraint(equalTo: view.centerYAnchor) + spinner.centerYAnchor.constraint(equalTo: view.centerYAnchor), ]) spinner.startAnimating() spinner.hidesWhenStopped = true @@ -58,7 +59,7 @@ button.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([ button.centerXAnchor.constraint(equalTo: view.centerXAnchor), - button.centerYAnchor.constraint(equalTo: view.centerYAnchor) + button.centerYAnchor.constraint(equalTo: view.centerYAnchor), ]) button.isHidden = true } diff --git a/showcases-app/View/Examples/CustomPhotoEditor.swift b/showcases-app/View/Examples/CustomPhotoEditor.swift index 8a51691..4d2e8c9 100644 --- a/showcases-app/View/Examples/CustomPhotoEditor.swift +++ b/showcases-app/View/Examples/CustomPhotoEditor.swift @@ -10,7 +10,7 @@ struct CustomPhotoEditor: View { ("2_3", "Photo · 2:3", .init(width: 1080, height: 1620)), ("3_2", "Photo · 3:2", .init(width: 1620, height: 1080)), ("3_4", "Photo · 3:4", .init(width: 1080, height: 1440)), - ("4_3", "Photo · 4:3", .init(width: 1440, height: 1080)) + ("4_3", "Photo · 4:3", .init(width: 1440, height: 1080)), ] var body: some View { diff --git a/showcases-app/View/Examples/CustomPostcardEditor.swift b/showcases-app/View/Examples/CustomPostcardEditor.swift index 1fdd726..570efa2 100644 --- a/showcases-app/View/Examples/CustomPostcardEditor.swift +++ b/showcases-app/View/Examples/CustomPostcardEditor.swift @@ -10,7 +10,7 @@ struct CustomPostcardEditor: View { ("Kimberly", .imgly.hex("#7471A3")!), ("Gondola", .imgly.hex("#20121F")!), ("Dove Gray", .imgly.hex("#696969")!), - ("Dusty Gray", .imgly.hex("#999999")!) + ("Dusty Gray", .imgly.hex("#999999")!), ]), ("Merry Christmas", colorPalette: [ ("Fern Frond", .imgly.hex("#536F1A")!), @@ -19,7 +19,7 @@ struct CustomPostcardEditor: View { ("Fuel Yellow", .imgly.hex("#F3AE2B")!), ("Black Bean", .imgly.hex("#051111")!), ("Dove Gray", .imgly.hex("#696969")!), - ("Dusty Gray", .imgly.hex("#999999")!) + ("Dusty Gray", .imgly.hex("#999999")!), ]), ("Bonjour Paris", colorPalette: [ ("Black", .imgly.hex("#000000")!), @@ -28,7 +28,7 @@ struct CustomPostcardEditor: View { ("Persimmon", .imgly.hex("#FE6755")!), ("Scorpion", .imgly.hex("#606060")!), ("Dove Gray", .imgly.hex("#696969")!), - ("Dusty Gray", .imgly.hex("#999999")!) + ("Dusty Gray", .imgly.hex("#999999")!), ]), ("Wish you were here", colorPalette: [ ("Mandy", .imgly.hex("#E75050")!), @@ -37,8 +37,8 @@ struct CustomPostcardEditor: View { ("Shark", .imgly.hex("#282929")!), ("Patina", .imgly.hex("#619888")!), ("Dove Gray", .imgly.hex("#696969")!), - ("Dusty Gray", .imgly.hex("#999999")!) - ]) + ("Dusty Gray", .imgly.hex("#999999")!), + ]), ] var body: some View { diff --git a/showcases-app/View/Examples/CustomVideoEditor.swift b/showcases-app/View/Examples/CustomVideoEditor.swift index 9b502b2..2a4962b 100644 --- a/showcases-app/View/Examples/CustomVideoEditor.swift +++ b/showcases-app/View/Examples/CustomVideoEditor.swift @@ -46,11 +46,11 @@ struct CustomVideoEditor: View { AssetLibrarySource.sticker(.titleForGroup { group in if let name = group { switch name { - case "3dstickers": return "3D Stickers" - default: return name.capitalized + case "3dstickers": "3D Stickers" + default: name.capitalized } } else { - return "Stickers" + "Stickers" } }, source: .init(id: stickerMiscID)) } diff --git a/showcases-app/View/PhotoSelection.swift b/showcases-app/View/PhotoSelection.swift index c54014f..9986b3f 100644 --- a/showcases-app/View/PhotoSelection.swift +++ b/showcases-app/View/PhotoSelection.swift @@ -77,9 +77,9 @@ private struct Thumbnail: View { private var imageURL: URL { if colorScheme == .dark, let imageDark = format.imageDark { - return imageDark + imageDark } else { - return format.image + format.image } } diff --git a/showcases-app/View/ShowcaseMode.swift b/showcases-app/View/ShowcaseMode.swift index ef79399..ddaf467 100644 --- a/showcases-app/View/ShowcaseMode.swift +++ b/showcases-app/View/ShowcaseMode.swift @@ -7,8 +7,8 @@ enum ShowcaseMode: CaseIterable, Identifiable, CustomStringConvertible { var description: String { switch self { - case .navigationLink: return "Navigation" - case .fullScreenCover: return "Modal" + case .navigationLink: "Navigation" + case .fullScreenCover: "Modal" } } } diff --git a/third-party/RemoteAssetSource.swift b/third-party/RemoteAssetSource.swift index a0ae9b1..ff54683 100644 --- a/third-party/RemoteAssetSource.swift +++ b/third-party/RemoteAssetSource.swift @@ -297,11 +297,11 @@ private extension AssetResult { let meta: [String: String]? = ras.meta?.mapValues { switch $0 { case let .string(value): - return value + value case let .int(value): - return String(value) + String(value) case let .float(value): - return String(value) + String(value) } } diff --git a/third-party/UnsplashAssetSource.swift b/third-party/UnsplashAssetSource.swift index a716a55..f44269f 100644 --- a/third-party/UnsplashAssetSource.swift +++ b/third-party/UnsplashAssetSource.swift @@ -28,7 +28,7 @@ public final class UnsplashAssetSource: NSObject { .init(name: "query", value: queryData.query), .init(name: "page", value: String(queryData.page + 1)), .init(name: "per_page", value: String(queryData.perPage)), - .init(name: "content_filter", value: "high") + .init(name: "content_filter", value: "high"), ] ) } @@ -40,7 +40,7 @@ public final class UnsplashAssetSource: NSObject { .init(name: "order_by", value: "popular"), .init(name: "page", value: String(queryData.page + 1)), .init(name: "per_page", value: String(queryData.perPage)), - .init(name: "content_filter", value: "high") + .init(name: "content_filter", value: "high"), ] ) } @@ -158,7 +158,7 @@ private extension AssetResult { // highlight-result-kind // highlight-result-size "width": String(image.width), - "height": String(image.height) + "height": String(image.height), // highlight-result-size ], // highlight-result-meta