Skip to content

Commit

Permalink
Update examples for v1.34.0
Browse files Browse the repository at this point in the history
  • Loading branch information
imgly-bot committed Aug 31, 2024
1 parent c5e48d1 commit 5d821ef
Show file tree
Hide file tree
Showing 31 changed files with 68 additions and 53 deletions.
23 changes: 12 additions & 11 deletions CESDK-Showcases.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXBuildFile section */
Expand Down Expand Up @@ -1036,7 +1036,7 @@
path = "engine-guides-uri-resolver";
sourceTree = "<group>";
};
"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 */,
Expand Down Expand Up @@ -1090,7 +1090,7 @@
17668B475F84FBE03AEB5DE6 /* integrate-with-swiftui */,
566A7FBBF8D9A35991DA1421 /* engine-guides-exporting-blocks */,
);
path = build_github;
path = cesdk_swift_examples;
sourceTree = "<group>";
};
/* End PBXGroup section */
Expand Down Expand Up @@ -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 = (
Expand Down Expand Up @@ -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)";
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1626,31 +1627,31 @@
repositoryURL = "https://github.com/imgly/IMGLYUI-swift";
requirement = {
kind = exactVersion;
version = 1.33.0;
version = 1.34.0;
};
};
10597E39A033ABD8B233CD14 /* XCRemoteSwiftPackageReference "IMGLYEngine-swift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/imgly/IMGLYEngine-swift";
requirement = {
kind = exactVersion;
version = 1.33.0;
version = 1.34.0;
};
};
150F161C090426538C39E173 /* XCRemoteSwiftPackageReference "Kingfisher" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/onevcat/Kingfisher";
requirement = {
kind = exactVersion;
version = 7.11.0;
version = 7.12.0;
};
};
4D2B057734A5412CF39C2B92 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/siteline/SwiftUI-Introspect";
requirement = {
kind = exactVersion;
version = 1.1.3;
version = 1.3.0;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
1 change: 1 addition & 0 deletions camera-guides-quickstart/CameraSwiftUI.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// highlight-import
import IMGLYCamera

// highlight-import
import SwiftUI

Expand Down
3 changes: 2 additions & 1 deletion camera-guides-quickstart/CameraUIKit.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// highlight-import
import IMGLYCamera

// highlight-import
import SwiftUI

Expand Down Expand Up @@ -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),
])
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ struct BasicEditorSolution: View {
// highlight-userID
userID: "<your unique user id>",
// 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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// highlight-import
import IMGLYDesignEditor
import IMGLYEngine

// highlight-import
import SwiftUI

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
1 change: 1 addition & 0 deletions editor-guides-quickstart/EditorSwiftUI.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// highlight-import
import IMGLYDesignEditor

// highlight-import
import SwiftUI

Expand Down
3 changes: 2 additions & 1 deletion editor-guides-quickstart/EditorUIKit.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// highlight-import
import IMGLYDesignEditor

// highlight-import
import SwiftUI

Expand Down Expand Up @@ -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),
])
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// highlight-import
import IMGLYApparelEditor

// highlight-import
import SwiftUI

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// highlight-import
import IMGLYDesignEditor

// highlight-import
import SwiftUI

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// highlight-import
import IMGLYEngine
import IMGLYPhotoEditor

// highlight-import
import SwiftUI

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// highlight-import
import IMGLYPostcardEditor

// highlight-import
import SwiftUI

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// highlight-import
import IMGLYVideoEditor

// highlight-import
import SwiftUI

Expand Down
6 changes: 3 additions & 3 deletions engine-guides-custom-asset-source/CustomAssetSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion engine-guides-exporting-blocks/ExportingBlocks.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")!
Expand Down
2 changes: 1 addition & 1 deletion engine-guides-load-scene-from-blob/LoadSceneFromBlob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions engine-guides-source-sets/SourceSets.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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(
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion engine-guides-store-metadata/StoreMetadata.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion engine-guides-text-properties/TextProperties.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 5 additions & 3 deletions integrate-with-appkit/IntegrateWithAppKit.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#if os(macOS)
import Cocoa

// highlight-import
import IMGLYEngine

// highlight-import
import MetalKit

Expand All @@ -28,15 +30,15 @@
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

view.addSubview(spinner)
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
Expand All @@ -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
}
Expand Down
1 change: 1 addition & 0 deletions integrate-with-swiftui/IntegrateWithSwiftUI.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// highlight-import
import IMGLYEngine

// highlight-import
import SwiftUI

Expand Down
7 changes: 4 additions & 3 deletions integrate-with-uikit/IntegrateWithUIKit.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#if os(iOS)
// highlight-import
import IMGLYEngine

// highlight-import
import MetalKit
import UIKit
Expand Down Expand Up @@ -41,15 +42,15 @@
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

view.addSubview(spinner)
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
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion showcases-app/View/Examples/CustomPhotoEditor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading

0 comments on commit 5d821ef

Please sign in to comment.