Skip to content

CurrencyField #4

Description

@telcosolutions

Problem #3
There is a problem in format in the view.
Try this:
var body: some View {

	HStack{
		Spacer()

// CurrencyField("test", value: Binding(
// get: {amount.map { NSDecimalNumber(decimal: $0) }
// }, set: { number in amount = number?.decimalValue
// }))

		Text("Hello World")
		Spacer()
			Button(action: {
				if amount == nil { amount = 0.0}
				amount = Decimal(1) + amount!
			}, label: {
				HStack {
					Text("EXec")
						.font(.system(size: 30))
				}
			})
		Spacer()
	}

}

The 2 fields are equal distance from the edge and each other. Then comment out the Text field and uncomment the CurrencyField. The 2 fields are on the edge of the view.

George

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions