logo
down
shadow

SWIFT QUESTIONS

Swift how to pass data to a UINavigation
Swift how to pass data to a UINavigation
I wish this helpful for you Im trying to pass data to a UINavigationController I know how to do this with a regular view controller and it work fine but when I try to do it with a UINavigationController I get an error "Value of typ 'UINavigationContr
TAG : swift
Date : November 24 2020, 11:01 PM , By : Muzammal Hussain
WebView embed youtube video position
WebView embed youtube video position
hop of those help? Wrap your iframe inside a body and set the margin and padding to zero, so the content begins from the top left.
TAG : swift
Date : November 22 2020, 11:00 PM , By : Ki Yu
Toggle disclosure triangle?
Toggle disclosure triangle?
To fix the issue you can do Turns out, there is no need for code to make it rotate the triangle. That is automatic with the button press.
TAG : swift
Date : November 21 2020, 11:01 PM , By : QHQuach
IOS swift how can I create a small horizontal line inside a tableView cell
IOS swift how can I create a small horizontal line inside a tableView cell
wish of those help You can do this from the Xcode interface builder by adding a View (UIView) control and set the height to 1.
TAG : swift
Date : November 21 2020, 11:01 PM , By : SysEmpress88
Searching trough NSDictionary using search bar
Searching trough NSDictionary using search bar
I hope this helps . I would like to know how I am able to filter NSDictionary using searchBar? , Whipped this out in playground, works fine
TAG : swift
Date : November 20 2020, 11:01 PM , By : 蔡旭东
How to put a subtitle label under textlabel in cell?
How to put a subtitle label under textlabel in cell?
should help you out First of all, the first assignment inside the following IF is useless because it is overwritten by the next assignment.
TAG : swift
Date : November 19 2020, 11:01 PM , By : Yore.Chen
Pass data back, from a sheet to the ViewController
Pass data back, from a sheet to the ViewController
I hope this helps you . You will have to use a singleton class know as the NSNotificationCenterAdd this Statement before you call the method presentViewController in ViewController class
TAG : swift
Date : November 19 2020, 11:01 PM , By : user6063981
SKSpriteNode not working with Random Number Array
SKSpriteNode not working with Random Number Array
fixed the issue. Will look into that further I have a SKSpriteNode that is spawn repeatedly. I have created a random number generator and have tried to associate the returns with a different Sprite Image. However, it does not work. The numbers are be
TAG : swift
Date : November 19 2020, 11:01 PM , By : Bisera
SKSpriteNode animation to appear bottom-up
SKSpriteNode animation to appear bottom-up
To fix this issue To create an animation that makes the sprite slide up from "under" the scene, do this:Set its initial position to below the scene:
TAG : swift
Date : November 19 2020, 11:01 PM , By : Pandantly
create changeable datasource for UItableview (using viewcontroller)
create changeable datasource for UItableview (using viewcontroller)
With these it helps In your didSelectRowAtIndexPath method, when the first if statement is executed, it changes theTitle to "Acura". Then when the next if statement is executed, its condition (thetitle == "Acura") is true and the corresponding statem
TAG : swift
Date : November 19 2020, 11:01 PM , By : Anthony Miller
tvOS and displaying artwork and title when AVPlayer 'idles'?
tvOS and displaying artwork and title when AVPlayer 'idles'?
it should still fix some issue A bit more research and it seems that I need to use the 'MPNowPlayingInfoCenter':
TAG : swift
Date : November 18 2020, 11:01 PM , By : Ráffukc Zeta
Retrieving Keys From GeoFire within Radius in Swift
Retrieving Keys From GeoFire within Radius in Swift
To fix the issue you can do I have the following Firebase Database JSON data structure: , Figured it out
TAG : swift
Date : November 18 2020, 11:01 PM , By : Chris Lamb
SKTexture in:texture yields empty result
SKTexture in:texture yields empty result
This might help you The problem was that CGRect was using the wrong initializer. One would think that the below would give you half the down-left quarter of the image.
TAG : swift
Date : November 18 2020, 11:01 PM , By : AndrewStern
Fibonacci numbers generator in Swift 3
Fibonacci numbers generator in Swift 3
I wish this helpful for you The following QA covers a few methods of generating Fibonacci numbers in Swift, but it's quite outdated (Swift 1.2?): , An alternative for Swift 3.0 would be to use the helper function
TAG : swift
Date : November 17 2020, 11:01 PM , By : Binate Hawa
Compatibility of SubSequence indices
Compatibility of SubSequence indices
help you fix your problem That has been discussed on swift-evolution, filed as bug report SR-1927 – Subsequences of String Views don’t behave correctly and recently been fixed in StringCharacterView.swift with commit.With that fix String.CharacterVie
TAG : swift
Date : November 16 2020, 11:00 PM , By : Erin Lee James
URLSession issue
URLSession issue
I think the issue was by ths following , The initializer you are looking for URLSession is like init(configuration:delegate:delegateQueue:). So change your initialization of session like this.
TAG : swift
Date : November 16 2020, 11:00 PM , By : Dani Tave
Global function sequence(state:next:) and type inference
Global function sequence(state:next:) and type inference
seems to work fine This looks like a combination of two issues.The first is that Swift currently doesn't infer the type of a multi-line closure without any external context. This is however intended behaviour, as confirmed by Apple developer Jordan R
TAG : swift
Date : November 16 2020, 11:00 PM , By : Carl Jackson
Difference between error = error vs error != nil
Difference between error = error vs error != nil
it fixes the issue As you already recognized at the end of your question, I would agree with you, that I would use if let, if I want to use the error variable to print it out for example. If I would just check if it's not nil and don't need the error
TAG : swift
Date : November 16 2020, 11:00 PM , By : Matthew Dovydaitis
XCTest Unit Test data response not set in test after viewDidLoad
XCTest Unit Test data response not set in test after viewDidLoad
Any of those help Problem On the second Assertion you expect data which are loaded asynchronously, but you check them synchronously and at the time you are checking for them, the network operation has not finished yet, so of course it is going to fai
TAG : swift
Date : November 16 2020, 11:00 PM , By : shahid khan
Difference between timestamp stored and current date
Difference between timestamp stored and current date
fixed the issue. Will look into that further I have linked up an app that I have made to an Firebase database. , Swift 3. If you are using Swift 2, use NSDate
TAG : swift
Date : November 16 2020, 11:00 PM , By : Francis Chaime Salud
I get this error " No such module 'SwiftyJSON' " after updating xcode
I get this error " No such module 'SwiftyJSON' " after updating xcode
With these it helps I had to clean the files and copy them to different location and re install pods and after that it worked.
TAG : swift
Date : November 15 2020, 11:01 PM , By : Fer Young
Swift2.3: NSMutableDictionary store integer from sqlite
Swift2.3: NSMutableDictionary store integer from sqlite
wish help you to fix your issue sqlite3_column_int() returns a "C integer" which is Int32 in Swift. To convert that to an Int, use just
TAG : swift
Date : November 14 2020, 11:01 PM , By : Glenda P
How does swift pass along override method calls on casted inherited classes?
How does swift pass along override method calls on casted inherited classes?
around this issue I am learning all about swift, OOP and POP, and I am trying to find out exactly how swift passes along overridden method calls between classes. I can't seem to find specific info on this. The Swift Programming Language manual has an
TAG : swift
Date : November 14 2020, 11:01 PM , By : Watson Jones III
Collapsable Table Cells [Swift 3]
Collapsable Table Cells [Swift 3]
hop of those help? It's very simple; you are probably over-thinking things here. This functionality is built in; Apple wants you to be able to expand and contract a cell. You just aren't using the API Apple has provided. Use it! Here's how. The date
TAG : swift
Date : November 14 2020, 11:01 PM , By : Parth Gaglani
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSKeyedArchiver unarchiveObjectWithFi
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSKeyedArchiver unarchiveObjectWithFi
Does that help I'm following the FoodTracker demo at developer apple. I'm on the last section: Persist data. , Use NSKeyedUnarchiver:
TAG : swift
Date : November 13 2020, 11:01 PM , By : Ismael Ab
XGCLogger: Retrieve logs from device?
XGCLogger: Retrieve logs from device?
wish of those help I use CocoaLumberjack (another logging framework) in my apps but the following applies to any logging framework that supports logging to a file (including XGCLogger).Setup your logging framework to log to a file (in addition to any
TAG : swift
Date : November 13 2020, 11:01 PM , By : Alex
Why does my Swift CLI code that uses GCD run at the same speed as the code that doesn't use concurrency?
Why does my Swift CLI code that uses GCD run at the same speed as the code that doesn't use concurrency?
I wish this help you You are creating a serial queue so your "gcd" code doesn't take any advantage of multi-threading.Change:
TAG : swift
Date : November 12 2020, 11:01 PM , By : dun-e-deis
Startindex swift 3 issue
Startindex swift 3 issue
it should still fix some issue In swift 3 you can no longer use advanced, successor or predecessor, instead you need to use
TAG : swift
Date : November 12 2020, 11:01 PM , By : Yuming Liu
Is String.cString(using: String.Encoding.utf16) working correctly?
Is String.cString(using: String.Encoding.utf16) working correctly?
should help you out Is String.cString(using: String.Encoding.utf16) working correctly?The answer is NO.
TAG : swift
Date : November 11 2020, 11:01 PM , By : Cristi Ursuleanu
Counting with a button click
Counting with a button click
it fixes the issue I tested you code, and it will work if you do the following: Go to your Storyboard and click on "File Inspector", deselect "Use Size Classes" and "Use Auto Layout".
TAG : swift
Date : November 11 2020, 11:01 PM , By : Oleg Vachevskiy
How to use UISwitch correctly?
How to use UISwitch correctly?
will help you "switchChanged" is not the correct selector name, you should use "switchChanged:" to account for the parameter. switchChanged would be a method without parameters.Also, in Swift you should use selector(switchChanged(_:)) instead. That w
TAG : swift
Date : November 11 2020, 11:01 PM , By : Chris
How To Search in Database Firebase
How To Search in Database Firebase
I wish did fix the issue. If you are looking for finding the node which has a specific name try this:-
TAG : swift
Date : November 11 2020, 11:01 PM , By : mary rose maming
Change color of SKSpriteNode if i click on "touches began" return the colors that i had clicked
Change color of SKSpriteNode if i click on "touches began" return the colors that i had clicked
hop of those help? Create an array with all the colors you want, in order. Create an integer variable to keep track of current color. Modify the integer on touchesBegan and assign a new color to your SKShapeNode properties: strokeColor and/or fillCol
TAG : swift
Date : November 11 2020, 11:01 PM , By : Kay Ace Elits
Distance from point to ellipse
Distance from point to ellipse
This might help you x = a cos(phi), y = b sin (phi) is an ellipse with the center at the origin, and the approach described in your question can be realized like this:
TAG : swift
Date : November 10 2020, 11:01 PM , By : Ahmad Seyedmortaza
Deleting file from Firebase storage causes crash
Deleting file from Firebase storage causes crash
fixed the issue. Will look into that further If you are using Swift 3 i dont think there is any function delete() in FIRStorage class , Try :-
TAG : swift
Date : November 09 2020, 11:01 PM , By : B.C.
Using CGContextSetTextDrawingMode with setLineWidth property (drawRect function)
Using CGContextSetTextDrawingMode with setLineWidth property (drawRect function)
To fix the issue you can do How can I use "setLineWidth" and "setLineJoin" properties with CGContextSetTextDrawingMode in Swift? , This works in Swift 3
TAG : swift
Date : November 09 2020, 11:01 PM , By : Milad Poorsaleh
Type 'AppDelegate' does not conform to protocol 'ORSSerialPortDelegate' when using ORSSerialPort
Type 'AppDelegate' does not conform to protocol 'ORSSerialPortDelegate' when using ORSSerialPort
I wish this helpful for you According to protocol's declaration you must implement the following method from the protocol:
TAG : swift
Date : November 09 2020, 11:01 PM , By : Jesus Camarena
Navigation Left bar button item with back button
Navigation Left bar button item with back button
hope this fix your issue The presence of custom left bar button items causes the back button to be removed in favor of the custom items. Set navigationItem property leftItemsSupplementBackButton to true will display back button also with your custom
TAG : swift
Date : November 09 2020, 11:01 PM , By : Swati Jain
Matching multiple enums with a single guard case?
Matching multiple enums with a single guard case?
I hope this helps . You can put the desired cases into a literal array and use contains to test for a match:
TAG : swift
Date : November 08 2020, 11:01 PM , By : سعید سعیدی
Creating range from normal collection index and reversed collection index
Creating range from normal collection index and reversed collection index
wish helps you In order to get the index for the underlying collection from a ReversedIndex, you can simply use its base property.Although note that because of the way ReversedCollection is implemented, this will actually return the index above the g
TAG : swift
Date : November 08 2020, 11:01 PM , By : dc90
How to get unique value from Realm database in swift
How to get unique value from Realm database in swift
wish help you to fix your issue I do news application in swift using Realm database. In my database have same news categories. How to get unique value from Realm database? I use primary key , Starting from Realm 3.10 it's now possible to
TAG : swift
Date : November 08 2020, 11:01 PM , By : Tera
swift UIAlertController with pickerView button action stay up
swift UIAlertController with pickerView button action stay up
I hope this helps . Instead of adding pickerView as subview try to set contentViewController of UIAlertController like this.
TAG : swift
Date : November 07 2020, 11:01 PM , By : Rafał Rudewicz
Passing Data into function that accepts generic collection
Passing Data into function that accepts generic collection
Hope this helps I think the problem is that Data.SubSequence does not conform to RangeReplaceableCollection protocol, while your generic function has this requirement:
TAG : swift
Date : November 07 2020, 11:01 PM , By : veebee
Does deleting account from Firebase automatically logs user out?
Does deleting account from Firebase automatically logs user out?
hope this fix your issue If you are deleting your currentUser you need to take care of two things:- Delete the user's data from the Firebase Database (If there is any)
TAG : swift
Date : November 07 2020, 11:01 PM , By : cleopas
RxSwift + RxRealm + RxCocoa insert rows to UITableView
RxSwift + RxRealm + RxCocoa insert rows to UITableView
may help you . Currently, you have two subscriptions racing against each other to update your table.
TAG : swift
Date : November 07 2020, 11:01 PM , By : FBA
Why does Double reach `Double.infinity` BEFORE Double Max is reached?
Why does Double reach `Double.infinity` BEFORE Double Max is reached?
will help you I wrote a tiny Swift programme to add a number to the previous number until it reached infinity. However, infinity is reached BEFORE the Double Maximum is reached. , After adding:
TAG : swift
Date : November 07 2020, 11:01 PM , By : Bas Wenneker
Compactification of Swift Generic Collection where constraint
Compactification of Swift Generic Collection where constraint
help you fix your problem A collections subsequence need not have the same type as the collection itself, but – as far as I know – the subsequence of a subsequence has the same type as the subsequence itself for all collections defined in the standar
TAG : swift
Date : November 07 2020, 11:01 PM , By : Desiderio Savani
How do I convert Float to Int When Necessary?
How do I convert Float to Int When Necessary?
fixed the issue. Will look into that further So, I'm pretty new to swift and Xcode and might be missing something obvious, but I've done a bit of research, and can't find my answer. My code is:
TAG : swift
Date : November 06 2020, 11:01 PM , By : basha mehboob
Today's Extension communicate with Main App
Today's Extension communicate with Main App
help you fix your problem You can't communicate directly with your main app as you want. You can basically do two things: Open your main app from your extension Pass data through your shared container
TAG : swift
Date : November 06 2020, 11:01 PM , By : DJH
TableViewCell copy property changed in Swift 3
TableViewCell copy property changed in Swift 3
may help you . Though not sure why it is so, can you try to specify it explicitly by overriding canPerformAction delegate,
TAG : swift
Date : November 06 2020, 11:01 PM , By : stefan20
run loop in update() of spritekit, rarely, efficiently: a way?
run loop in update() of spritekit, rarely, efficiently: a way?
Does that help Yes, that code inside the update should be removed.You can try this
TAG : swift
Date : November 06 2020, 11:01 PM , By : user6060208
Always sort NSTableView
Always sort NSTableView
wish help you to fix your issue The order of the elements in your data source dictates the order of the elements in the table view. That's why, when your data source (not your delegate, technically) gets told that the sort descriptors have changed, w
TAG : swift
Date : November 05 2020, 11:01 PM , By : lyuu
Error when I try to use NSTimer to change View Controller(EXC_BAD_INSTRUCTION)
Error when I try to use NSTimer to change View Controller(EXC_BAD_INSTRUCTION)
will be helpful for those in need There's a clue in the console output in your screenshot.You're implicitly unwrapping imageView but it is nil. This probably means that there's no image view connected to that outlet.
TAG : swift
Date : November 05 2020, 11:01 PM , By : murali Krishna
Using TapGestureRecognizer Proper Syntax
Using TapGestureRecognizer Proper Syntax
will help you Try using selector(tapped(gesture:)) if you're on Swift 3. If you're on Swift 2 the selector will probably be tapped(_:) or something instead.The compiler will ensure the existence of the symbol you're referencing when you use selector.
TAG : swift
Date : November 05 2020, 11:01 PM , By : subrata biswas
Convert subsequence of Collection to String
Convert subsequence of Collection to String
To fix this issue Currently, a Collection's SubSequence is not guaranteed to have the same element type as the collection itself, which is due to a limitation of associatedtypes.In fact, one of the motivations for SE-0142: Permit where clauses to con
TAG : swift
Date : November 04 2020, 11:01 PM , By : Evy Henriksen
How do I add a label on top of a gradient?
How do I add a label on top of a gradient?
it helps some times Try to change the order of your views so that label appears above the view with gradient inside:
TAG : swift
Date : November 04 2020, 04:05 PM , By : Zoooooo
Casting to protocol and using value?
Casting to protocol and using value?
I hope this helps . I think this comes down to issues trying to use an associatedType outside of the enum.I fixed it like this:
TAG : swift
Date : November 04 2020, 04:05 PM , By : Yashwanth
how to print error in catch
how to print error in catch
should help you out The catch blocks are exclusive cases, evaluated in order. When a match succeeds, we stop.So, let's just think about this structure:
TAG : swift
Date : November 03 2020, 11:01 PM , By : 刘玉林
What is the specfic type of the Alamofire response to responseJSON?
What is the specfic type of the Alamofire response to responseJSON?
With these it helps The implementation of responseJSON will answer that question for you. It's Result.
TAG : swift
Date : November 03 2020, 11:01 PM , By : Rob
Swift Playground: Show Line Execution Counts > i.e. (# times)
Swift Playground: Show Line Execution Counts > i.e. (# times)
should help you out Short and simple answer:There is no calculation iteration to print out there, check this example:
TAG : swift
Date : November 02 2020, 11:01 PM , By : Rob

shadow
Privacy Policy - Terms - Contact Us © soohba.com