Post

Replies

Boosts

Views

Activity

Make a WWDC CountDown
Here is code to make a simple Swift WWDC countdown:import Cocoa let today = Date() let startDate = "2020-06-22" let dateFormatter = DateFormatter()dateFormatter.dateFormat = "yyyy-MM-dd" let finalStartDate = dateFormatter.date(from: startDate)let components = Set<Calendar.Component>([.day, .hour]) print("WWDC20 Will Come on JUNE 22") let daysToDc = Calendar.current.dateComponents(components, from: finalStartDate!, to: today) let printableDays = Int(daysToDc.day!) let printableHours = Int(daysToDc.hour!) print(String(printableDays)+" days " + String(printableHours) + " hours till WWDC2020")
3
0
736
Jun ’20
Change text of label whenever UserDefaults key value changes
I have an app where there are 2 views, one with a UILabel and another with a UITextField. I would like it so the moment you are done editing the Text Field, the label changes to the TF's value. The text field stores its value in a UserDefaults and when my Label's View loads, it shows the value of the UD key on the label. Again, I would like it so the moment you are done editing the Text Field, the label changes to the TF's value. Below is my Label's View's Controller struct myStruct {     static var money = 0.00 } import UIKit class ViewController: UIViewController {     @IBOutlet weak var moneyLabel: UILabel!     override func viewDidLoad() {         super.viewDidLoad()         let ud = UserDefaults.standard         myStruct.money = ud.double(forKey: "Money")         moneyLabel.text = String(ud.double(forKey: "Money"))              } } My TextField's View's Controller import UIKit class AddMoneyViewController: UIViewController {          let userDefaults = UserDefaults.standard               @IBOutlet weak var TextField: UITextField!          override func viewDidLoad() {         super.viewDidLoad()                  }          @IBAction func TFEditingDidEnd(_ sender: Any) {         userDefaults.set(TextField.text, forKey: "Money")         let moneyAtPoint1 = userDefaults.double(forKey: "Money")         print(moneyAtPoint1)          }      }
2
0
3.7k
Jun ’20
Unable to submit build for testing!
Hi everyone! I am experiencing this issue: This build is using a beta version of Xcode and can’t be submitted. Make sure you’re using the latest version of Xcode or the latest seed release found in What’s New in App Store Connect. I have Xcode 12 beta on my Mac and have archived the app from there. I was able to submit the build for internal testing but it gives me the issue when I try to submit for external testing!
2
0
1.2k
Jul ’20
Undo Button
Hello! I am making a game where you can place blocks and I would like to have an undo button to delete the last placed block! How do I do this? My code is here: Please remove .LOG extension from the code ViewController.swift - https://developer.apple.com/forums/content/attachment/2fc14933-2e81-46a2-afc5-abb7fc74e086
0
0
285
Jul ’20
How to take ARKit Screenshots?
Hi Developers! I am going to submit my ARKit app for review on the App Store today, but I am having trouble with my screenshots. I have taken my 6.5 inch screenshots, my 5.8 inch screenshots, and all my iPad screenshots! The problem is: I don't have any 5.5 inch devices! The reason I cannot use simulators is because ARKit is not supported on the Simulator. Please help!
0
0
337
Jul ’20
A touchscreen Mac
Hi Devs! I think a touchscreen Mac is going to come out soon! Some Evidence: Apple Silicon - With Apple Silicon coming to Mac, Apple could include touch drivers for Mac Control Center - MacOS Big Sur probably has a Control Center so it is easier to change settings on touch Macs Mac Catalyst - The iPad is touchscreen, and Catalyst is all about iPad apps on Mac. Hints for a touch Mac
2
0
731
Jul ’20
Unable to run WidgetKit widget on device or Simulator! - Please Help
Hi Devs! I am trying to build a widget for my app MathFlash Fun - https://apps.apple.com/us/app/mathflash-fun/id1502858843, but I am unable to deploy the widget to my iPad and the Simulator! The lldb says dyld: symbol '_$s9WidgetKit22IntentTimelineProviderP11placeholder4with5EntryQzAA0dE7ContextV_tFTq' not found, expected in '/System/Library/Frameworks/WidgetKit.framework/WidgetKit', needed by '/private/var/containers/Bundle/Application/3CA7A491-1A1F-4975-A010-39F6964A9A9A/Math Flash.app/PlugIns/CanYouWorkNowWodgetExtension.appex/CanYouWorkNowWodgetExtension' (I accidentally named the widget Wodget!) Xcode also shows me a SIGABRT and shows a pop-up which says SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget 'com.duckida.CanYouWorkNow.CanYouWorkNowWodget' error: Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (com.duckida.CanYouWorkNow.CanYouWorkNowWodget)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (com.duckida.CanYouWorkNow.CanYouWorkNowWodget)}." UserInfo={NSLocalizedDescription=Failed to show Widget 'com.duckida.CanYouWorkNow.CanYouWorkNowWodget' error: Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (com.duckida.CanYouWorkNow.CanYouWorkNowWodget)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (com.duckida.CanYouWorkNow.CanYouWorkNowWodget)}., NSUnderlyingError=0x1014fb420 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (com.duckida.CanYouWorkNow.CanYouWorkNowWodget)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (com.duckida.CanYouWorkNow.CanYouWorkNowWodget)}}} Domain: DTXMessage Code: 1 Here are some details: My iPad, an iPad Air 2(A1566) is running iOS 14 public beta 4(118A5342e1) My Mac is a 2019 MacBook Air with macOS 10.15.4 My Mac has Xcode 12 beta 3! Please Help!
1
0
733
Aug ’20
Port UIKit App to SwiftUI
I have an app made in UIKit with a deployment target of 9.0 which I would like to apply SwiftUI to. I would like my app to use SwiftUI while still being compatible with iOS 9.0 and later. Does anyone know how to achieve this, because SwiftUI is only in iOS 13.0 or later
2
0
751
Aug ’20