Post

Replies

Boosts

Views

Activity

Reply to Learning Swift
What is it you want to know ? There are a lot of articles on the web is you search Understanding iOS Architecture. Surch as: https:// medium. com/@lucideus/understanding-the-structure-of-an-ios-application-a3144f1140d4 Or this tutorial: https:// www.raywenderlich. com/477-design-patterns-on-ios-using-swift-part-1-2 https:// www.raywenderlich. com/476-design-patterns-on-ios-using-swift-part-2-2 Or the Stanford course for iOS which is excellent. But the best way to learn by doing: imagine a simple application of your own, even if it is not targetting the AppStore, and start design it. You will understand how all pieces join together or at least clarify the questions you may have. The example may be anything: related to your pets, to your hobbies, to the books you read…
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’21
Reply to I have found NullIsland - Simulator
Did you see this explanation ? https://stackoverflow.com/questions/64952663/strange-nullisland-warning-from-coremotion-framework Apparently this error message is logged if property location of a CLLocationManager is read, before the CLLocationManager delivered the very first location.
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’21
Reply to URL scheme in Info.plist
So, the url does not work when directly entered in Safari ? Did you try with h t t p s instead of h t t p Could you show the first part of URL, with the beginning of the payload (not the complete one) ? Could you show also how you create and use the URL ? There is probably an issue in the url itself ; may be need to escape some characters ? The length should not be the problem: https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’21
Reply to Cannot use instance member 'name' within property initializer; property initializers run before 'self' is available
In fact the message is pretty explicit. You try to use self (by using its name property) before self is fully initialised (use is not yet defined). That's a classical catch 22 situation in init. Unfortunately, you cannot declare use as lazy because it is an observedValue. But this should work struct OtherView: View { @State private var name: String = "" @ObservedObject var use : Use = Use(name: "") init() { use = Use(name: name) } var body: some View{ VStack{ } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’21
Reply to Uppgradera Swiftkod
I translate because I do not master swedish well enough… The code was built in 2015 on Mac IOS El Capitan. When I want to see the app on an external iPhone I get the following message "No provisioned iOS device are available with a compatible iOS version. Connect an iOS device with a recent enough version of iOS to run your application or choose an iOS simulator as the destination" . I only have an iPhone 5 and the app does not work there. Nor on any of the proposed simulators. This ***** that the app is "Succeeded" uploaded. Maybe it's a bug in the code. Can I buy your help with checking the code. I forgot how I made the code - but I need to use the app. Which iOS version on iPhone 5 ? How do you install the app on the device ? From Xcode by building the app ? Have you the full code of the app ? Is it Swift or objC code ? If you post an email for contact, I propose you to send me the full project. And I'll have a look, at least on simulators. Vilken iOS-version på iPhone 5? Hur installerar du appen på enheten? Från Xcode genom att bygga appen? Har du appens fullständiga kod? Är det Swift- eller objC-kod? Om du skickar ett e-postmeddelande för kontakt föreslår jag att du skickar mig hela projektet. Och jag tittar, åtminstone på simulatorer.
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’21
Reply to Could not dequeue a view of kind:
It would be much easier if we could get the whole code of the class… But error: reason __NSCFString * "could not dequeue a view of kind: UICollectionElementKindCell with identifier restaurantCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard" 0x00006000037a09c0 tells that : you have created a nib file for the cell (.xib): exact ? if so, you need to register the cell nib file, with code like (assuming the cell file is "restaurantCell.xib" and that restaurantCell class has the same name restaurantCell : let nib = UINib(nibName: veHeaderCell, bundle: nil) collectionView.register(nib, forCellReuseIdentifier: "restaurantCell") // I don't know who is the collectionView If the cell is defined directly in the CollectionView in Storyboard, as Custom cell, then you need to connect the cell to its class definition.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’21
Reply to unrecognized selector sent to instance 0x144b071
We do not see the error, but I understand that's the thread title… Most usual cause is that one of the IBOutlets are not connected to their object in storyboard. = Check all connections (specially yourAge) = if appears OK, do an option-clean build folder If not enough, remove the connection of yourAge (in Storyboard, right click on the textField and click the small x in the "Referenced Outlet section". And reconnect. Another possible cause depending on the error you get: @IBAction func savePersonalInfo(_ sender: Any) { userWeight = Double(yourWeight.text!) userAge = Double(yourAge.text!) } It is risky to force unwrap. yourWeight.text may be nil. And you get an optional, not a Double. And sender is a button ? It is better to have UIButton and not Any as argument. To change, you have to disconnect the IBAction first, then change Any to UIButton then reconnect IBAction. Are you sure age should be a Double, not an Int ? More robust code: @IBAction func savePersonalInfo(_ sender: UIButton) { userWeight = Double(yourWeight.text ?? "0.0") ?? 0.0 userAge = Double(yourAge.text ?? "0.0") ?? 0.0 }
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’21
Reply to migrate swift version 3 to 4
Probably because the project doesn't match the criteria for conversion. Are you sure it is not already a Swift 4 project ? Do you see some messages in the Issue Navigator (left panel), such as: Swift Conversion Group Conversion to Swift 5 is available Validate Project Settings Group xxxxxxxApp.xcodeproj Update to recommended settings If so, use those to update.
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’21