Previously distributed through: Gumroad ($0+)
Automated and localized App Store Screenshots without leaving Xcode.
Blacksmith supports installation via Swift Package Manager. To install, add the package via this url:
https://github.com/chFlorian/Blacksmith
Blacksmith is used to automatically generated simple App Store screenshots for multiple localizations.
import Blacksmith
import XCTest
import SwiftUI
class ForgeUITests: XCTestCase {
func testScreenshot_AddElementToLayoutBuilder() throws {
let app = XCUIApplication()
app.launchArguments = ["-AppleLanguages", "(en)"]
app.launch()
let window = app.windows.firstMatch
window.outlines.buttons["🛠 Layout Builder"].click()
let addElementButton = window.toolbars.buttons["Add Element"]
addElementButton.click()
let screenshot = app.screenshot()
You can either use quickExportWithTitle directly on the XCUIScreenshot or follow step 6 and 7
let exportSize = ExportSize.mac
let capturingView = ScreenshotWithTitle(
title: "Create your own image layouts.",
image: screenshot.image,
background: .color(.blue),
exportSize: .mac
)
let url = FileManager.default.homeDirectoryForCurrentUser.appendingPathComponent("result.png")
exportMarketing(image: capturingView, toURL: url)
app.terminate()
}
}
import Blacksmith
import XCTest
import SwiftUI
class ForgeUITests: XCTestCase {
func testExample() throws {
let app = XCUIApplication()
app.launchArguments = ["-AppleLanguages", "(en)"]
app.launch()
let window = XCUIApplication().windows.firstMatch
window.outlines.buttons["🛠 Layout Builder"].click()
let addElementButton = window.toolbars.buttons["Add Element"]
addElementButton.click()
let screenshot = app.screenshot()
let exportSize = ExportSize.mac
let capturingView = ScreenshotWithTitle(
title: "Create your own image layouts.",
image: screenshot.image,
background: .color(.blue),
exportSize: .mac
)
let url = FileManager.default.homeDirectoryForCurrentUser.appendingPathComponent("result.png")
exportMarketing(image: capturingView, toURL: url)
app.terminate()
}
}