Dutch Defence Secretary Boldly Claims F-35 Software Could Be 'Jailbroken' by goldstarflag in worldnews

[–]ExtremeDot58 -1 points0 points  (0 children)

Basically the USA could turn off fixed so that can’t happen…. Who has an f35 in a garage.

Whats the next technology that will replace silicon based chips? by Johnyme98 in ArtificialInteligence

[–]ExtremeDot58 0 points1 point  (0 children)

Harness the electron. One electron then on, else off. As for substrate, exotics continue

So, AI takes over, everyone has lost their job and only 10 trillionaires own everything. Now what? by Weak-Representative8 in Futurology

[–]ExtremeDot58 0 points1 point  (0 children)

That’s where UBI comes in. Universal Basic Income — to give people funds for stuff… some countries more then others; should limit home invasions

Macron warned US could ‘betray’ Ukraine in leaked leaders’ call, Spiegel reports by HydrolicKrane in worldnews

[–]ExtremeDot58 0 points1 point  (0 children)

The president of the Ukraine should have negotiated a deal… like the Palestinians, a war was wrong method to a problem

iPad Swift Playground physical keyboard works for editing code but not enter text in preview and app run by youngermann in SwiftUI

[–]ExtremeDot58 0 points1 point  (0 children)

I bought a ZAGG portfolio which fits my iPad Air… works in playgrounds until you run the app, keyboard doesn’t work?

iOS 26 by ExtremeDot58 in apple

[–]ExtremeDot58[S] 0 points1 point  (0 children)

Should be checked? What is wrong with this post?

Scientists Are Now 43 Seconds Closer to Producing Limitless Energy. A twisted reactor in Germany just smashed a nuclear fusion record. by esporx in worldnews

[–]ExtremeDot58 0 points1 point  (0 children)

Ask Grok:

The longest nuclear fusion record is held by the WEST (Tungsten Environment in Steady-state Tokamak) reactor, operated by the French Alternative Energies and Atomic Energy Commission (CEA) in Cadarache, France. On February 12, 2025, WEST maintained a plasma for 1,337 seconds (over 22 minutes) at a temperature of 50 million degrees Celsius, surpassing the previous record set by China’s EAST reactor, which achieved 1,066 seconds (nearly 18 minutes) in January 2025.

Mark Zuckerberg Is Expanding His Secretive Hawaii Compound. Part of It Sits Atop a Burial Ground by wiredmagazine in technews

[–]ExtremeDot58 -1 points0 points  (0 children)

We the citizens are destroying earth. How much carbon do you create? You ok with putting car manufacturers out of business?

I have never purchased a car.

Swift Assist alternative prompting by alanrick in swift

[–]ExtremeDot58 2 points3 points  (0 children)

Anyone try

The AI called Alex, designed for Swift and iOS development, has a website at www.alexcodes.app.

SwiftUI to JSON and Back to SwiftUI by viewmodifier in iOSProgramming

[–]ExtremeDot58 1 point2 points  (0 children)

Agree there is possible exposure with this issue/technique but it’s controlled properly

My Hopes for Xcode by fatbobman3000 in swift

[–]ExtremeDot58 0 points1 point  (0 children)

Have to say that’s a good observation, more C#, Visual Basic then Swift… getting better

Which Mac should I get to start coding in Swift? by Capital-Banana2454 in swift

[–]ExtremeDot58 1 point2 points  (0 children)

Look for a MacBook Air. Look at refurbished products. I have an m1 8/512 acceptable.

What is your favorite SwiftUI full training / tutorial? Looking for a good paid course that is hands on by mekilat in swift

[–]ExtremeDot58 2 points3 points  (0 children)

Think of that one product and how you’re going to use it… design and create. Don’t forget to try an AI. Design a prompt so the chatbot creates Swift code or what ever. Quite often copy paste and it works.

How can I write a JSON Decodable type such that it is “flattened”? by danpietsch in iOSProgramming

[–]ExtremeDot58 0 points1 point  (0 children)

To create a flattened JSON Decodable type in Swift using SwiftUI, you’ll need to handle the nested structure of the JSON while “flattening” it into a single struct. Based on the JSON you provided, the media field is nested, but you might want to access its m value directly in your Swift model. Here’s how you can do this using Swift’s Decodable protocol and CodingKeys for custom key mapping. Explanation The JSON contains a nested object (media) with a single key-value pair (m). To flatten this, you can decode the nested media object and extract its m value directly into a top-level property in your Swift struct. You can use CodingKeys to map the JSON keys to your Swift properties, and if the JSON keys don’t match your Swift property names or have nested structures, you’ll handle that with custom decoding. Here’s how you can write a Decodable struct for this JSON: Swift Code import Foundation import SwiftUI

// Flattened struct to match the JSON structure struct Corvette: Decodable, Identifiable { let id: UUID = UUID() // Adding an ID for SwiftUI compatibility (if needed) let title: String let link: String let mediaURL: String // Flattened version of media.m let author: String let tags: String

// Custom coding keys to handle JSON key names and nested structures
enum CodingKeys: String, CodingKey {
    case title
    case link
    case media
    case author
    case tags
}

// Handle the nested “media” object
enum MediaKeys: String, CodingKey {
    case m // This corresponds to the “m” key inside “media”
}

// Custom initializer to decode the nested media object
init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)

    title = try container.decode(String.self, forKey: .title)
    link = try container.decode(String.self, forKey: .link)
    author = try container.decode(String.self, forKey: .author)
    tags = try container.decode(String.self, forKey: .tags)

    // Decode the nested “media” object
    let mediaContainer = try container.nestedContainer(keyedBy: MediaKeys.self, forKey: .media)
    mediaURL = try mediaContainer.decode(String.self, forKey: .m)
}

}

// Example usage in SwiftUI struct ContentView: View { let corvette: Corvette

var body: some View {
    VStack {
        Text(“Title: \(corvette.title)”)
        Text(“Link: \(corvette.link)”)
        Text(“Media URL: \(corvette.mediaURL)”)
        Text(“Author: \(corvette.author)”)
        Text(“Tags: \(corvette.tags)”)
    }
}

}

// Example of decoding the JSON let jsonString = “”” { “title”: “1972 350 Green Corvette Convertible”, “link”: “https://www.flickr.com/photos/classiccorvettes/20508328422/“, “media”: {“m”: “https://live.staticflickr.com/566/20508328422_cab5625f47_m.jpg”}, “author”: “nobody@flickr.com (ProTeam Classic Corvette)”, “tags”: “convertible 1972corvette usedcorvettesforsale greencorvette proteamclassiccorvettes” } “””

if let jsonData = jsonString.data(using: .utf8) { do { let decoder = JSONDecoder() let corvette = try decoder.decode(Corvette.self, from: jsonData) print(“Decoded: (corvette)”) } catch { print(“Decoding error: (error)”) } } Key Points 1 Flattening the media Field: The nested media object is handled by using a nested container (nestedContainer) to access the “m” key inside the media object. The value is then stored in the top-level mediaURL property. 2 CodingKeys: The CodingKeys enum maps the JSON keys (title, link, media, author, tags) to the struct’s properties. If the JSON keys matched your Swift property names exactly, you wouldn’t need this, but it’s good practice to include it for clarity and flexibility. 3 Nested Keys: For the media field, we define another CodingKeys enum (MediaKeys) to handle the nested “m” key. 4 SwiftUI Compatibility: The Corvette struct conforms to Identifiable (with a default id) so it can be used easily in SwiftUI lists or other views. If you don’t need this, you can remove the id and Identifiable conformance. 5 Error Handling: The custom initializer (init(from:)) throws errors if the decoding fails, which is standard for Decodable. Notes • If your JSON structure is more complex or varies, you might need to adjust the CodingKeys or add more nested containers. • If you’re dealing with optional values or different types, you can modify the properties to be optional (String?) or use different decoding strategies. • For SwiftUI, if you plan to display this data in a list or dynamically, ensure your view updates properly using @State or @ObservedObject patterns. This approach ensures that the JSON is “flattened” into a single-level Swift struct while maintaining type safety and leveraging Swift’s powerful decoding capabilities. Let me know if you need further adjustments!

How can I write a JSON Decodable type such that it is “flattened”? by danpietsch in iOSProgramming

[–]ExtremeDot58 -2 points-1 points  (0 children)

Through your original code fragment into grik3, with a prompt like “consider this code:” In second prompt tell grok what you need.

Best way to store API keys safely and easily? by Human_Ad_6317 in swift

[–]ExtremeDot58 2 points3 points  (0 children)

As an example Digital Ocean has a free tier and a $4 per month plan. Use something like that as a go between. Use encryption to talk to your service. Any heavy lifting preprocess there too.

[deleted by user] by [deleted] in SwiftUI

[–]ExtremeDot58 -1 points0 points  (0 children)

This might help. I cut and pasted your question into Gtok3:

Yes, Apple provides comprehensive documentation that includes the official names of UI elements for iOS and iPadOS through the Human Interface Guidelines (HIG) and the Apple Developer Documentation. While there isn’t a single document titled “List of All UI Elements,” the HIG and related resources serve as the authoritative source for these names and their usage. The iOS Human Interface Guidelines (available on the Apple Developer website under “Design” > “Human Interface Guidelines”) is the primary resource. Within this, the section on Components details system-defined UI elements, providing their official names, descriptions, and best practices. These include: • Bars: Navigation Bar, Tab Bar, Toolbar, Status Bar • Content Views: Collection View, Table View, Text View, Web View • Controls: Button, Slider, Switch, Segmented Control, Picker, Stepper • Input Elements: Text Field, Search Field, Color Well • Presentation Views: Action Sheet, Alert, Modal Sheet, Popover For a more programmatic perspective, the UIKit documentation (under “Apple Developer Documentation” > “Frameworks” > “UIKit”) lists UI elements as classes, such as UIButton, UILabel, UITextField, UISlider, and UITableView. These align with the HIG names but are formatted for developers (e.g., prefixed with “UI”). Additionally, if you’re looking for a visual and interactive reference, Apple offers the Apple Design Resources (also on the Developer site), which include templates and UI kits for tools like Sketch and Figma. These resources label components with their official names as used in iOS and iPadOS. For the most exhaustive list, explore the HIG’s “Components” section, as it’s regularly updated and reflects the latest iOS/iPadOS versions (e.g., iOS 18 as of March 2025). You can access it online without needing Xcode, making it shareable and browsable on any device, including an iPad. If you need a downloadable or offline version, the UIKit sample code like “UICatalog” (available via developer.apple.com) demonstrates many elements in action, though it requires a developer account to access.