قالب وردپرس درنا توس
Home / IOS Development / Unable to access structure in a shared framework in the main application, not sure why: iOSProgramming

Unable to access structure in a shared framework in the main application, not sure why: iOSProgramming



I have a structure that is returned in an api call completion manager. All this code is in a shared framework that I import into my main app. I know the structure's host values ​​can be called by letting newName = someStruct.var, but for some reason, I don't seem to call the structure of the common framework.

Here is what I have in my common framework: [19659003] public structure WeatherBuilder {
var cityName: String?
var dateToday: Date?
was today's temperature, todayLowTemperature, windSpeed, windDegrees, cloudCoverage: Double?

Public init (cityName: String? = Null, dateTime: Date? = Zero, currentTemperature: Double? = Zero, in dayLogTemperature: Double? = Zero, windSpeed: Double? = Zero, windDegrees: Double? = Zero, cloudCoverage: Double? = zero) {
self.cityName = cityName
self.dateToday = dateToday
self.currentTemperature = currentTemperature
self.todayLowTemperature = todayLowTemperature
self.windSpeed ​​= windSpeed
self.windDegrees = windDegrees
self.cloudCoverage = cloudCoverage
}
}

When this was in my main app, I can call it with

  was mainAppWeatherBuilder = MainAppWeatherBuilder ()
la city = mainAppWeatherBuilder.cityName

but after importing the common framework, I can't call it the same way. When I try as was weatherBuilder = WeatherBuilder () and let autocomplete work, weatherBuilder did not offer weatherBuilder.self the individual's. Can anyone help me understand what's going on?


Source link