-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Separate ClockIndex and HourMark * Remove useless resultbuilder * Refactor 1. rename non mutate function with Swift API design guideline 2. make some foreground support gradient color * support preview on different platform * Support preview on different platform * Add placeholder for tvOS preview * update preview * update reference to avoid redirect to insecurity website * Add RingStack to layout any view circular * publish RingStack * public init * bug fix * Adjust argument order in init function * Fix visibility issue * Fix visibility issue * Complete knob adjustable option * update swift and platform version * update preview * Improve RingStack animation * [Refactor] Wrap RingStack to provide rotation ability on its subview * Solve version issue * Solve os version issue * Apply direction setting on RingStack * Implement ArcStack Also fix RingStack visibility issue on preview * Fix os compatible issue * Fix os compatible issue * Extract common function 1. Alignment/Anchor mapping 2. CGPoint offset * Refactor Simplify anchor calculation * Adjust preview * Refactor Simplify direction enum * Add preview gif * Use RingStackDirection to instead of TextDirection and ArcStackDirection * [Refactor] move Text Extension to Common * Refactor 1. Rename RingStackDirection to RingLayoutDirection -- to make the naming more general 2. Extract RingLayoutDirection to independent file 3. Re-defining those directions to follow consistent rule. 4. Refine CGPoint offset function to support generic type * Extract variadic related function to target Common * Renaming and adjust comment * update github action to specify swift version * workaround to pass git hub action * Remove github action Reason: The GitHub host does not include the macOS 14.* * Remove useless function and init argument * refactor to provide clues of crashes * Add trace code * update arugment * Fix potential crash issue * Adjust documents structure * Adjust dooc content * Update documents structure * Update document on github * Update HandAiguille.md Fix path * Update resource path * Update image resource * Update framework icon * update ReadMe.md * Update resource path in readme * Add deprecated flags * Feature/gauge meter (#44) * Add offset and radius to AngularLayer To support more type of layers. add offset and radius to help implementation to design it's appeareance * [Bug fix] Image Knob degrees not work * [Refactor] Create CustomViewLayer to instead of ImageKnobLayer * Add GaugeMeter * solve macOS compatible issue on preview * Fix gradient offset issue * add convenience function to setup gradient * Add SemiCircleGaugeMeter as a convenience gauge meter * Separate mark size from arc width * Adjust value mark appearance * Add inset support * To support new Gauge style after ios 16 * [Refactor] 1. Rename properties 2. Add some document * update platform condition * [Refactor] Extract picker extension * Documents Archimedean Spiral Text * Document ArcStack * Refactor and document * Document ring gauge meter style * Update documents * Update readme * Update docs
- Loading branch information
1 parent
bfbaab9
commit bfea622
Showing
33 changed files
with
1,240 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// | ||
// PickerExt.swift | ||
// | ||
// | ||
// Created by Chen Hai Teng on 2/13/24. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public struct SegmentedPicker: ViewModifier { | ||
public func body(content: Content) -> some View { | ||
#if os(watchOS) | ||
content | ||
#else | ||
content.pickerStyle(SegmentedPickerStyle()).padding(EdgeInsets(top: 0, leading: 0, bottom: 0, trailing: 7)) | ||
#endif | ||
} | ||
} | ||
|
||
public struct ColoredPicker: ViewModifier { | ||
@Binding var selection: Color | ||
public func body(content: Content) -> some View { | ||
#if os(macOS) || os(iOS) | ||
if #available(macOS 11.0, iOS 14.0, macCatalyst 14.0, *) { | ||
ColorPicker("", selection: _selection) | ||
} else { | ||
content.modifier(SegmentedPicker()) | ||
} | ||
#else | ||
content.modifier(SegmentedPicker()) | ||
#endif | ||
} | ||
} | ||
|
||
public extension Picker { | ||
func segmented() -> some View { | ||
modifier(SegmentedPicker()) | ||
} | ||
|
||
func colorPicker(_ selection: Binding<Color>) -> some View { | ||
modifier(ColoredPicker(selection: selection)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.