-
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.
Summary: Update experiment/test - `swift-programmatic-modal/AdaptiveModal`.
- Loading branch information
1 parent
9ce06dd
commit 325cb81
Showing
7 changed files
with
148 additions
and
34 deletions.
There are no files selected for viewing
18 changes: 0 additions & 18 deletions
18
experiments/swift-programmatic-modal/AdaptiveModal/AdaptiveModalEntranceConfig.swift
This file was deleted.
Oops, something went wrong.
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
88 changes: 88 additions & 0 deletions
88
experiments/swift-programmatic-modal/RNILayout/RNILayoutValue+StaticInit.swift
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,88 @@ | ||
// | ||
// RNILayoutValue+StaticInit.swift | ||
// swift-programmatic-modal | ||
// | ||
// Created by Dominic Go on 6/19/23. | ||
// | ||
|
||
import UIKit | ||
|
||
extension RNILayoutValue { | ||
|
||
static let stretch: Self = .init(mode: .stretch); | ||
|
||
static func stretch( | ||
offsetValue: RNILayoutValueMode? = nil, | ||
offsetOperation: RNIComputableOffset.OffsetOperation? = nil, | ||
minValue: RNILayoutValueMode? = nil, | ||
maxValue: RNILayoutValueMode? = nil | ||
) -> Self { | ||
|
||
return .init( | ||
mode:. stretch, | ||
offsetValue: offsetValue, | ||
offsetOperation: offsetOperation, | ||
minValue: minValue, | ||
maxValue: maxValue | ||
); | ||
}; | ||
|
||
static func constant(_ constantValue: CGFloat) -> Self { | ||
return .init(mode: .constant(constantValue)) | ||
}; | ||
|
||
static func percent( | ||
relativeTo: RNILayoutValuePercentTarget = .targetSize, | ||
percentValue: Double, | ||
offsetValue: RNILayoutValueMode? = nil, | ||
offsetOperation: RNIComputableOffset.OffsetOperation? = nil, | ||
minValue: RNILayoutValueMode? = nil, | ||
maxValue: RNILayoutValueMode? = nil | ||
) -> Self { | ||
|
||
return .init( | ||
mode: .percent( | ||
relativeTo: relativeTo, | ||
percentValue: percentValue | ||
), | ||
offsetValue: offsetValue, | ||
offsetOperation: offsetOperation, | ||
minValue: minValue, | ||
maxValue: maxValue | ||
); | ||
}; | ||
|
||
static func safeAreaInsets( | ||
insetKey: KeyPath<UIEdgeInsets, CGFloat>, | ||
offsetValue: RNILayoutValueMode? = nil, | ||
offsetOperation: RNIComputableOffset.OffsetOperation? = nil, | ||
minValue: RNILayoutValueMode? = nil, | ||
maxValue: RNILayoutValueMode? = nil | ||
) -> Self { | ||
|
||
return .init( | ||
mode: .safeAreaInsets(insetKey: insetKey), | ||
offsetValue: offsetValue, | ||
offsetOperation: offsetOperation, | ||
minValue: minValue, | ||
maxValue: maxValue | ||
); | ||
}; | ||
|
||
static func multipleValues( | ||
_ values: [RNILayoutValueMode], | ||
offsetValue: RNILayoutValueMode? = nil, | ||
offsetOperation: RNIComputableOffset.OffsetOperation? = nil, | ||
minValue: RNILayoutValueMode? = nil, | ||
maxValue: RNILayoutValueMode? = nil | ||
) -> Self { | ||
|
||
return .init( | ||
mode: .multipleValues(values), | ||
offsetValue: offsetValue, | ||
offsetOperation: offsetOperation, | ||
minValue: minValue, | ||
maxValue: maxValue | ||
); | ||
}; | ||
}; |
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
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