Tagged Questions
0
votes
2answers
14 views
How do I get the return key to perform the same action as a button press in Swift?
I want to know how you allow an action to be made by either pressing the return key on the software keyboard or by tapping a UIButton.
The UI button is already set up to perform an IBAction.
How do ...
0
votes
0answers
11 views
Swift Error - extra argument 'option' in call for SimpleAuth
Hi I have been battling with a swift error as I cannot match the arguments of an objective-c method
SimpleAuth.authorize("instagram",
options: ["scope" : "likes"], completion: {
...
0
votes
0answers
9 views
Label height or align top in Swift Xcode 6
I have a label on my storyboard in Xcode 6. I am using Swift. With a function text get's added to the label with a new line, so the label "grows". If I make the label higher the text just vertically ...
-3
votes
1answer
12 views
I can't see the preview of my main.storyboard on XCODE 6 [on hold]
Picture of the problem: http://i.imgur.com/eAx31J6.png
I don't know how to fix it.
Please help and thanks
0
votes
0answers
11 views
Why do I get the error “Could not find member 'alpha'” in the UIVIew.animateWithDutarion?
I have:
UIView.animateWithDuration(0.5, animations: {
self.navigationController?.tabBarController?.tabBar.alpha = 0
})
The same is with:
UIView.animateWithDuration(0.5, animations: {
...
-1
votes
2answers
22 views
call methode from one class in another (swift)
What I want to do is create a method in one class of my iOS app and then call that method from other classes in my app. Could someone explain exactly what I need to do to achieve this? Any help would ...
1
vote
0answers
6 views
Stop SKSpriteNode from leaving view (Swift)
Hello i want to prevent a SKSpriteNode from leaving the screen or to make the Node bounce back when it hits the border of the screen. And is it also possible to call a function when its hits the ...
0
votes
2answers
16 views
Custom UITableViewCell Remove Seperation
I am appending a number of custom UITableViewCell into a UITableView, I have set the constraints so that there is no margin, however i cannot get rid of a small white line below it!
Does anyone ...
0
votes
2answers
21 views
NSRange in Strings having dialects
I was working on an app, which takes input in a language called "Tamil". So in order to find the range of any particular charater in the string i have used the below code.
var range = ...
0
votes
2answers
8 views
xCode 6 using UIPageViewController and swift changing view size
I'm loading views into a UIPageViewController and scrolling through them horizontally.
My issue is that when a view enters screen, it has a bigger size, and when the scroll finishes, it snaps to the ...
0
votes
0answers
6 views
xcode 6 Swift compiler error googleAdsSDK
I ad GoogleAdSDK to my Swift Project, ad the frameworks, create a header file, in BuildSettings set "other linker flags" to -ObjC and the path to my header.h in "Objective-C Bridging Header.
As long ...
0
votes
0answers
9 views
how to set view in middle between two uiview using constraint in swift
I have developed one app in swift xcode 6.0.1 in that i can use storyboard, and in this three UIView 1st UIView set in top and 3rd UIView set in bottom and i have set 2nd UIView in middle so how that ...
0
votes
1answer
18 views
XCode 6.1: Weird behaviour in Swift code highlighting
I just started to take a look into Swift but XCode is messing up the code highlighting. As shown in the picture below
Due some bad performance issues with Swift, I am using XCode Version 6.1 ...
0
votes
0answers
19 views
Swift- Set Visible menucontroller
I'm trying to display a UimenuController but I can not view it. how can I do?
let MenuController: UIMenuController = UIMenuController.sharedMenuController()
MenuController.menuVisible = true
...
2
votes
0answers
21 views
Swift class to interact with Interface Builder via IBOutlet
Good evening all,
I'm slowly working through my first OS X app. I have been having a hard time getting my Swift class to interact with an NSPopUpButton. Just to make sure I was doing it right, I ...
1
vote
0answers
30 views
iOS 8 Orientation change: Keyboard frame does not display correctly
This is only an iOS 8 problem, the keyboard displays correctly in iOS 7 with device orientation change. My application supports both portrait and landscape orientation and uses autolayout.
If I push ...
1
vote
0answers
14 views
Cannot generate NSManageObject for objective C after introducing Swift in project
Since I added swift classes to my objective C project, the "Create NSManagedObject Subclass..." options has no effect anymore. It works find apparently with event the message indicating that the ...
1
vote
0answers
22 views
Textview caret/cursor is cut off at the bottom ios8
I have been struggling with what may be a bug in Xcode 6.0.1. I am building an app which has a similar scene as the apple compose section in the mail app. I am using
func textViewDidChange(textView: ...
-1
votes
0answers
24 views
calling an action in UIAlertAction
hello i created an action for the button Home (return to app home)
how can i call this action here
@IBAction func up(sender: AnyObject) {
let returnHome = NSLocalizedString("Home", comment: ...
1
vote
1answer
31 views
In XCODE / Swift, how can I create a single function which can be called from various view controllers?
I would like to implement a set of functions and that they be called by various view controllers in my app.
Whats the best approach for this?
An example of a function to be used throughout the app ...
0
votes
1answer
22 views
beginner swift sprite kit - arc4random and getting screen size
I want to get a random number to be in between my background width and to be 37 pixels away from the margins but it doesn't work
var width = UInt32(self.frame.width - 74)
var newX = ...
1
vote
0answers
25 views
Why Xcode GM candidate 2 keeps crashing when debugging swift code?
I am little concerned in here, I have been developing an app in Swift and I have gone through all the Xcode betas doing my best without the debugger, using println() like every two lines. All this ...
-1
votes
0answers
13 views
Creating a Geosocial Networking App with Swift and Xcode
Hi I'm brand new to programming and Swift.
I am trying to create a Geosocial Networking app where it shows other members nearby and displays members in a square grid style just showing photos and ...
0
votes
2answers
45 views
How to allow only one cell to be clickable
I am trying to add a tick next to a user selection to indicate that the user has guessed at a particular place.
Currently, my logic allows for all cells to be clicked as can be seen below;
How can ...
0
votes
1answer
44 views
Table View In Swift
I am trying to configure a page to look something as follows - where I have a standard view controller with a table view inside of it.
I have my prototype cell denied, so I can configure these in ...
0
votes
1answer
14 views
UINavigationbar barTintColor not working in UISplitview Template
I am trying for hours to change the Navigationbar barTintValue in my App.
I am using the Master-Detail Template from Xcode using Swift and
I read a lots of questions here, but the answer was always to ...
2
votes
2answers
30 views
Scrooling up until the last item in UITableView
I'm trying to learn iOS development using swift, and I have encountered something I couldn't find a solution for.
I want to modify a UITableView so that I can scroll upwards until the last item for ...
0
votes
1answer
35 views
XCode 6 - Navigation Bar width Button
I have an "Any Any" View Controller. There I placed a Navigation Bar and set "Horizontal Center in Container". Now it's in the middle of my View.
But when I place a Bar Button Item on the right hand ...
0
votes
1answer
27 views
beginner xcode swift sprite kit - remove sprite by name crash
I'm trying to remove some sprites when they hit the bottom. It works if I don't check the name but it removes my background too. When I try to add the name to the if it crashes.
func ...
0
votes
0answers
19 views
xCode 6 > Swift > build failed: UIView does not have a member named view
trying to log a user input to the console:
@IBAction func buttonPressed(sender: AnyObject) {
println(number.text))
}
getting build failed wi this error message:
UIView does not have a member ...
0
votes
1answer
17 views
Why Can't I Drag IBAction from Storyboard to Swift File?
I'm attempting to connect some buttons from a preferences view in my Swift OS X application.
Instead of putting all the IBActions and IBOutlets in my AppDelegate.swift file (seems messy, though I may ...
0
votes
1answer
21 views
Extended UIView class using Swift
I have been trying to subclass a UIView and using the help of http://stackoverflow.com/a/24036440/3324388 to handle the 'init(coder)' issue
However I keep running into snags with even the most basic ...
0
votes
2answers
29 views
Xcode, Parse - Handling remote notifications
I'm trying to follow the Parse Guide to handle the notifications i send in Json format, but i'm having a problem, here is my code:
func application(application: UIApplication, ...
0
votes
2answers
28 views
Difficulty appending to an array in Swift
I'm trying to format an Array with some data that I get from a Web Service. From what I tested in playground, something like this should work:
import UIKit
struct Product
{
let id: Int
let ...
0
votes
1answer
26 views
Swift: GM Xcode 6.1 And AFNetworking AFJSONResponseSerializer
Before installing GM Xcode 6.1 the below code is working fine. However after installing Xcode 6.1, I'm getting error:
I tried this, and the error was really nice.
Any idea? I haven't read the ...
0
votes
2answers
55 views
How do I start this game with a button? I'm using Xcode 6, Swift, and SpriteKit
How do I start this game with a button? I'm using Xcode 6, Swift, and SpriteKit. My game starts when I run it on the iOS Simulator, but I would like to start it by pushing a play button.
This is my ...
4
votes
1answer
45 views
How do I wait for one animation to finish before the next one starts in Swift?
How do I wait for one animation to finish before the next one starts in Swift? I have been messing around with if animation.animationDidStop... {}, but it won't work.
Here's some of my code so far:
...
1
vote
1answer
11 views
Swift: SKNode should have optional types, Optional member does not have member
I had a working and compiling Swift game before I updated to the new XCode and suddenly a lot of errors has appeared. Here is two I haven't been able to fix.
func centerOnNode(node: SKNode ) {
...
0
votes
1answer
45 views
Swift Overload init()
i will overload the init Method in Swift how i can implement that?
here my code that not work
code removed
Edit:
So it would be work fine
override init() {
super.init();
}
...
5
votes
0answers
95 views
Xcode 6.1 GM Seed's autocomplete always terminate
Today, I have downloaded Xcode 6.1 GM Seed from apple developer site so when I try to write in Swift it always crash.
Xcode's popup a notify:
SourceKit crash blah blah... Editor functionally temporary ...
2
votes
3answers
40 views
Trying to access labels from UIView
I have created a .xib file that has a bunch of labels in it to be used with SwipeView . My problem is that I can't/don't know how to access and change their text after loading the view:
let ...
-4
votes
0answers
56 views
Swift longpress Gesture with UIMenuController
I would like to ask , if there is an example to display a uimenucontroller with the longpress on the button so you can delete.
For the Gesture i do
var longPress = ...
0
votes
1answer
24 views
Is there a way to view the size of my physics body with Swift?
I know that Cocos has something called debugDraw that outlines your physics bodies. This is really helpful. Is there something similar offered in Xcode or Swift?
Can't seem to find anything. But ...
-1
votes
0answers
17 views
Swift and Xcode 6.0 Sizing Not Displaying Correcty
My problem is that when I add constraints to images, they do not size correctly. So it looks really different when you try it on different devices.
Iphone 6 Image: http://sta.sh/027d5awmyin3
Iphone ...
0
votes
0answers
23 views
Xcode , Parse.com - Push notifications don't show on my phone.
followed the guide on Parse.com on how to create a certificate and prepare a provisioning account to accept Push Notifications. When i go to Preferences/Accounts : It shows on the bottom, but when i ...
0
votes
1answer
23 views
Swift - CGPoint is not convertible to Character
I'm getting the following error:
When I print "location" I can clearly see it is a CGPoint. I want to move the position of one my sprites based on the location. In this example, I want to move the ...
0
votes
1answer
21 views
Add A Context Manager To A Single View Application
When I create a single view application in Xcode it starts of with a ViewController class that loads with the viewDidLoad function.
I've done some research but can't quite seem to figure out how to ...
1
vote
1answer
47 views
+50
List files in iTunes shared folder using Swift
I would like to list all files in my iTunes shared folder in a 'Table View' using Swift.
I check on Google and nobody talk about it, it look like it's a uncommon need, so if anyone can help it would ...
0
votes
1answer
32 views
Xcode 6 constraints on different sizes
I'm doing an iPhone app using Xcode 6
My problem here is, I add a constraint to an image, and all is fine, and than I try to add another constraint on a smaller screen and I get the error on the ...
0
votes
2answers
48 views
Repeating a Background Image in Swift
Im using swift programming language in xcode and in spritekit. I want to get my background image to scroll forever. I have this code so far but when I run it in the simulator it goes through only one ...