Giter Site home page Giter Site logo

nilcoalescing / swiftui-code-examples Goto Github PK

View Code? Open in Web Editor NEW
243.0 243.0 40.0 117 KB

In this repository we are collecting our solutions to interesting SwiftUI problems that we encounter when developing our apps.

License: MIT License

Swift 100.00%

swiftui-code-examples's People

Contributors

hishnash avatar khalwat avatar nataliapanferova avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

swiftui-code-examples's Issues

BuildAndStyleAChartWithSwiftChartsFramework: Value of type 'some ChartContent' has no member 'blendMode'

I was trying to follow the article that includes the below line of code.
Seems that it doesn’t compile with Xcode 14b5 :(

I get:

Value of type 'some ChartContent' has no member 'blendMode'

I couldn’t find anything in the Xcode or iOS release notes about a change in this API.

Adding .scrollDismissesKeyboard(.interactively) results in weird TextField behavior

When you attach TextField to keyboard like that:


TextField is not interactively dismissed with keyboard (example of the issue on stack overflow: https://stackoverflow.com/questions/73770425/scrollview-scrolldismisseskeyboard-interactively-feels-weird).

Is there a way to achieve behavior like in iMessage with SwiftUI?

Some questions about the new Navigation APIs

How can I back support iOS 14, iOS 15 while preserve the new functionality introduced this year through the new APIs, I mean, Is these APIs back supported? OR they can only work on iOS 16?

Expandable-text-with-line-limit example bug

When I try to use viewThatFits as described in the Expandable-text-with-line-limit.swift example but with a LazyVStack shows the button incorrectly when scrolling up and down, copy and paste the following code to try it out:

struct ContentView: View {
    
    var items = ["this is test text",
                 
                 "this is test text this is test text",
                 
                 " this is test text this is test text this is test text",
                 
                 "this is test text this is test text this is test text this is test text",
                 
                 "this is test text this is test text this is test text this is test text this is test text",
                 
                 "this is test text this is test text this is test text this is test text this is test text this is test text",
                 
                 "this is a small text",
                 
                 "this is test text this is test text this is test text this is test text this is test text this is test text this is test text this is test text",
                 
                 "this is test text this is test text this is test text this is test text this is test text this is test text this is test text this is test text this is test text",
                 
                 "this is test text this is test text this is test text this is test text this is test text this is test text this is test text this is test text this is test text this is test text",
                 
                 "this is test text this is test text this is test text this is test text this is test text this is test text this is test text this is test text this is test text this is test text this is test text",
    ]
    
    var body: some View {
        ScrollView {
            LazyVStack(spacing: 0) {
                ForEach(items, id: \.self) { item in
                   ExpandableTextWithLineLimit(text: item, initialLineLimit: 2)
                        .padding()
                }
            }
        }
       
    }
}

However, this issue doesn't happen with a VStack, but I need to use LazyVStack to simulate async data rendering.

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.