Post not yet marked as solved
I have a UITextView and a UITextField. I would like to select a range of text in the text view and then edit the text in the text field, which will perform some action on the selected text from the text view. Is there a way to edit the text field without losing the selected text in the text view?
Post not yet marked as solved
I have a custom textField's input view - it is a Numpad style keyboard. Numpad is using to add numbers and math symbols to a textField.
I can't figure out how can I change a math symbol in a string if user already add one and wants to change it on another straight away. Here is an example of what I need: https://i.stack.imgur.com/IVGId.gif
Here is the code I use:
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
//number formatter
let formatter = NumberFormatter()
formatter.numberStyle = .decimal
formatter.maximumFractionDigits = 2
formatter.locale = .current
formatter.roundingMode = .down
//all possible math operation symbols user can add
let symbolsSet = Set(["+","-","x","/"])
var amountOfSymbols = 0
let numberString = textField.text ?? ""
guard let range = Range(range, in: numberString) else { return false }
let updatedString = numberString.replacingCharacters(in: range, with: string)
let correctDecimalString = updatedString.replacingOccurrences(of: formatter.groupingSeparator, with: "")
let completeString = correctDecimalString.replacingOccurrences(of: formatter.decimalSeparator, with: ".")
//current math symbol user add
let symbol = symbolsSet.filter(completeString.contains).last ?? ""
//if user add math symbol to an empty string - do not insert
if string == symbol, numberString.count == 0 { return false }
//count how much math symbols string has. If more that one - do not insert, string can have only one
completeString.forEach { character in
if symbolsSet.contains(String(character)) {
amountOfSymbols += 1
}
}
if amountOfSymbols > 1 { return false }
//count how much decimals string has. If more that one - do not insert because it can have only one per number
let numbersArray = completeString.components(separatedBy: symbol)
for number in numbersArray {
let amountOfDecimalSigns = number.filter({$0 == "."}).count
if amountOfDecimalSigns > 1 { return false }
}
//create numbers from a string
guard let firstNumber = Double(String(numbersArray.first ?? "0")) else { return true }
guard let secondNumber = Double(String(numbersArray.last ?? "0")) else { return true }
//format numbers and turn them back to string
let firstFormattedNumber = formatter.string(for: firstNumber) ?? ""
let secondFormattedNumber = formatter.string(for: secondNumber) ?? ""
//assign formatted numbers to a textField
textField.text = completeString.contains(symbol) ? "\(firstFormattedNumber)\(symbol)\(secondFormattedNumber)" : "\(firstFormattedNumber)"
return string == formatter.decimalSeparator
}
The logic for me was to use textField.deleteBackwards() method to delete an old one and add a new math symbol after, but with above code it doesn't work: it deletes symbol, but a new one doesn't appear - I should press again so new symbol can appear.
What should I do to change a math symbol in a string?
Test project on GitHub
Post not yet marked as solved
Hello, I am trying to evaluate data in MLMultiArrays. Is there an easy way to calculate the mean and standard deviation of the values within an MLMultiArray?
Post not yet marked as solved
I'm trying to implement the Neural Style Transfer model by https://arxiv.org/pdf/1610.07629.pdf in an iOS app. The paper uses this conditional instance norm layer to allow a single model to learn multiple styles and also combine the styles.
Here is my code for it in Python:
class ConditionalInstanceNorm(tf.keras.layers.Layer):
def __init__(self, scope_bn, y1, y2, alpha):
super(ConditionalInstanceNorm, self).__init__()
self.scope_bn = scope_bn
self.y1 = y1
self.y2 = y2
self.alpha = alpha
def build(self, input_shape):
self.beta = self.add_weight(name="beta"+self.scope_bn, shape=(self.y1.shape[-1], input_shape[-1]), initializer=betaInitializer, trainable=True)
self.gamma = self.add_weight(name="gamma"+self.scope_bn, shape=(self.y1.shape[-1], input_shape[-1]), initializer=gammaInitializer, trainable=True)
def call(self, inputs):
mean, var = tf.nn.moments(x=inputs, axes=[1,2], keepdims=True)
beta1 = tf.matmul(self.y1, self.beta)
gamma1 = tf.matmul(self.y1, self.gamma)
beta2 = tf.matmul(self.y2, self.beta)
gamma2 = tf.matmul(self.y2, self.gamma)
beta = self.alpha*beta1 + (1. - self.alpha)*beta2
gamma = self.alpha*gamma1 + (1. - self.alpha)*gamma2
x = tf.nn.batch_normalization(x=inputs, mean=mean, variance=var, offset=beta, scale=gamma, variance_epsilon=1e-10)
return x
It requires me to pass in 3 hyper-parameters: y1, y2, and alpha. Each style has a unique y value (y1 and y2 are the different styles to allow combining of styles). Alpha determines the strength of influence of each style.
In python, the way I switch between different combinations of styles is by accessing each layer, identify the conditional instance norm layers then change the y1, y2, and alpha values stored:
for layer in filter(lambda x: "conditional_instance_norm" in x.name, model.layers):
layer.y1 = y1
layer.y1 = y2
layer.alpha = alpha
How can I do this with a .tflite model in swift? Right now I can run the model but it is stuck with the y1, y2, and alpha values it was initialised with.
I'm trying to format numbers in a UITextField consists of math equation String: "number + number".
At the moment I can type just a single number, then convert it to Double -> format with NSNumberFormatter -> convert back to String -> assign to textField.text: https://i.stack.imgur.com/4qQza.gif
The code:
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
let formatter = NumberFormatter()
formatter.numberStyle = .decimal
formatter.maximumFractionDigits = 2
formatter.locale = .current
formatter.roundingMode = .down
let numberString = textField.text ?? ""
guard let range = Range(range, in: numberString) else { return false }
let updatedString = numberString.replacingCharacters(in: range, with: string)
let correctDecimalString = updatedString.replacingOccurrences(of: formatter.decimalSeparator, with: ".")
let completeString = correctDecimalString.replacingOccurrences(of: formatter.groupingSeparator, with: "")
guard let value = Double(completeString) else { return false }
let formattedNumber = formatter.string(for: value)
textField.text = formattedNumber
return string == formatter.decimalSeparator
}
Now I want to add a calculation functionality and display a simple math equation in a textField as "number + number", but each number should be formatted as shown on above screenshot. Example (but without formatting): https://i.stack.imgur.com/W7Jet.gif
I can't properly implement that. The logic for me was: track the String each time new char inserts -> if it has math sign extract numbers -> convert them to Double -> format with NSNumberFormatter -> convert back to String -> construct a new String "number + number".
The code I tried:
if let firstString = completeString.split(separator: "+").first, let secondString = completeString.split(separator: "+").last {
guard let firstValue = Double(firstString) else { return false }
guard let secondValue = Double(secondString) else { return false }
let firstFormattedNumber = formatter.string(for: firstValue)
let secondFormattedNumber = formatter.string(for: secondValue)
textField.text = "\(firstFormattedNumber ?? "") + \(secondFormattedNumber ?? "")"
// another try
if completeString.contains("+") {
let stringArray = completeString.components(separatedBy: "+")
for character in stringArray {
print(character)
guard let value = Double(character) else { return false }
guard let formattedNumber = formatter.string(for: value) else { return false }
textField.text = "\(formattedNumber) + "
}
}
But it's not working properly. I tried to search but didn't find any similar questions.
Test project on GitHub
How can I format the numbers from such a string?
Post not yet marked as solved
Hi! I am trying to make a maze game, and right now I am simply working on generating the maze. I have code that randomizes the contents of an array called "right". This array has enough members to fill what the maze size is, but when I run my code, the views don't update, the ForEach function seems to make it so it cannot read data from my DataBase. Please help me?
import SwiftUI
struct ContentView: View {
@StateObject var data: DataBase
@StateObject var trafficControl: TrafficControl
var body: some View {
ZStack{
Group{
LazyVStack{
ForEach(1...data.size, id: \.self) { index in
LazyHStack {
ForEach(1...data.size, id: \.self) { box in
Rectangle().fill(Color.gray).frame(width: 90, height: 90, alignment: .center).scaledToFill().padding(-4)
}
}
}
}
LazyVStack{
ForEach(1...(data.size), id: \.self) { index in
LazyHStack {
ForEach(1...(data.size + 1), id: \.self) { box in
if data.**** == 1 {
Rectangle().fill(Color.gray).frame(width: 6, height: 90, alignment: .center).scaledToFill().padding(.trailing, 38).padding(.leading, 38).padding(.top, -4).padding(.bottom, -4)
}
else {
Rectangle().fill(Color.black).frame(width: 6, height: 90, alignment: .center).scaledToFill().padding(.trailing, 38).padding(.leading, 38).padding(.top, -4).padding(.bottom, -4)
}
}
}
}
}
LazyHStack{
ForEach(1...data.size, id: \.self) { index in
LazyVStack {
ForEach(1...(data.size + 1), id: \.self) { box in
Rectangle().fill(
Color.black).frame(width: 90, height: 6, alignment: .center).scaledToFill().padding(.top, 38).padding(.bottom, 38).padding(.trailing, -4).padding(.leading, -4)
}
}
}
}
Rectangle().fill(Color.white).frame(width: 60, height: 60, alignment: .center).scaledToFill()
}.offset(x: CGFloat(data.ex), y: CGFloat(data.why)).onAppear(){
print("\(data.size/2 + 1)")
}
Circle().fill(Color.black).frame(width: 20, height: 20, alignment: .center).scaledToFill()
}.gesture(DragGesture(minimumDistance: 40)
.onEnded { endedGesture in
if (endedGesture.location.x - endedGesture.startLocation.x) > 0 {
if (endedGesture.location.y - endedGesture.startLocation.y) > (endedGesture.location.x - endedGesture.startLocation.x) {
data.why -= 90
}
else if (endedGesture.startLocation.y - endedGesture.location.y) > (endedGesture.location.x - endedGesture.startLocation.x) {
data.why += 90
}
else {
data.ex -= 90
}
}
else if (endedGesture.startLocation.x - endedGesture.location.x) > 0 {
if (endedGesture.location.y - endedGesture.startLocation.y) > (endedGesture.startLocation.x - endedGesture.location.x) {
data.why -= 90
}
else if (endedGesture.startLocation.y - endedGesture.location.y) > (endedGesture.startLocation.x - endedGesture.location.x) {
data.why += 90
}
else {
data.ex += 90
}
}
else if (endedGesture.startLocation.y - endedGesture.location.y) > (endedGesture.location.y - endedGesture.startLocation.y) {
data.why += 90
}
else {
data.why -= 90
}
data.corx = data.ex/90
data.cory = data.why/90
}
)}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView(data: DataBase(), trafficControl: TrafficControl())
}
}
Post not yet marked as solved
Below is a quick snippet of where I record audio. I would like to get a sampling of the background audio so that later I can filter out background noise. I figure 10 to 15 seconds should be a good amount of time.
Although I am assuming that it can change depending on the iOS device, the format returned from .inputFormat is :
<AVAudioFormat 0x600003e8d9a0: 1 ch, 48000 Hz, Float32>
Based on the format info, is it possible to make bufferSize for .installTap be just the write size for whatever time I wish to record for?
I realize I can create a timer for 10 seconds, stop recording, paster the files I have together, etc. etc. But if I can avoid all that extra coding it would be nice.
let node = audioEngine.inputNode
let recordingFormat = node.inputFormat(forBus: 0)
makeFile(format: recordingFormat)
node.installTap(onBus: 0, bufferSize: 8192, format: recordingFormat, block: {
[self]
(buffer, _) in
audioMetering(buffer: buffer)
print ("\(self.averagePowerForChannel0) \(self.averagePowerForChannel1)")
if self.averagePowerForChannel0 < -50 && self.averagePowerForChannel1 < -50 {
...
} else {
...
}
do {
... write audio file
} catch {return};})
audioEngine.prepare()
do {
try audioEngine.start()
} catch let error {
print ("oh catch \(error)")
}
Post not yet marked as solved
Hello,
On the recent iOS / iPadOS 16, SwiftUI 4, and Xcode Version 14.0 beta (14A5228q), my app contains a NavigationStack within the content view; and the stack contains a ForEach that iterates over a list of fruits / items. The form loop outputs a navigation link, the label being a view, and the destination being another NavigationStack. And whenever I go to click on that link, the app shoots me back to the root view instantly. This seems to happen whenever I have any kind of content in the StackNavigation that's within the NavigationLink. I will post the code snippets below, along with a GIF showing the bug in action.
ContentView.Swift:
struct ContentView: View {
@State private var isShowingSettings: Bool = false
var fruits: [Fruit] = fruitsData
var body: some View {
NavigationStack {
List(fruits.shuffled()) { fruit in
NavigationLink(destination: FruitDetailView(fruit: fruit)) {
FruitRowView(fruit: fruit)
.padding(.vertical, 4)
}
}
.navigationBarTitle("Fruits")
.toolbar {
ToolbarItem(placement: .navigationBarTrailing) {
Button(action: {
isShowingSettings = true
}) {
Image(systemName: "slider.horizontal.3")
}
.sheet(isPresented: $isShowingSettings) {
SettingsView()
}
}
}
}
}
}
FruitDetailView.Swift:
// Code is shortened, but has the same bug as the actual code
struct FruitDetailView: View {
var fruit: Fruit
var body: some View {
NavigationStack {
ScrollView(.vertical, showsIndicators: false) {
Text(fruit.name)
}
.edgesIgnoringSafeArea(.top)
}
}
Preview:
Post not yet marked as solved
Hi,
I am developing an app which has a calendar integrated. This calendar comes from a package called CalendarKit (https://github.com/richardtop/CalendarKit ).
With this calendar you can access to all the events of you mobile integrated calendar and create new ones, modify them, delete, etc. All the events on you mobile calendar are going to be represented here and the same in the other way, everything that you create here will be represented on you mobile calendar.
So the main question is. How can i access to the 'Delete Event' action inside the 'Event Details' view?
I know that i can delete an event programmatically, but i need to "modify" the behavior when clicking on the item 'Delete Event'.
Is there any possible way to access to this item inside event details and when clicking on it do a custom action?.
For example, when clicking i want to:
print a text in the console,
show an alert,
get the EventID of the event deleted,
etc.
Can somebody help me with this??
Thanks a lot in advance.
Post not yet marked as solved
Code to reproduce:
let inputString = "url(https://example.com)"
let regex = Regex {
"url("
Capture {
.url()
}
")"
}
guard let (_, url) = inputString.firstMatch(of: regex)?.output else {
fatalError()
}
print(url)
Regex matches if we change "url(" to "(":
let regex = Regex {
"("
Capture {
.url()
}
")"
}
However, the output is
Is this a bug?
Post not yet marked as solved
I'm currently trying to save a selected image in core data as a type data, but I'm getting an error in the persistence file marked with a comment. I've included my code and any questions I will gladly answer. Thanks for any help!
Content View:
import SwiftUI
import PhotosUI
struct ContentView: View {
@ObservedObject var persistence = PersistenceController.shared
@State var selectedItems: [PhotosPickerItem] = []
@State var data: Data?
var body: some View {
NavigationView{
VStack{
Spacer()
VStack{
Spacer()
if let data = data, let uiimage = UIImage(data: data) {
Image(uiImage: uiimage)
.resizable()
.scaledToFit()
.frame(width: 250, height: 500)
}
Spacer()
}
Spacer()
PhotosPicker(selection: $selectedItems, maxSelectionCount: 1, matching: .images){
Text("Pick Photo")
}
.onChange(of: selectedItems){ newValue in
guard let item = selectedItems.first else{
return
}
item.loadTransferable(type: Data.self){ result in
switch result {
case .success(let data):
if let data = data{
self.data = data
} else {
print("Data is nil")
}
case .failure(let failure):
fatalError("\(failure)")
}
}
}
Spacer()
}
.navigationBarItems(trailing: addButton)
}
}
var addButton: some View {
Button(action: {
guard let item = selectedItems.first else{
return
}
item.loadTransferable(type: Data.self){ result in
switch result {
case .success(let data):
if let data = data{
persistence.addObject(image: data)
} else {
print("Data is nil")
}
case .failure(let failure):
fatalError("\(failure)")
}
}
}){
Text("Add Image").bold()
}
}
}
Persistence:
import Foundation
import CoreData
class PersistenceController: ObservableObject {
static let shared = PersistenceController()
let container: NSPersistentContainer
init(inMemory: Bool = false) {
container = NSPersistentContainer(name: "ReciPlanner")
if inMemory {
container.persistentStoreDescriptions.first!.url = URL(fileURLWithPath: "/dev/null")
}
container.loadPersistentStores(completionHandler: { (storeDescription, error) in
if let error = error as NSError? {
fatalError("Unresolved error \(error), \(error.userInfo)")
}
})
container.viewContext.automaticallyMergesChangesFromParent = true
}
func addObject(image: Data){
let context = container.viewContext
let object = Object(context: context) //Error: Thread 7: "An NSManagedObject of class 'Object' must have a valid NSEntityDescription."
object.item = image
}
func contextSave() {
let context = container.viewContext
if context.hasChanges {
do {
try context.save()
} catch {
print("**** ERROR: Unable to save context \(error)")
}
}
}
}
Data Model:
Hello! I'm working with the UIHostingConfiguration and would like to set a Toolbar for a TextField which I placed in the content. I've tried to set ToolbarRole and Toolbar Visibility. Unfortunately, it doesn't work. Here's my example code:
Cell:
cell.configurationUpdateHandler = { (cell, state) in
cell.contentConfiguration = UIHostingConfiguration {
RowView(item: item)
}
}
View:
@ObservedObject var item: Movie
var body: some View {
TextField("Title", text: $item.title)
.toolbar(content: {
ToolbarItem(placement: .keyboard) {
Button("Confirm", action: {})
}
})
.toolbar(.visible, in: .automatic)
}
}
Post not yet marked as solved
Hi all,
I have a swift script that I've been running from the command line (macOS 12.4, Xcode 13.4.1) for a while with no issues.
I recently downloaded Xcode 14 beta 3 and the script no longer runs. It now fails with a "JIT session error: Symbols not found" error.
I can cut the script down to a very simple example
#!/usr/bin/swift
import Foundation
var url: URL = URL(fileURLWithPath: "/tmp")
I need to import Foundation to get access to the URL type for my script. Xcode 13.4.1 doesn't seem to need to do anything clever
% swift commandline-fail.swift
JIT session error: Symbols not found: [ _$s10Foundation3URLV15fileURLWithPathACSSh_tcfC, _$s10Foundation3URLVMa ]
Failed to materialize symbols: { (main, { __swift_FORCE_LOAD_$_swiftCoreFoundation_$_main, __swift_FORCE_LOAD_$_swiftDispatch_$_main, _$s4main3url10Foundation3URLVvp, __swift_FORCE_LOAD_$_swiftObjectiveC_$_main, __swift_FORCE_LOAD_$_swiftDarwin_$_main, _main, __swift_FORCE_LOAD_$_swiftXPC_$_main, __swift_FORCE_LOAD_$_swiftIOKit_$_main, ___swift_project_value_buffer, ___swift_allocate_value_buffer }) }
The failing swift version is
% swift --version
swift-driver version: 1.60 Apple Swift version 5.7 (swiftlang-5.7.0.120.1 clang-1400.0.28.1)
Target: x86_64-apple-macosx12.0
This script runs fine using
% swift --version
swift-driver version: 1.45.2 Apple Swift version 5.6.1 (swiftlang-5.6.0.323.66 clang-1316.0.20.12)
Target: x86_64-apple-macosx12.0
Does anyone have any ideas how I can solve this issue? It looks like the JIT needs access to the Foundation library but I have no idea how to do this.
Cheers!
Post not yet marked as solved
Getting the crash only in iOS 15.x and i cannot identify the reason.
Log:
0 VectorKit 0x20ace0 gss::BaseRenderStyle<gss::CartoStyle<gss::PropertyID> >::attributeMatch(geo::intern_vector<gss::StyleCondition, geo::StdAllocator<gss::StyleCondition, gss::Allocator> > const&, std::__1::unordered_map<gss::StyleAttribute, unsigned short, std::__1::hash<gss::StyleAttribute>, std::__1::equal_to<gss::StyleAttribute>, geo::StdAllocator<std::__1::pair<gss::StyleAttribute const, unsigned short>, gss::Allocator> > const&) const + 48
1 VectorKit 0x2f5ac4 unsigned int const& gss::RenderStyle<gss::PropertyID>::styleValueForKeyAtZ<unsigned int>(gss::PropertyID, unsigned char, gss::StyleBlendingEnd) const + 168
2 VectorKit 0x3fd8b8 unsigned int gss::RenderStyle<gss::PropertyID>::valueForKeyAtZ<unsigned int>(gss::PropertyID, unsigned char) const + 232
3 VectorKit 0xb944 md::RoadBatch::setRenderOrdersForStrokeAndFill(bool, ggl::RenderItem*, ggl::RenderItem*, ggl::RenderItem*, ggl::RenderItem*, ggl::RenderItem*, unsigned int, bool, std::__1::shared_ptr<gss::StylesheetQuery<gss::PropertyID> > const&, md::RibbonLayoutContext const&, unsigned char) + 184
4 VectorKit 0x79c7d4 md::RoadBatch::layout(md::RoadLayoutContext const&) + 1568
5 VectorKit 0x79f1d8 md::RibbonLayer<md::Ribbons::RoadRibbonDescriptor>::layoutBatches(md::RoadLayoutContext const&) + 56
6 VectorKit 0x57354 md::RoadRenderLayer::layout(md::LayoutContext const&) + 1256
7 VectorKit 0xb2c80 std::__1::__function::__func<md::CartographicRenderLayer::frame(md::LayoutContext const&)::$_0, std::__1::allocator<md::CartographicRenderLayer::frame(md::LayoutContext const&)::$_0>, void ()>::operator()() + 112
8 VectorKit 0x59f95c invocation function for block in geo::TaskQueue::queueAsyncTask(std::__1::shared_ptr<geo::Task>, NSObject<OS_dispatch_group>*) + 108
9 libdispatch.dylib 0x2914 _dispatch_call_block_and_release + 32
10 libdispatch.dylib 0x4660 _dispatch_client_callout + 20
11 libdispatch.dylib 0xbde4 _dispatch_lane_serial_drain + 672
12 libdispatch.dylib 0xc98c _dispatch_lane_invoke + 444
13 libdispatch.dylib 0xdc74 _dispatch_workloop_invoke + 1796
14 libdispatch.dylib 0x171a8 _dispatch_workloop_worker_thread + 656
15 libsystem_pthread.dylib 0x10f4 _pthread_wqthread + 288
16 libsystem_pthread.dylib 0xe94 start_wqthread + 8
Post not yet marked as solved
invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debugI get this warning when I tap either of the switches shown below. I've tried capturing the switch state in a var and using that to trigger the do/catch statement but no joy. I've even tried pulling the do/catch into separate functions and I still get the warning. Has anybody else run into this and how did you fix it?@IBAction func greetingFormat_Tapped(_ sender: UISwitch)
{
let theQuery = theTable_Settings.filter(settingID == 1)
if sender.isOn
{
do {
if try Database.shared.databaseConnection!.run(theQuery.update(greeting_Format <- "true")) > 0
{
greetingFormatLabel_Outlet.text = NSLocalizedString("HelloMrSmith_String", comment: "")
} else {
print("greeting format true not found")
}
} catch {
print("greeting format true update failed! Error: \(error)")
}
} else {
do {
if try Database.shared.databaseConnection!.run(theQuery.update(greeting_Format <- "false")) > 0
{
greetingFormatLabel_Outlet.text = NSLocalizedString("HiJoe_String", comment: "")
} else {
print("greeting format false not found")
}
} catch {
print("greeting format false update failed! Error: \(error)")
}
}
}@IBAction func nonrefundableSwitch_Tapped(_ sender: UISwitch)
{
let theQuery = theTable_Settings.filter(settingID == 1)
var itsOn: String = ""
if sender.isOn
{
itsOn = "true"
} else {
itsOn = "false"
}
if itsOn == "true"
{
do {
if try Database.shared.databaseConnection!.run(theQuery.update(nonRefundable_Bool <- "true")) > 0
{
depositDueLabel_Outlet.text = NSLocalizedString("nonRefunddepositisdue_String", comment: "")
} else {
print("nonRefundable true not found")
}
} catch {
print("nonRefundable true update failed! Error: \(error)")
}
} else {
do {
if try Database.shared.databaseConnection!.run(theQuery.update(nonRefundable_Bool <- "false")) > 0
{
depositDueLabel_Outlet.text = NSLocalizedString("depositisdue_String", comment: "")
} else {
print("nonRefundable false not found")
}
} catch {
print("nonRefundable false update failed! Error: \(error)")
}
}
}
Hello,
I have an App on the App Store, and today, while inspecting the App analytics on the App Store portal, I've noticed that there had been 8 crashes on the App on January 15th.
I went to Firebase Crashlytics, since I used to also see the crashes on the App, and it says that there are no crashes.
Then I went to Xcode to see the details of the crash, and I found this:
What does this crash mean? I have no idea whatsoever. I tested the App several times, and it works perfectly. I have absolutely no idea of what this crash is.
Could someone give some hints on what this crash could possibly be?
Thanks.
Post not yet marked as solved
Hi there,
The problem is that when I just drag and change the position of my label in xib, it does not effect properly in my app.
@IBOutlet weak var Example: UILabel! is connected to the label in xib file.
In total there are 3 labels, so I want to see them normal, but now it looks like the first label is inside the second label. The second and third label has huge spacing, and they are in very center. The first label is on very left side.
Appreciate your ideas.
Currently I am placing a UITableView inside my UIViewController, with multiple other items. I am not using a UITableViewController.
However I am unable to register the identifier "masterlist", or should I say I am not sure where I can register it. I am not using storyboard, and if I am still to register it in my UIViewController's viewDidLoad, I am unable to figure out the proper syntax.
Is this something I can do?
class BeginNewCustomer: UIViewController {
let myList = createTblView()
override func viewDidLoad() {
super.viewDidLoad()
myList.delegate = self
myList.dataSource = self
}
func createTblView() -> UITableView {
let myTable = MyTableView(frame: CGRect(x: 0, y: 0, width: 0, height: 0 ))
myTable.backgroundColor = .white
return myTable
}
extension BeginNewInv: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return dbClass.invsList.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = UITableViewCell()
// let cell = tableView.dequeueReusableCell(withIdentifier: "masterlist", for: indexPath)
var config = cell.defaultContentConfiguration()
.... fill the configuration
cell.contentConfiguration = config
return cell
}
}
Post not yet marked as solved
I was wondering if anyone else was having this issue when distributing their iOS App for Ad Hoc or Development deployment with Xcode 13.3 RC.
Xcode generates the following error 'ipatool failed with an exception' with references to 'libswift_Concurrency'.
It only seems to happen when the following is true:
The App utilises Swift Concurrency
The Deployment Target is set to 14.0
Disabling rebuilding with Bitcode seems to work around the issue however this is less than ideal.
Feel free to reference my feedback FB9951218 where I've attached a minimal project that reproduces the issue.
The professor codes like this in the lecture
var number: Int {
return 3 }
what's different about this?
var number: Int = 3