Skip to content

Commit

Permalink
Merge pull request #1 from bullinnyc/add-support-macOS-tvOS-watchOS-v…
Browse files Browse the repository at this point in the history
…isionOS

Add support mac os tv os watch os vision os
  • Loading branch information
bullinnyc committed Jun 12, 2024
2 parents 7d69507 + ccc619b commit 5444e89
Show file tree
Hide file tree
Showing 24 changed files with 926 additions and 497 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build and test

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build_and_test:
name: ${{ matrix.command }} on  ${{ matrix.platform }} (xcode ${{ matrix.xcode }}, ${{ matrix.macos }})
runs-on: ${{ matrix.macos }}
strategy:
fail-fast: false
matrix:
xcode: ['15.0.1']
macos: ['macos-13']
scheme: ['MagicText']
command: ['test']
platform: ['iOS', 'macOS', 'tvOS', 'watchOS']
steps:
- name: Switch xcode to ${{ matrix.xcode }}
uses: maxim-lobanov/setup-xcode@v1.6.0
with:
xcode-version: ${{ matrix.xcode }}
- name: Double-check macOS version (${{ matrix.macos }})
run: sw_vers
- name: Code Checkout
uses: actions/checkout@v3
- name: Check xcodebuild version
run: xcodebuild -version
- name: Check xcode embedded SDKs
run: xcodebuild -showsdks
- name: Show buildable schemes
run: xcodebuild -list
- name: Show eligible build destinations for ${{ matrix.scheme }}
run: xcodebuild -showdestinations -scheme ${{ matrix.scheme }}
- uses: mxcl/xcodebuild@v2.0.0
with:
platform: ${{ matrix.platform }}
scheme: ${{ matrix.scheme }}
action: ${{ matrix.command }}
code-coverage: true
verbosity: xcpretty
upload-logs: always
24 changes: 24 additions & 0 deletions .swiftpm/MagicText.xctestplan
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"configurations" : [
{
"id" : "276FEBCA-28BB-4ABB-B9B6-426F493EA1F8",
"name" : "Test Scheme Action",
"options" : {

}
}
],
"defaultOptions" : {
"codeCoverage" : false
},
"testTargets" : [
{
"target" : {
"containerPath" : "container:",
"identifier" : "MagicTextTests",
"name" : "MagicTextTests"
}
}
],
"version" : 1
}
72 changes: 72 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/MagicText.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1540"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MagicText"
BuildableName = "MagicText"
BlueprintName = "MagicText"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:.swiftpm/MagicText.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MagicText"
BuildableName = "MagicText"
BlueprintName = "MagicText"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
16 changes: 7 additions & 9 deletions Examples/ExampleArtLetterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// Copyright © 2023 Dmitry Kononchuk. All rights reserved.
//

#if os(iOS)
import SwiftUI
import MagicText

Expand All @@ -27,30 +26,30 @@ struct ExampleArtLetterView: View {
RM.night, RM.sky, RM.smoke, RM.theia, RM.venus
]

// MARK: - Body Property
// MARK: - Body

var body: some View {
VStack(spacing: 25) {
// Art letter magic text.
MagicView(
MagicTextView(
text: singleLineExampleText,
textColors: [.black.opacity(0.7)],
textColors: [RM.yinYang.color.opacity(0.8)],
fontSize: 28,
magicType: .artLetter
) {
print("Animation finished")
print("Animation finished.")
}
.padding(.bottom)

// Art letter magic text with different colors.
MagicView(
MagicTextView(
text: multiLineExampleText,
textColors: colors.map { Color($0) },
textColors: colors.map { $0.color },
fontSize: 28,
magicType: .artLetter,
delayStart: 5
) {
print("Animation finished")
print("Animation finished.")
}
}
}
Expand All @@ -63,4 +62,3 @@ struct ExampleArtLetterView_Previews: PreviewProvider {
ExampleArtLetterView()
}
}
#endif
16 changes: 7 additions & 9 deletions Examples/ExampleBubbleView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// Copyright © 2023 Dmitry Kononchuk. All rights reserved.
//

#if os(iOS)
import SwiftUI
import MagicText

Expand All @@ -27,30 +26,30 @@ struct ExampleBubbleView: View {
RM.night, RM.sky, RM.smoke, RM.theia, RM.venus
]

// MARK: - Body Property
// MARK: - Body

var body: some View {
VStack(spacing: 25) {
// Bubble magic text.
MagicView(
MagicTextView(
text: singleLineExampleText,
textColors: [.black.opacity(0.7)],
textColors: [RM.yinYang.color.opacity(0.8)],
fontSize: 28,
magicType: .bubble
) {
print("Animation finished")
print("Animation finished.")
}
.padding(.bottom)

// Bubble magic text with different colors.
MagicView(
MagicTextView(
text: multiLineExampleText,
textColors: colors.map { Color($0) },
textColors: colors.map { $0.color },
fontSize: 28,
magicType: .bubble,
delayStart: 5
) {
print("Animation finished")
print("Animation finished.")
}
}
}
Expand All @@ -63,4 +62,3 @@ struct ExampleBubbleView_Previews: PreviewProvider {
ExampleBubbleView()
}
}
#endif
21 changes: 7 additions & 14 deletions Examples/ExampleCharmedLetterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// Copyright © 2023 Dmitry Kononchuk. All rights reserved.
//

#if os(iOS)
import SwiftUI
import MagicText

Expand All @@ -22,35 +21,30 @@ struct ExampleCharmedLetterView: View {
gonna get.
"""

private let colors = [
RM.candy, RM.coffee, RM.flower, RM.forest, RM.newyork,
RM.night, RM.sky, RM.smoke, RM.theia, RM.venus
]

// MARK: - Body Property
// MARK: - Body

var body: some View {
VStack(spacing: 25) {
// Charmed letter magic text.
MagicView(
MagicTextView(
text: singleLineExampleText,
textColors: [.black.opacity(0.7)],
textColors: [RM.yinYang.color.opacity(0.8)],
fontSize: 28,
magicType: .charmedLetter()
) {
print("Animation finished")
print("Animation finished.")
}
.padding(.bottom)

// Charmed letter magic text with different colors.
MagicView(
MagicTextView(
text: multiLineExampleText,
textColors: colors.map { Color($0) },
textColors: [RM.yinYang.color.opacity(0.8)],
fontSize: 28,
magicType: .charmedLetter(backgroundColor: .blue),
delayStart: 5
) {
print("Animation finished")
print("Animation finished.")
}
}
}
Expand All @@ -63,4 +57,3 @@ struct ExampleCharmedLetterView_Previews: PreviewProvider {
ExampleCharmedLetterView()
}
}
#endif
15 changes: 7 additions & 8 deletions Examples/ExampleCharmedView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
// Copyright © 2023 Dmitry Kononchuk. All rights reserved.
//

#if os(iOS)
import SwiftUI
import MagicText

Expand All @@ -27,36 +26,36 @@ struct ExampleCharmedView: View {
RM.night, RM.sky, RM.smoke, RM.theia, RM.venus
]

// MARK: - Body Property
// MARK: - Body

var body: some View {
VStack(spacing: 25) {
// Charmed magic text (default).
MagicView(
MagicTextView(
text: singleLineExampleText,
fontSize: 28
) {
print("Animation finished")
print("Animation finished.")
}
.padding(.bottom)

// Charmed magic text with different colors.
MagicView(
MagicTextView(
text: multiLineExampleText,
textColors: [.black, .red, .orange, .yellow, .green, .blue],
textColors: colors.map { $0.color },
fontSize: 28,
delayStart: 5
) {
print("Animation finished")
print("Animation finished.")
}
}
}
}

// MARK: - Preview Provider

struct ExampleCharmedView_Previews: PreviewProvider {
static var previews: some View {
ExampleCharmedView()
}
}
#endif
Loading

0 comments on commit 5444e89

Please sign in to comment.