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

Add object support in ToggleGen #39

Conversation

ashalva
Copy link
Contributor

@ashalva ashalva commented Feb 19, 2024

I have finalised object support in Toggles. Now it's time to add object support in ToggleGen.

  • Added Object and ObjectSupportedType in ToggleGen package.
  • Executed ToggleGen script to generate new object properties.
  • Updated demo app to demonstrate object observable functionality.
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-02-19.at.11.11.38.mp4

get { manager.value(for: ToggleVariables.numericToggle2).numberValue! }
set { manager.set(.number(newValue), for: ToggleVariables.numericToggle2) }
}

public var userDefinedStringToggle: String {
public var stringToggle2: String {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Script automatically changed property names. Not sure why that happened, I guess it was outdated file? @albertodebortoli

Copy link
Member

Choose a reason for hiding this comment

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

I noticed that too when running it locally yesterday. Yes, I think it was outdated.

import Foundation

public struct ToggleVariables {
public enum ToggleVariables {
Copy link
Member

Choose a reason for hiding this comment

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

yep, definitely outdated

@@ -20,7 +20,7 @@ public struct Object {

/// Object description represented as plain json string.
/// Returns nil if object cant be represented as json string.
var description: String? {
public var description: String? {
Copy link
Member

Choose a reason for hiding this comment

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

I remember efforts to keep this non-public but I guess it's ok (you've used it in the demo app).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, thats the thing. I could not find any better way to beutify object's presentation. I was using objectValue.map.description but it was showing types as well

image

Copy link
Member

@albertodebortoli albertodebortoli left a comment

Choose a reason for hiding this comment

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

Looking good! Approved and thanks.

This view is not showing too well aligned now

image

if it's not too much bother cold you take a look? Ok if not. Instead of having an HStack w/ 2 VStacks, 1 VStack with multiple HStacks should do.

@ashalva
Copy link
Contributor Author

ashalva commented Feb 19, 2024

Nice catch @albertodebortoli, updated

@albertodebortoli albertodebortoli merged commit 18b7d30 into TogglesPlatform:main Feb 19, 2024
5 checks passed
@albertodebortoli albertodebortoli added this to the 0.11.0 milestone Feb 26, 2024
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.

3 participants