GithubHelp home page GithubHelp logo

skiptools / skip-foundation Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 4.0 1.22 MB

Foundation module for Skip apps.

Home Page: https://skip.tools

License: GNU Lesser General Public License v3.0

Swift 99.47% Kotlin 0.53%

skip-foundation's People

Contributors

aabewhite avatar iankoex avatar marcprux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

skip-foundation's Issues

Missing date(byAdding:value:to:wrappingComponents:)

Seems like this is missing?
Screenshot 2023-12-26 at 11 08 31

date(byAdding:value:to:wrappingComponents:)
Returns a new Date representing the date calculated by adding an amount of a specific component to a given date.
func date(
    byAdding component: [Calendar](doc://com.apple.documentation/documentation/foundation/calendar).[Component](doc://com.apple.documentation/documentation/foundation/calendar/component),
    value: [Int](doc://com.apple.documentation/documentation/swift/int),
    to date: [Date](doc://com.apple.documentation/documentation/foundation/date),
    wrappingComponents: [Bool](doc://com.apple.documentation/documentation/swift/bool) = false
) -> [Date](doc://com.apple.documentation/documentation/foundation/date)?
Parameters
component
A single component to add.
value
The value of the specified component to add.
date
The starting date.
wrappingComponents
If true, the component should be incremented and wrap around to zero/one on overflow, and should not cause higher components to be incremented. The default value is false.
Return Value
A new date, or nil if a date could not be calculated with the given input.

infoDictionary API Not Available

This API is not yet available in Skip. 
Consider placing it within a #if !SKIP block. 
You can file an issue against the owning library at https://github.com/skiptools, 
or see the library README for information on adding support

The infoDictionary deriving from the Main Bundle package in Swift's Foundational Package is not available in Skip Yet.

Code example:

        guard let currentAppVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String else {
            return false
        }

Unresolved reference: libs

Unresolved reference: libs

Getting this error, even if I create an entirely new project in terminal and try to build it

skip.lib.ErrorException:javax.net.ssl.SSLHandshakeExceptionChain validation failed

Hi , I encountered a problem for loading this url(https://www.inquirer.net/fullfeed) in Android. On iOS, it worked.
Both status response for android and iOS was status 200.
Android error was
skip.lib.ErrorException:javax.net.ssl.SSLHandshakeExceptionChain validation failed

I tried a different url and it worked for both android and iOS.

May I know what this error mean? Note that this error is only on Android Emulator. when I run on an android actual device, it worked

URLRequest.httpBody not working

(As reported by user on Gitter)

For URLRequest, this works on iOS:

var request = URLRequest(url: url)
request.httpMethod = requestMethod.rawValue
request.setValue(self.userAgent, forHTTPHeaderField: "User-Agent")
request.setValue("application/json", forHTTPHeaderField: "Accept")
if isLoggedIn {
    request.setValue(jwt, forHTTPHeaderField: "Authorization")
}
        
request.httpBody = httpBody
        
let (data, response) = try await URLSession.shared.data(for: request)

But on android the body isn't available when viewing the request using Network Inspector and when logging the error I get:

skip.lib.ErrorException: java.io.FileNotFoundException: https://myurl

Something wrong with date(byAdding:value:to:wrappingComponents:)

I got extensions

extension ClosedRange where Bound == Date {
    func span(calendar: Calendar, units: Set<Calendar.Component>) -> Int {
        let date1 = calendar.startOfDay(for: lowerBound)
        let date2 = calendar.startOfDay(for: upperBound) 
        let components = calendar.dateComponents(units, from: date1, to: date2)
        return components.day ?? 0
    }
    
    func toArray(calendar: Calendar) -> [Date] {
        let date1 = calendar.startOfDay(for: lowerBound)
        let date2 = calendar.startOfDay(for: upperBound)
        let components = calendar.dateComponents([Calendar.Component.day], from: date1, to: date2)
        let days = components.day ?? 0
        
        guard days > 0 else { return [date1] }
        
        var dates = [date1]
        for i in 1 ... days {
            // TODO: SKIP
            if let nextDate = calendar.date(byAdding: Calendar.Component.day, value: i, to: date1) {
                dates.append(nextDate)
            }
        }
        return dates
    }
}

which causes this

This API is not yet available in Skip. Consider filing an issue against the owning library at https://github.com/skiptools, or see the library README for information on adding support

However, other cases of calendar.date(byAdding accross the app do not cause this?

caused at line

if let nextDate = calendar.date(byAdding: Calendar.Component.day, value: i, to: date1) {
                dates.append(nextDate)
            }

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.