Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of edge insets for StepperView for positioning #82

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

badrinathvm
Copy link
Owner

@badrinathvm badrinathvm commented May 20, 2021

Description

Implementation of EdgeInsets for positioning the Stepper View according to the desired choice.

StepperView()
                       .edgeInsets(EdgeInsets(top: 2, leading: 5, bottom: 2, trailing: 5))

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • This change requires a documentation update

How Has This Been Tested

Please let us know if you have tested your PR and if we need to reproduce the issues. Also, please let us know if we need any relevant information for running the tests.

  • Unit Testing
  • UI Testing

Test Configuration

  • Xcode version:
  • Device/Simulator
  • iOS version
  • MacOSX version

Checklist:

For checklist items not applicable, mention NA in front of it with some comment if applicable.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • Add comments to code particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes before pushing the pull request

struct StepperEdgeInsetsKey: EnvironmentKey {
/// provide default values for Stepper Edge Insets
static var defaultValue: EdgeInsets =
EdgeInsets(top: Utils.standardSpacing, leading: Utils.standardSpacing, bottom: Utils.standardSpacing, trailing: Utils.standardSpacing)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may slightly change the default spacing, as if you just add .padding() it uses the system default (varies based on device type and other conditions). If we made stepperEdgeInsets be optional EdgeInsets? with a default value of nil then passing .padding(nil) will retain the current behavior.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am evaluating this default padding behaviour across all the watchOS, iOS and test it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants