swift2 Questions
7
Solved
First time using cocoa pods (latest version) for dependencies in the latest Xcode 7.2.1 with Swift 2.1. I initialize my project folder and then edit the podfile and add my dependencies. When I run ...
5
Solved
I had working code to remove all map annotations with a button, but after my update to xcode 7 I am running into the error:
Type 'MKAnnotation' does not conform to protocol 'SequenceType'
if let...
4
I am subclassing UITextView and implementing some delegate methods in subclass like textViewDidChangeSelection but I also need to get notify in View Controller for UITextView delegates.
So if I cre...
Elisabethelisabethville asked 26/3, 2016 at 20:22
6
I know that to program in STDIN and STDOUT, we need to make an command line project in Xcode.
But how do I take a standard input in playground.
Whenever I try to run such code in playground
var...
Warrant asked 13/2, 2016 at 13:15
8
Solved
I am trying to write a function in Apple Swift (iOS) that will generate any given amount of unique random numbers that are within a given inclusive range, say between 0 and 10. So if I say I want 5...
4
I have a bunch of API keys and secrets (Stripe, Cloudinary etc), that are currently hard coded in my app. Where is the right place to store them? Should they be in the server, and I just store the ...
Treiber asked 18/2, 2017 at 5:14
6
Solved
I am currently making an OS X application written in Swift. What I want to do is when the user enters text in a NSTextField, I want to run a function that checks the value and adds it to a Label. H...
Uredium asked 9/1, 2016 at 14:15
7
Solved
I have been using the code below to show a UIActivityViewController which worked fine when I was using Xcode 6, Swift 1.2 and iOS 8. However when I updated it shows the UIActivityViewController but...
Mckinley asked 1/10, 2015 at 14:7
7
Solved
I am trying to dynamically center the content of a UICollectionView, however none of the existing solutions take into account the fact that there might be more than one cell per row.
I have tried ...
2
Solved
I'm developing an OSX app where I show first a login/register window if the user hasn't logged in yet.
After login success I show my main view controller.
If the user is already logged in (a toke...
4
Solved
I have two input fields in my view, loginEmailInput and loginPasswordInput.
I'm trying to change the border color. My code in ViewController.swift looks like so:
import UIKit
class ViewControlle...
4
Solved
when I click the btnLogin in the iPhone the xCode was displayed the error:
Thread 5: EXC_BREAKPOINT (code=1, subcode=0x10025c76c)
this is my code
@IBOutlet weak var abc: UILabel!
...
@IBAction ...
4
Solved
#available does not seem to work when differentiating between watchOS and iOS.
Here is an example of code shared between iOS & watchOS:
lazy var session: WCSession = {
let session = WCSessio...
5
Solved
I am trying to explore the Swift programming language. I was searching through the Swift API and I found the UIReferenceLibraryViewController class. I found the method that returns a bool value if ...
13
So
split("There are fourty-eight characters in this string", 20)
should return
["There are fourty-eig", "ht characters in thi","s string"]
If I make currentIndex = string.startIndex and then...
5
Solved
[Xcode 7.1, iOS 9.1]
I have an array: var array: [String] = ["11", "43", "26", "11", "45", "40"]
I want to convert that (each index) into an Int so I can use it to countdown from a timer, respec...
7
How can I make a effect in swift similar to this:
I want the animation to loop forever.
Subtangent asked 18/6, 2016 at 3:40
2
I am getting this error in my code it says to "Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger." I am confused as to what it is actually a...
Olivia asked 29/5, 2016 at 14:25
5
Solved
I'm using realm.io in a swift app. This is the first time I've had to run a migration since I have an app in production. I changed one of the models and added a couple of extra fields to it.
I fol...
Solmization asked 14/1, 2016 at 4:44
8
Solved
how can i set the dynamic height of UIScrollView based on the content/ subviews i have in my ScrollView
Here is what i am getting as output:
Subtropics asked 3/12, 2016 at 6:35
8
Solved
I have a question about UITextField() in Swift. How can I clear the text in the text field when I click on it?
My textField.text = "0". I want to automatically remove the number "0" when I click o...
Danutadanya asked 7/5, 2016 at 4:36
5
Solved
I have a folder of images that were imported with Create Folder Reference method, since I want to call images with URLForResoure for transfer to Watch.
Before I transfer Images I would like to coun...
Clawson asked 6/10, 2015 at 21:43
15
Solved
I have an Xcode project which was downloaded from the internet so I don't know which Xcode version was used to write it but the language is Swift 2. I opened it in Xcode 7.1 beta 1 and I get the fo...
Supererogate asked 16/10, 2015 at 19:16
7
Solved
I'm trying to create a video player for my Swift app, but I keep getting the error of 'unresolved identifier AVPlayerViewController'. What am I missing?
I'm a beginner at this, I may have to ask ...
4
I have an custom struct called 'News' that I want to append into the array to NSUserDefault. But it's showing error "Type 'News' does not conform to protocol 'AnyObject'".
I don't want to ch...
Jessamyn asked 16/7, 2016 at 0:0
© 2022 - 2024 — McMap. All rights reserved.