logo
down
shadow

SWIFT QUESTIONS

How to call didUpdateLocation in another viewcontroller class from custom location manager?
How to call didUpdateLocation in another viewcontroller class from custom location manager?
I wish this helpful for you I have the following custom location manager class, I have another view controller that has a map view, how do I use this location manager to update the map view's coordinate when the user moves? For some reason I cannot e
TAG : swift
Date : November 29 2020, 04:01 AM , By : user2188163
Can't return a promise chain with a catch block on the end
Can't return a promise chain with a catch block on the end
Hope this helps This used to work but with version 6 of PromiseKit this... , You just need to remove the catch block as below,
TAG : swift
Date : November 29 2020, 04:01 AM , By : user2188155
Change font size programmatically on thermal Bluetooth Printer
Change font size programmatically on thermal Bluetooth Printer
Hope that helps Resolved: After finding ESC/POS commands and this StackOverflow post I was able to change the print size on the printer known as M58-LL or ZJ-5805 using the following function which takes an array of hexcodes, transform them into Unic
TAG : swift
Date : November 28 2020, 04:01 AM , By : Pradeep Balasundaram
Print formatted key and [key, value] from Dictionary in Swift 4
Print formatted key and [key, value] from Dictionary in Swift 4
wish of those help I would like to know how to print key and value from Dictionary. , To print using the quotes:
TAG : swift
Date : November 27 2020, 04:01 AM , By : user2187582
How can I convert a [String: Any] dictionary into a double?
How can I convert a [String: Any] dictionary into a double?
wish help you to fix your issue You are probably storing your date values as Strings in Firebase. Just like any other value of type Any, you cannot unwrap the fields themselves as anything but the type they were originally cast as. Since the field is
TAG : swift
Date : November 27 2020, 04:01 AM , By : saf
How do you apply a transform to a UILabel before animating in Swift?
How do you apply a transform to a UILabel before animating in Swift?
will be helpful for those in need The way I have it now ignores my initial view rotation if I have the animation afterwards.
TAG : swift
Date : November 26 2020, 04:01 AM , By : Abramova Katia
A global function calls a mutating method of a protocol type. How can I get rid of the var tmp object?
A global function calls a mutating method of a protocol type. How can I get rid of the var tmp object?
this one helps. this is my working code snippet. But I want to get rid of the var tmp variable in the function slide. , It may work with this little change:
TAG : swift
Date : November 22 2020, 04:01 AM , By : kramar42
Xcode generated CoreData files cannot be processed by Copy Bundle Resources build phase
Xcode generated CoreData files cannot be processed by Copy Bundle Resources build phase
wish of those help I added CoreData to my app MY_APP: , EDIT:I contacted Apple, and they provided a solution:
TAG : swift
Date : November 21 2020, 04:01 AM , By : user2185455
Use of unresolved identifier 'kUTTypePDF'
Use of unresolved identifier 'kUTTypePDF'
To fix the issue you can do You need to import import MobileCoreServices as "Robert Dresler" saidBut you will see below error after import MobileCoreServices
TAG : swift
Date : November 21 2020, 04:01 AM , By : Elahe Jalalpoor
difficult type in swift
difficult type in swift
I hope this helps . I know you accepted an answer already, but if you want to have both preset and customizable difficulty setting i'd suggest doing it like that:
TAG : swift
Date : November 21 2020, 04:01 AM , By : vinay prasad
Create multiplication table with swift
Create multiplication table with swift
may help you . im a beginner here. Ive been stuck on a problem for some time now. Practicing in playground and i need to make a multiplication table. basically, if i input 3, i want the table to read , You could do it like this.
TAG : swift
Date : November 21 2020, 04:01 AM , By : user2185369
Why did Swift NOT load this view properly, while Objective-C did?
Why did Swift NOT load this view properly, while Objective-C did?
like below fixes the issue I can't explain why the Objective-C code works as you expect. But I do know what's wrong with the Swift code:
TAG : swift
Date : November 21 2020, 04:01 AM , By : Hemel Sm Rokibul
How to hide one tab in tab bar controller?
How to hide one tab in tab bar controller?
Does that help I am using Xcode 10.1 and Swift 4.2.1. I have Tab Bar app like this: , To remove:
TAG : swift
Date : November 20 2020, 04:01 AM , By : Jean McGlinn
Empty value for Date type in Swift
Empty value for Date type in Swift
will be helpful for those in need From the documentation :
TAG : swift
Date : November 19 2020, 04:01 AM , By : Nourddine Tadlaoui
Swift: Convert Array of Dictionaries to Array of String based on a key
Swift: Convert Array of Dictionaries to Array of String based on a key
it should still fix some issue Following is my Array of Dictionaries and I want to get an Array of only strings based on particular key (contentURL key in my case). , Just use compactMap
TAG : swift
Date : November 19 2020, 04:01 AM , By : user2184699
Calculating doubles by dates with format timeIntervalSince1970 from 2 different dictionaries
Calculating doubles by dates with format timeIntervalSince1970 from 2 different dictionaries
around this issue I have decided to work with the dates as a simple formatted string here for simple comparison of dates. For this I have a simple utility function to convert the int date
TAG : swift
Date : November 17 2020, 04:01 AM , By : user2183991
An efficient way to pick the type of custom UITableViewCell to return
An efficient way to pick the type of custom UITableViewCell to return
it helps some times You could encode the class lookup into a dictionary which would greatly reduce the code:
TAG : swift
Date : November 16 2020, 04:01 AM , By : Lee Chilcoat
Swift - Decoding a Deeply Nested Dictionary
Swift - Decoding a Deeply Nested Dictionary
this will help These structs don't decode all keys, but it's a starting point.If keys and struct members have the same name you don't need to specify CodingKeys
TAG : swift
Date : November 16 2020, 04:01 AM , By : user2183413
Figure out when a context switch is happening in Swift
Figure out when a context switch is happening in Swift
To fix the issue you can do You can absolutely get what you've asked for, but I have a feeling it's going to be much less useful to you than you may believe. The vast (vast, vast!) majority of context switches are going to occur at points that you pr
TAG : swift
Date : November 16 2020, 04:01 AM , By : user2183398
Collection View cell label overrides label of other cells
Collection View cell label overrides label of other cells
Any of those help You are saving your recordingTitle in a single variable, so every time you write to it you override it, you need to store them as an array.You initialize your variable with:
TAG : swift
Date : November 15 2020, 04:01 AM , By : user2183349
ios swift cannot invoke map with argument list oftype
ios swift cannot invoke map with argument list oftype
it fixes the issue You need to supply the input arguments to the initializer of ArtistSection in map.
TAG : swift
Date : November 15 2020, 04:01 AM , By : user2183196
How to format address lines in Swift?
How to format address lines in Swift?
around this issue The address is expressed through the CLPlacemark postalAddress property.
TAG : swift
Date : November 15 2020, 04:01 AM , By : Lars Brusletto
DateRow local does not change
DateRow local does not change
This might help you You can access the datePicker of the DateRow as cell.datePicker. To change its locale use the cellSetup callback. You might also want to set the formatter of the row so that the value is displayed with the correct locale:
TAG : swift
Date : November 15 2020, 04:01 AM , By : Matthew Poulson
Changing UIImage image property with the image name set in a dictionary
Changing UIImage image property with the image name set in a dictionary
this one helps. I'm building a simple app which you click on a button and the image change randomly but I also want to add a label which describes the image so I created a dictionary contains the ["fileName":"Description"] but when I try changing the
TAG : swift
Date : November 13 2020, 04:01 AM , By : Kartikey Joshi
Swift can't infer generic type when generic type is being passed through a parameter
Swift can't infer generic type when generic type is being passed through a parameter
should help you out My suggestion is a bit different. It uses static methodsCall loadFromDB and fetch on the NSManagedObject subclass. The benefit is that always the associated type is returned without any further type cast.
TAG : swift
Date : November 12 2020, 04:01 AM , By : user2182128
How can I implement a generic class that conforms to a protocol with associated type?
How can I implement a generic class that conforms to a protocol with associated type?
help you fix your problem You can't use a protocol with associated type the same way as you would use normal protocol, but you can use DataSource as type constraint in SomeClass in this way:
TAG : swift
Date : November 11 2020, 04:01 AM , By : darkghosthero
2D Motion vectors - calculate location of object at a given time
2D Motion vectors - calculate location of object at a given time
With these it helps I am having problems understanding 2D motion vectors when moving certain objects at a given time. My knowledge of linear algebra is limited and I really don't know the exact search terms to look for, so I wanted to know whether an
TAG : swift
Date : November 09 2020, 04:01 AM , By : user2181230
Array filter with aggregate operators
Array filter with aggregate operators
I wish did fix the issue. array.filtered does not exist in Swift anymore, I am looking for a way to use 'IN' operator in array.filter closure same as how I used it with NSPredicate. , You can check it like this.
TAG : swift
Date : November 09 2020, 04:01 AM , By : Logan Nissenson
shuffle array after index
shuffle array after index
I wish did fix the issue. shuffle() is a method of the MutableCollection protocol, therefore it can be applied to an array slice. Example:
TAG : swift
Date : November 08 2020, 04:01 AM , By : user2180773
Swift BitConverter.DoubleToInt64Bits Equivalent
Swift BitConverter.DoubleToInt64Bits Equivalent
fixed the issue. Will look into that further The bitPattern property of Double returns an (unsigned) 64-bit integer with the same memory representation:
TAG : swift
Date : November 08 2020, 04:01 AM , By : Zephyrus 1898
heightAnchor.constraint not change height of view
heightAnchor.constraint not change height of view
This might help you I use this code: , First declare constraints
TAG : swift
Date : November 07 2020, 04:01 AM , By : user2180369
why can't I initialise this set
why can't I initialise this set
fixed the issue. Will look into that further You can do that with String because it just so happens that String has an initialiser:
TAG : swift
Date : November 06 2020, 04:01 AM , By : Joshua Bedingfield
RxSwift, Divide Observable<[array]> into Observable<a>, Observable<b>
RxSwift, Divide Observable<[array]> into Observable<a>, Observable<b>
I wish this help you I have a question abou RxSwift. , Also a .flatMap() -
TAG : swift
Date : November 05 2020, 04:01 AM , By : MikeSoys
UITABLE view sections with different prototype cells in each section
UITABLE view sections with different prototype cells in each section
Does that help Note : You can do this using only one cell. just hide/show the connect Button by checking some condition.
TAG : swift
Date : November 05 2020, 04:01 AM , By : Robert Guico
Can I get information if this iPhone connected with Apple watch or not through WatchConnectivity?
Can I get information if this iPhone connected with Apple watch or not through WatchConnectivity?
this will help I'm making Apple Watch App by Swift. I want to make a function which works depend on the existence of Phone-Watch connection. I'm using WatchConnectivity like below. , You can get this information from the WCSession object:
TAG : swift
Date : November 04 2020, 04:01 AM , By : Vinoth Purushothaman
Can you use Swift with React Native
Can you use Swift with React Native
Does that help You can write code in Objective-C/Swift or Java for developing your own modules and to take advantage of native API for iOS or Android. But React-Native has some build-on modules that would simplify your workd just by writing JavaScrip
TAG : swift
Date : November 01 2020, 04:01 AM , By : Josh
Why is asking for camera/microphone permission triggering applicationDidBecomeActive?
Why is asking for camera/microphone permission triggering applicationDidBecomeActive?
This might help you When system notifications such as Permissions are presented, the application is sent to background, or becomes "inactive". When the Permission notification is dismissed, the application becomes "active" again. This would explain w
TAG : swift
Date : October 31 2020, 05:01 AM , By : user2178121
Watchkit Next page preventing buttons from performing segues.
Watchkit Next page preventing buttons from performing segues.
it fixes the issue Page-based and hierarchical navigation on watchOS are an either-or, you can't use both.From the watchOS Human Interface Guidelines:
TAG : swift
Date : October 31 2020, 05:01 AM , By : Alex Dallman-Porter
Swift enum with a custom constructor
Swift enum with a custom constructor
wish of those help I have a simple enum of type string: , You don't need to return anything. You just call initializer:
TAG : swift
Date : October 31 2020, 05:01 AM , By : user63453
Passing value while instantiating the view
Passing value while instantiating the view
I wish this help you Need to adding a value from one view controller to another view controller via the following way. I successfully able to move to the another page but not able to passing the value , Add a property inside ProjectDetailController:
TAG : swift
Date : October 30 2020, 05:01 AM , By : chand sodhi
OSX: detect 'restricted' filesystem flag programmatically
OSX: detect 'restricted' filesystem flag programmatically
I hope this helps you . The things listed by the -O option on the ls tool are the file flags. These can be read by the stat() function in the BSD layer, and are found in the st_flags field of the resulting structure. The "restricted" flag in ls's out
TAG : swift
Date : October 30 2020, 05:01 AM , By : Mint Logos
Trying to return data via completion handler from a URLSession
Trying to return data via completion handler from a URLSession
this one helps. I hope someone can help, I've tried several tutorials and I'm close to getting this working, I think. , Two issues:
TAG : swift
Date : October 30 2020, 05:01 AM , By : Nexaz
AVPlayer is not playing audio
AVPlayer is not playing audio
This might help you You should declare AVPlayer as a global variable inside your class/struct. So, remove player from addPeriodicTimeObserver function and declare globally.The reason behind this is:
TAG : swift
Date : October 29 2020, 05:01 AM , By : user2177354
How can I check popularProduct.xib file loaded into HomeViewController
How can I check popularProduct.xib file loaded into HomeViewController
may help you . As a pretty simple direct solution, you could follow the delegation approach. So, when "Popular Product" View complete the needed process, you should fire a delegate method which will be handled by the view controller.Example:
TAG : swift
Date : October 29 2020, 05:01 AM , By : xouris
Extract Float array from Data
Extract Float array from Data
this will help You can use withUnsafeBytes() to access the raw data as an array of Float values:
TAG : swift
Date : October 29 2020, 05:01 AM , By : stefancho
shadow
Privacy Policy - Terms - Contact Us © bighow.org