Home Blog Page 2

ios – Why is my xcode construct engaged on an actual machine, however crashing on a simulator?


I’m making an attempt to check a function that requires me to simulate my location, which isn’t attainable on an actual machine so far as I do know. This is the reason I now have to construct my app that has been working for a lot of weeks and a whole lot of builds on my actual machine, on a simulator. Nevertheless, as quickly as I begin the app within the simulator (or it will get began by xCode), the app crashes with this log:

*** Terminating app as a consequence of uncaught exception 'NSInvalidArgumentException', cause: 'Couldn't discover a storyboard named 'Predominant' in bundle NSBundle  (loaded)'
*** First throw name stack:
(
    0   CoreFoundation                      0x000000010a3677d4 __exceptionPreprocess + 172
    1   libobjc.A.dylib                     0x000000010681b7cc objc_exception_throw + 72
    2   UIKitCore                           0x0000000145d7f1f0 -[UIStoryboard name] + 0
    3   UIKitCore                           0x0000000145bd6810 -[UIApplication _storyboardInitialMenu] + 112
    4   UIKitCore                           0x0000000145bf3544 -[UIApplication buildMenuWithBuilder:] + 44
    5   UIKitCore                           0x00000001460f2cec -[UIMenuSystem _buildMenuWithBuilder:fromResponderChain:atLocation:inCoordinateSpace:] + 92
    6   UIKitCore                           0x000000014501b900 -[_UIMainMenuSystem _buildMenuWithBuilder:fromResponderChain:atLocation:inCoordinateSpace:] + 112
    7   UIKitCore                           0x00000001460f2c2c -[UIMenuSystem _newBuilderFromResponderChain:atLocation:inCoordinateSpace:] + 96
    8   UIKitCore                           0x000000014501b7d4 -[_UIMainMenuSystem _automaticallyRebuildIfNeeded] + 172
    9   UIKitCore                           0x000000014501b80c -[_UIMainMenuSystem _keyCommands] + 20
    10  UIKitCore                           0x0000000145beeeec -[UIApplication _keyCommands] + 80
    11  UIKitCore                           0x0000000145bffab0 -[UIResponder _enumerateKeyCommandsInChainWithOptions:usingBlock:] + 436
    12  UIKitCore                           0x0000000145beeb74 -[UIApplication _immediatelyUpdateSerializableKeyCommandsForResponder:] + 164
    13  UIKitCore                           0x00000001460eb9a8 -[_UIAfterCACommitBlock run] + 64
    14  UIKitCore                           0x00000001460ebdbc -[_UIAfterCACommitQueue flush] + 164
    15  UIKitCore                           0x0000000145bdf54c _runAfterCACommitDeferredBlocks + 256
    16  UIKitCore                           0x0000000145bd1028 _cleanUpAfterCAFlushAndRunDeferredBlocks + 76
    17  CoreFoundation                      0x000000010a2c7134 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 20
    18  CoreFoundation                      0x000000010a2c6898 __CFRunLoopDoBlocks + 348
    19  CoreFoundation                      0x000000010a2c1450 __CFRunLoopRun + 808
    20  CoreFoundation                      0x000000010a2c0cec CFRunLoopRunSpecific + 536
    21  GraphicsServices                    0x000000011f51ad00 GSEventRunModal + 164
    22  UIKitCore                           0x0000000145bd27d4 -[UIApplication _run] + 796
    23  UIKitCore                           0x0000000145bd6ba0 UIApplicationMain + 124
    24  UIKitCore                           0x0000000144f9cf1c block_destroy_helper.14 + 9560
    25  [...].debug.dylib                    0x0000000107067cdc $sSo21UIApplicationDelegateP5UIKitE4mainyyFZ + 128
    26  [...].debug.dylib                    0x0000000107067c4c $s4[...]11AppDelegateC5$mainyyFZ + 44
    27  [...].debug.dylib                    0x0000000107067d58 __debug_main_executable_dylib_entry_point + 28
    28  dyld                                0x00000001046113d4 start_sim + 20
    29  ???                                 0x000000010470ab98 0x0 + 4369460120
)
libc++abi: terminating as a consequence of uncaught exception of sort NSException
*** Terminating app as a consequence of uncaught exception 'NSInvalidArgumentException', cause: 'Couldn't discover a storyboard named 'Predominant' in bundle NSBundle  (loaded)'
terminating as a consequence of uncaught exception of sort NSException
CoreSimulator 1010.15 - System: iPhone 16 Professional (7F88C881-9905-4665-AC11-282A5171CCAC) - Runtime: iOS 18.5 (22F77) - DeviceType: iPhone 16 Professional

It appears to crash as a result of my app is in search of a storyboard file, which I’ve faraway from day one, as a result of I’m doing every thing programatically.

Steps I’ve completed:

  1. Take away the reference to storyboard in Launch Display. -> Was already empty
  2. Examine for any reference to “Predominant” or Storyboard in my data.plist -> Nothing
  3. Checked if the deployment goal was set to common or something aside from iPhone -> Was already the case.

I do not know what else I can examine. AI is telling me that it could be a dependency that’s making an attempt to reference Storyboard. In that case, how do I discover out which one it’s?

RxJS with Ben Lesh – Software program Engineering Every day


RxJS is an open-source library for composing asynchronous and event-based applications. It supplies highly effective operators for remodeling, filtering, combining, and managing streams of knowledge, from person enter and internet requests to real-time updates.

Ben Lesh is the creator of RxJS. He joins Josh Goldberg to speak about his path into engineering and the RxJS library.

Josh Goldberg is an unbiased full time open supply developer within the TypeScript ecosystem. He works on tasks that assist builders write higher TypeScript extra simply, most notably on typescript-eslint: the tooling that allows ESLint and Prettier to run on TypeScript code. Josh recurrently contributes to open supply tasks within the ecosystem resembling ESLint and TypeScript. Josh is a Microsoft MVP for developer applied sciences and the writer of the acclaimed Studying TypeScript (O’Reilly), a cherished useful resource for any developer looking for to study TypeScript with none prior expertise exterior of JavaScript. Josh recurrently presents talks and workshops at bootcamps, conferences, and meetups to share data on TypeScript, static evaluation, open supply, and basic frontend and internet improvement.

Please click on right here to see the transcript of this episode.

Sponsors

APIs are the inspiration of dependable AI – and dependable APIs begin with Postman. Trusted by 98% of the Fortune 500, Postman is the platform that helps over 40 million builders construct and scale the APIs behind their most important enterprise workflows.

With Postman, groups get centralized entry to the most recent LLMs and APIs, MCP assist, and no-code workflows, multi function platform. Rapidly combine vital instruments and construct multi-step brokers with out writing a single line of code.

Begin constructing smarter, extra dependable brokers right this moment. Go to postman.com/sed to study extra.

Misplaced, Discovered, and Flourishing: My Journey with Cisco


This submit was authored by Chirag Garg, a latest Software program Engineering Intern who nearly didn’t apply — however ended up discovering his confidence, group, and profession path at Cisco.

Man standing in front of Silver Cisco sign.Man standing in front of Silver Cisco sign.

Again in 2023, I used to be doing what most engineering college students do — making use of for internships, taking on-line assessments, and refreshing my inbox prefer it was my job. At first, I felt fairly assured. I had tasks beneath my belt, I’d labored laborious, and I believed I used to be prepared.

However then … the rejections began piling up.

One after one other.

It was discouraging, actually. I began questioning if I used to be actually minimize out for tech. Possibly I didn’t have “it.” Possibly I used to be simply one other résumé in an enormous pile. I bear in mind staring on the Cisco internship utility and pondering, “There’s no approach I’ll get in.”

However in some way, I satisfied myself to simply click on submit.

That One Sure

When the choice checklist got here out, I didn’t even anticipate to see my identify, however there it was.

I used to be going to intern at Cisco.

That second shifted one thing in me. I felt like possibly, simply possibly, I belonged. I began brushing up on my expertise, revisiting fundamentals, diving into AI and methods — attempting to be as prepared as doable.

Then got here Might 2024, and my summer season internship at Cisco started.

Why Cisco Felt Completely different — and Why That Mattered

From the very first day, I knew Cisco was totally different. It wasn’t nearly work. It was about folks.

I met a crew that didn’t anticipate me to have all of the solutions. They didn’t make me really feel like I needed to show myself each second. As a substitute, they gave me one thing I didn’t even know I wanted — area — area to study, area to ask questions (even the foolish ones), area to develop with out concern of failing.

There have been so many little issues that made a big impact, too. Like how somebody would all the time drop a studying useful resource simply once I was caught, or how informal tea breaks become deep discussions about profession objectives, and the way nobody made me really feel “like simply an intern.”

We performed video games collectively, had random rant classes (sure, these assist), and shared laughs over issues that had nothing to do with code. It felt human. And for somebody who felt misplaced simply months earlier, that meant all the pieces.

The Ripple Impact

That summer season at Cisco didn’t simply impression my LinkedIn — it modified how I noticed myself.

I began taking part extra in faculty actions. I took on management roles. I turned the AI Lead for the Affiliation for Computing Equipment (ACM CSS) chapter at my faculty, gained a hackathon, and ultimately, bought a letter for a spring internship and a full-time supply from Cisco.

That one sure modified all the pieces. Cisco didn’t simply give me a stepping stone — it gave me a springboard. The truth that I may come again for one more internship after which transfer right into a full-time function confirmed me that at Cisco, progress isn’t simply inspired — it’s doable. You don’t have to decide on one path. You’re given the liberty to discover the place you wish to go, trusted to tackle new challenges, and given the assist to truly get there.

Beginning the intern journey once more in spring felt acquainted — however in the easiest way. I wasn’t the identical individual I used to be a yr in the past. And Cisco wasn’t only a firm anymore — it felt like a spot I belonged.

#LoveWhereYouWork — And Being Trusted to Do It

As a Software program Engineering Intern, I get to work on the intersection of methods and AI — two evolving areas that genuinely problem and excite me. However actually? The perfect half isn’t simply the work. It’s how I’m trusted to do the work. I’ve had the liberty to make choices, the possibility to study from errors, and the assist to ask, “Why not do this?”

That type of tradition? It’s uncommon.

To Anybody Who’s Nonetheless Figuring It Out …

For those who’re the place I used to be — observing job boards, feeling such as you’re falling behind, doubting your self — I wish to say this: don’t surrender on your self.

Apply for that function even in the event you don’t really feel “prepared.” Ask questions even in the event you assume they’re fundamental. Take that probability, even in the event you assume you gained’t make it.

As a result of generally, all it takes is one sure.

Cisco was my sure.  And in saying sure to me, they helped me say sure to myself.

Are you able to sure to a brand new alternative? Take a look at our careers right here!

Subscribe to the WeAreCisco Weblog and by no means miss a narrative!

Share:

ios – Maintain two view positions synchronized throughout animation


I’ve a questions on syncing view positions throughout an animation change.

This is the model I am aiming for, however discover when the keyboard seems, the view top modifications instantly with no animation.

working version no animations on shrinking list view height

This model is what I presently have, with the animation when view top shrinks, however discover on the swipe down there’s a noticeable hole between the date header and the highest of the checklist view. Type of seems damaged.

broken animation on swipe

This is the code:

                        .onReceive(keyboardHeightPublisher.removeDuplicates()) { top in
                        withAnimation {
                            let unadjustedKeyboardHeight = self.keyboardUnadjustedHeight - top
                            self.keyboardAdjustedListHeight = unadjustedKeyboardHeight
                        } completion: {
                            change (self.modalState) {
                            case .didShow:
                                self.modalState = .didShow
                            default:
                                break
                            }
                        }
                    }

So the self.keyboardAdjustedListHeight is connected to to the checklist view:

.body(top: self.keyboardAdjustedListHeight)
                    .place(CGPoint(x: (geometry.dimension.width / 2), y: (self.gesturePosition.y + (self.dateHeaderRect.top / 2)) + (self.keyboardAdjustedListHeight / 2)))

Your entire modal is is simply

ZStack 
  - VStack (date header)
       - drag gesture
  - VStack (checklist view)
       - positioned underneath the date header primarily based on drag gesture place.

I attempted matchedGeometryEffect however that did not do the trick.

Any clues?

EDIT: I am aiming to get the second GIF (animated checklist view) however the one drawback is the hole upon dragging down.

SOLUTION:
Used a variation of @Benzy Neez’s answer right here.

enter image description here

This was the supposed impact. Principally an animation of the checklist view shrinking however no separation of the date header from the checklist view on down drag.
This code is beneath the checklist view VStack.
So nonetheless:

ZStack 
    VStack (date view)
        (drag gesture updates place)
    VStack (checklist view)
        (updates place primarily based on drag gesture)

            .animation(.easeInOut, worth: self.animateShrinkModal)
                    .toolbar(content material: {
                        ToolbarItem(placement: .keyboard) {
                            EmptyView()
                        }
                    })
                    .onReceive(keyboardHeightPublisher.removeDuplicates()) { top in
                        let unadjustedKeyboardHeight = self.keyboardUnadjustedHeight - top
                        self.keyboardAdjustedListHeight = unadjustedKeyboardHeight
                        
                        if top > .zero {
                            self.animateShrinkModal.toggle()
                        }
                        
                        change (self.modalState) {
                        case .didShow:
                            self.modalState = .didShow
                        default:
                            break
                        }
                    }

As you’ll be able to see I solely set off the animation when the keyboard top shouldn’t be zero. The modal top is reset with out an animation proper after the keyboard top is zero which is properly after the drag ends. Even dragging slowly towards the keyboard has the specified impact.

Utilizing Software Calling to Supercharge Basis Fashions


Within the earlier tutorials, we explored how Basis Fashions work in iOS 26 and how one can begin constructing AI-powered options utilizing this new framework. We additionally launched the @Generable macro, which makes it straightforward to transform generated responses into structured Swift varieties.

Now, in Half 3 of the Basis Fashions sequence, we’ll dive into one other highly effective functionality: Software Calling — a characteristic that lets the mannequin work together along with your app’s features to carry out duties, retrieve information, or set off actions based mostly on person enter.

The on-device language mannequin isn’t able to answering each sort of query, particularly people who require real-time information, like the present climate or the newest inventory costs. In different circumstances, you may want the mannequin to entry your app’s personal information to reply precisely. That’s the place Software Calling is available in that it permits the mannequin to delegate particular duties to your app’s features or exterior APIs.

On this tutorial, we’ll prolong the Ask Me Something app. Whereas the on-device mannequin can deal with normal queries, it doesn’t have entry to up-to-date details about trending motion pictures. To bridge that hole, we’ll use Software Calling to combine with the The Film Database (TMDB) API, enabling the mannequin to reply to movie-related questions utilizing reside information.

tool-calling-trending-movies-demo.png

Utilizing TMDB APIs

In case you ask the Ask Me Something app about trending motion pictures, the on-device language mannequin received’t have the reply—it merely doesn’t have entry to that form of real-time data and should recommend checking different sources as a substitute. Let’s repair that utilizing Software Calling and the TMDB API. With this setup, each time a person asks a movie-related query, the mannequin received’t reply with “I don’t know.” As an alternative, it is going to robotically name the exterior API and return the related data instantly within the app.

Within the Xcode venture, create a MovieService file and insert the next code:

// Mannequin for a Film
struct Film: Codable, Identifiable {
    let id: Int
    let title: String
    let overview: String
    
    // Coding keys to match API response
    enum CodingKeys: String, CodingKey {
        case id
        case title
        case overview
    }
}

// Mannequin for the API response
struct TrendingMoviesResponse: Codable {
    let outcomes: [Movie]
}

// Service class to fetch trending motion pictures
class MovieService {
    // Base URL for TMDB API
    personal let baseURL = "https://api.themoviedb.org/3"
    
    personal let apiKey = ""
    
    // Operate to fetch trending motion pictures utilizing async/await
    func fetchTrendingMovies() async throws -> [Movie] {
        
        // Assemble the URL for trending motion pictures
        let urlString = "(baseURL)/trending/film/day?api_key=(apiKey)"
        guard let url = URL(string: urlString) else {
            throw URLError(.badURL)
        }
        
        // Carry out the community request
        let (information, response) = strive await URLSession.shared.information(from: url)
        
        // Verify for legitimate HTTP response
        guard let httpResponse = response as? HTTPURLResponse,
              (200...299).comprises(httpResponse.statusCode) else {
            throw URLError(.badServerResponse)
        }
        
        // Decode the JSON response
        let decoder = JSONDecoder()
        let trendingResponse = strive decoder.decode(TrendingMoviesResponse.self, from: information)
        return trendingResponse.outcomes
    }
}

Ensure you exchange the worth of apiKey with your personal TMDB API key. In case you haven’t signed up but, head over to themoviedb.org and register for a free account to get your API key.

The code above is pretty simple: it calls the net API to fetch trending motion pictures, then parses the response and decodes it into an array of Film objects.

Subsequent, we’ll use Software Calling to set off the code in MovieService each time the person asks about trending motion pictures. To get began, create a brand new file named GetTrendingMoviesTool.swift and add the next code:

import FoundationModels

struct GetTrendingMoviesTool: Software {
    let title = "getTrendingMovies"
    let description = "Get trending motion pictures and their data"
    
    let service = MovieService()

    @Generable
    struct Arguments {
        
    }
    
    func name(arguments: Arguments) async throws -> [String] {
        let motion pictures = strive await service.fetchTrendingMovies()
       
        let formattedMovies = motion pictures.map { film in
            "(film.title): (film.overview)"
        }
        
        return formattedMovies
    }
}

We outline a GetTrendingMovieTool struct that conforms to the Software protocol — that is the usual option to implement Software Calling within the Basis Fashions framework. The protocol requires you to specify a title and description for the instrument, together with an Arguments struct to symbolize any parameters the instrument would possibly want. On this case, we don’t require extra enter, so we outline an empty Arguments construction.

In case you needed to filter trending motion pictures by style, you could possibly outline Arguments like this:

@Generable
struct Arguments {
		@Information(description: "The style to fetch trending motion pictures")
		var style: String
}

When the instrument is triggered by the mannequin, the name methodology is robotically executed. Inside it, we name the fetchTrendingMovies() methodology from our service. After receiving the outcomes, we format them to show every film’s title and overview.

With the trending film instrument in place, integrating it into your app is easy. Merely open ContentView and replace the LanguageModelSession initialization as follows:

@State personal var session = LanguageModelSession(instruments: [GetTrendingMoviesTool()])

You may present customized instruments by passing them by way of the instruments parameter when initializing the language mannequin session. That’s it! The language mannequin will robotically invoke GetTrendingMoviesTool each time it detects a query associated to trending motion pictures.

Construct and run the app, then strive asking the identical query once more. This time, the mannequin will efficiently reply with trending film data by invoking the instrument.

tool-calling-trending-movies-ans.png

Abstract

On this tutorial, we explored instrument calling, a strong addition to the Basis Fashions framework in iOS 26. In contrast to fundamental textual content technology, instrument calling permits the on-device language mannequin to work together along with your app’s features or entry exterior companies.

With instrument calling, you possibly can considerably prolong the mannequin’s capabilities. Whether or not it’s operating customized logic or fetching real-time information by way of APIs, the mannequin can now carry out context-aware duties past its built-in information.

I hope you’ve loved this tutorial sequence and really feel impressed to begin constructing smarter, AI-powered options utilizing the Basis Fashions framework.