Giter VIP home page Giter VIP logo

Comments (6)

philium avatar philium commented on June 27, 2024 1

Alternatively, it could be simplified by taking a binding to the selected bookmark as an initializer parameter, giving the caller flexibility to do whatever they want when the selected bookmark is updated (onChange(of selectedBookmark) { … }). I think that would be better than taking a binding to a viewpoint.

from arcgis-maps-sdk-swift-toolkit.

dfeinzimer avatar dfeinzimer commented on June 27, 2024 1

Yes - I still think we should do it and I thought we had an issue for it but I'm not seeing it so I'll reopen and re-characterize this issue instead.

from arcgis-maps-sdk-swift-toolkit.

philium avatar philium commented on June 27, 2024 1

The selection parameter should be non-optional because those initializers should only be used with a selection binding. In my opinion, having four initializers isn't a big deal. Several SwiftUI views have much more than four initializers.

from arcgis-maps-sdk-swift-toolkit.

dfeinzimer avatar dfeinzimer commented on June 27, 2024

Closing; onSelectionChanged(perform:) is provided

from arcgis-maps-sdk-swift-toolkit.

philium avatar philium commented on June 27, 2024

@dfeinzimer Was there any consideration given to taking a binding to the selection? While there is the modifier that you pointed out, taking a binding to the selected bookmark would be simpler and more idiomatic in SwiftUI. Many SwiftUI-provided modifiers take a selection binding instead of providing a separate modifier to inform when the selection has changed.

from arcgis-maps-sdk-swift-toolkit.

dfeinzimer avatar dfeinzimer commented on June 27, 2024

Some additional API considerations:

The current initializers are:

init(isPresented: Binding<Bool>, bookmarks: [Bookmark], viewpoint: Binding<Viewpoint?>?)
&
init(isPresented: Binding<Bool>, bookmarks: [Bookmark], viewpoint: Binding<Viewpoint?>?)

Would we want to add 2 new initializers:
init(isPresented: Binding<Bool>, bookmarks: [Bookmark], selection: Binding<Bookmark?>?)
&
init(isPresented: Binding<Bool>, geoModel: GeoModel, selection: Binding<Bookmark?>?)

brining us to a total of 4? 4 seems like it would be a lot to me.

from arcgis-maps-sdk-swift-toolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.