Post

Replies

Boosts

Views

Activity

Reply to Can’t view Storyboard and swift code on the same screen
set the screen to show the storyboard on the left and the swift code on the right A simple way to do it: open storyboard then option-click on a swift file you want to show. it will display the file on the right. You can also click on the icon at the top right which says "add editor" and then select the file to display in.                                        _________ Note : icon looks like   |__|__+__|                                         You can also use menus to open a new panel: File New Editor or, if you want to open the new panel below, File New Editor Below For the error message, you probably have a bad connection between an object in IB and its IBOutlet. You should disconnect and reconnect.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to Workflow for designing animations.
some workflow for designing elements and animation Your request is pretty vague. workflow, do you mean code logic ? what types of elements do you want to add ? For what type of animation. The logic is simple the logic for building views in Interface Builder (IB) for UIKit. Create a view insert objects inside connect objects to an IBOutlet do animation on IBOutlet in code. So please explain better what you want and the problems you have. Logic is different for SwiftUI. Look for SwiftUI tutorial on Apple's site. Or look here: https: //www.raywenderlich. com/5815412-getting-started-with-swiftui-animations or here: https ://www.hackingwithswift. com/quick-start/swiftui/how-to-create-an-explicit-animation
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to SwiftUI: Menu() doesn't work
I do see the message also, but that does not seem to cause any issue (except the extra log). It may be a debug message in Xcode that was not cleared ? Get some details here: https://stackoverflow.com/questions/64732778/creating-menu-in-swiftui-receive-output-message-of-uilog-called-uicontextm
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to App store release crashing
Could you instrument code to see what you get: let task = URLSession.shared.dataTask(with: request) { data, response, error in print("response", response, type(of: response) if let httpStatus = response as? HTTPURLResponse { print("status", httpStatus.statusCode) } if let httpStatus = response as? HTTPURLResponse, httpStatus.statusCode == 200 {
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to [UI Sketch] Tables with icons
Could you show what you have tried so far ? Is it a standard cell (Title / subtitle…) ? You can simply add this in cellForRowAt func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) - UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "CellItem", for: indexPath)         // initialise what needs to be         // either set your own image (must be the right size to fit ; of course, you should select image for each indexPath, for instance by storing image names in an array and select the right element cell.imageView?.image = UIImage(named: "Some image.png")         or use systemName image if #available(iOS 13.0, *) { cell.imageView?.image = UIImage(systemName: "sunrise") // Just an example             cell.imageView?.tintColor = .systemRed // If you want to set a specific color } else { // Fallback on earlier versions }
Topic: UI Frameworks SubTopic: UIKit Tags:
Mar ’21
Reply to How to get control from a combo box selection?
You can create an IBAction @IBAction func comboAction(_ sender: NSComboBox) { print("Combo selected", sender.selectedTag(), sender.selectedCell()?.title) } And connect it to the NSComboBox sentAction in IB / Connections Inspector You can also: declare that the class conforms to NSComboBoxDelegate create an IBOutlet for the comboBox (not the BoxCell) @IBOutlet weak var itemComboBox: NSComboBox!  set its delegate in viewDidLoad         itemComboBox.delegate = self Then call any of the delegate func: func comboBoxSelectionIsChanging(_ notification: Notification) { print("Selection is changing", notification) } func comboBoxSelectionDidChange(_ notification: Notification) { print("Selection has changed", notification) }
Topic: UI Frameworks SubTopic: AppKit Tags:
Mar ’21
Reply to Splash Screen Stuck on IOS 14.4+
(Android is fine) That's not a guarantee for anything ! Have you an image on the splashScreen ? How large is it ? If several Mbytes, try reduce its size below 1 MB, or even remove, just to see. Do you access any data for the splash screen from the cloud ? If so, try to save these data locally (image specifically).
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to Storyboard Issue (Urgent)
First, to avoid additional issues: save a copy of the complete project (the whole folder) Now to your problem. Hard to tell with so little information. It would be useful to tell what you have done. You had an old version. How old was it (the one you see now) Do you still have this complete project saved ? When did you do some change ? To the storyboard. What did you change ? Are they important changes ? Do you remember some specific object in the new version ? If so, you could search with Spotlight if you can find it. You could also search for Main.storyboard and see if you can locate something useful. Did you relaunch Xcode and open the project ? You could also open the storyboard in XML format to see if you find some corrupted data. At the end, if nothing work: save a copy of the complete project (the whole folder) try to recreate the storyboard changes.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to Do not repeat question, removeAtIndex
Or you can remove the question from gameModels. Another way would be to add a property to Question struct: struct Question {     // What you had so far     var answered = false } Then you could show the answered questions as dimmed text. When selecting a question, toggle answered to true. And add a test to check if question is answered. Please, don't forget to close the thread once done.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to How can I draw something outside the NSSlider in NSSliderCell?
I did this, with a slider named sliderWithTicks.cell sliderWithTicks.cell?.controlView?.wantsLayer = true sliderWithTicks.cell?.controlView?.layer?.masksToBounds = false sliderWithTicks.cell?.controlView?.layer?.backgroundColor = CGColor(red: 1.0, green: 0.0, blue: 0.0, alpha: 0.5) let text = NSTextField(string: " 1 2 3 4") text.frame = NSRect(x: 0, y: -16, width: 100, height: 24) text.drawsBackground = false text.isBezeled = false text.isEditable = false sliderWithTicks.cell?.controlView?.addSubview(text)
Topic: UI Frameworks SubTopic: AppKit Tags:
Mar ’21
Reply to setAlternateIconName with nothing changed
I assume you speak of completion handler. Could you show the code for: setAlternateIconName(…) call the alert Did you test for errorCode ? the alert show me that it changes the icon successfully Which alert are you speaking about ? Doc says there is no need to dispatch to main queue: completionHandler A handler to be executed with the results. After attempting to change your app's icon, the system reports the results by calling your handler. (The handler is executed on a UIKit-provided queue, and not necessarily on your app's main queue.) The handler has no return value and takes the following parameter: Check also the notice: Discussion Use this method to change your app's icon to its primary icon or to one of its alternate icons. You can change the icon only if the value of the supportsAlternateIcons property is true. You must declare your app's primary and alternate icons using the CFBundleIcons key of your app's Info.plist file. For information about how to configure alternate icons for your app, see the description of the CFBundleIcons key in Information Property List Key Reference.
Topic: UI Frameworks SubTopic: UIKit Tags:
Mar ’21
Reply to Populate one column based on values of other column in a NSTableView
Here is how I would do: You have a dataSource for the table, which is a 2 dimensional array. Right ? array[column][row] Then the second column array[1] should be computed based on the values of first column array[0] So, when you change an item in column 0, recompute column 1 and ask for reloading with func reloadData(forRowIndexes rowIndexes: IndexSet, columnIndexes: IndexSet)
Topic: UI Frameworks SubTopic: AppKit Tags:
Mar ’21