FAQ Database Discussion Community


How to subclass different View Controllers in Swift

ios,swift,uiviewcontroller,xcode6
How do I subclass different view controllers? This is what I've been trying to use: class secondViewController: UIViewController { This returns the error "Use of undeclared type UIViewController." What am I doing wrong? I have started this class in a new .swift file, is that somehow contributing to the problem?...

Swift - Compiler warns i haven't unwrapped an optional but then forces me to unwrap using ! rather than?

swift,xcode6,compiler-warnings,optional-values,forced-unwrapping
I've got an error in my code where the compiler gives a warning to unwrap an optional with the message Value of optional type 'NSDate?' not unwrapped; did you mean to use '!' or '?'? My code is let formatter = NSDateFormatter() let dob = currUser.valueForKey(userTextFieldKeyNames[i]) as? NSDate let dobText...

Do some code before segue? (Answered)

swift,xcode6
I wanted to make a converter, This is how it works: On the initial screen, it asks from which unit you wanna convert, then when the user clicks on the button it sends the title of the button as string to the next view controller, then using the if statement...

Add UIButton above new library ViewController

ios,objective-c,xcode,xcode6
I have imported a third party library into my project which I am calling it's main ViewController from the appDelegate of my original project. I am trying to add a backButton (without changing the code of the third party library). I am presenting the VC in my AppDelegate with the...

PresentViewController Troubleshooting

ios,swift,xcode6
In my swift app I am trying to make it so that a button tap switches view controllers. This is the code I am using: presentViewController(pythTheoremViewController.self, animated: true, completion: nil) This returns the error "Cannot invoke 'presentViewController' with an argument list of type')pythTheoremViewController.Type, animated: Bool, completion: nil) What does this...

Xcode not recognizing declared variable? [duplicate]

ios,swift,xcode6
This question already has an answer here: Inappropriate Expected declaration error 1 answer i have just created a new class within my Controller file like such : import UIKit class FirstTableViewController: UITableViewController { class Sport { var name: String = "sport name" var branches: NSArray = [" branches of...

prepareForSegue UICollectionView not working (swift)

ios,swift,xcode6,uicollectionview,segue
I’ve tried to push segue by using UICollectionView (show image form MasterView to DeatilView) but is not working. Xcode also doesn’t show any error message. What’s wrong with my code. I need some advice. override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if segue.identifier == "showDetail" { if let indexPath =...

Expected declaration error when adding subview

ios,swift,xcode6
Hi I got a "Expected declaration" error when I tried to add a subview to my UIView, here's the code: @IBDesignable class TimePickerView: UIView { /* // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. override func drawRect(rect: CGRect) { //...

Header file not found in DemoTests?

ios,xcode6
I have add google map framework in xcode. When I added GoogleMaps/GoogleMaps.h framework in appdelegate.h or .m it works well. also when I added this framework viewcontroller.h and .m it works. but when I tried to import this framework in DemoGoogleMapTests.m it gives error "GoogleMaps/GoogleMaps.h" file not found. appreciate for...

Property 'package_number_7' not found on object of type 'User *' after Lightweight Migration

ios,objective-c,xcode,core-data,xcode6
I have a CoreData based application. In my data model I've changed data model just by add to User entity row "package_number_7" and use Lightwight Migration (just adjust appdelegate) .. Now when I want to use this "package_number_7" in fetch request it's not working. here is sample code from viewcontroller...

How can I open an Image in a default Image Viewer by providing the path of the file?

ios,xcode,xcode6
In my project if a user clicks on an Image I will get the path with file name of the Image. I need to open the Image in a default Image Viewer of iPhone. Thanks in advance...

Hidden Values in UIPickerView

ios,uiviewcontroller,xcode6,uipickerview
As beginner in iOS Developing I struggle with specific implementation ofUIPickerView. I already know how to createUIPickerView with specific data. My goal is a bit complicated though - I would like this PickerView to print me selected value. For example - like in simple currency calculator - I pick EUR...

Issue with nested Framework for Watchkit Extension

ios,xcode6,watchkit,apple-watch,ios-frameworks
My Watchkit app does not work in production (TestFlight && rejected from AppStore). I think the issue come from a nested framework. Here the architecture : I've made a framework "ModelLayer" (Cocoa Touch Framework) with the app's model, so it can be shared across all targets. This framework use another...

Apple WatchKit with Xcode 6.3.2 - not able to create a project?

xcode6,watchkit
I'm using Xcode 6.3.2 (6D2105) but when i try to create a project for or with the watchKit there is no template for watchKit or the apple watch. What do i need to download or install in addition to create project for the apple watch?

Xcode build error 'InputFile' should have exactly five arguments

osx,cocoa,xcode6
I am using Xcode 6.2 (6C131e) to build my cocoa project. It was working very smoothly but today i got following error: 2015-06-01 11:53:59.911 xcodebuild[2060:184936] error: InputFile /Users/parag/workspace/myapp for Mac/Mac/HelperTool-Prefix.pch 0 1429610467 187 33188... malformed line 9; 'InputFile' should have exactly five arguments Can anyone please help me out?...

sizeWithFont does not get marked as deprecated when working with array, it is safe then?

ios,objective-c,xcode6,deprecated
If I write it as follows no deprecation alert shows up: NSArray *aboutInfo=[NSArray arrayWithObject:@"blah"]; CGSize textSize = [[aboutInfo objectAtIndex:0] sizeWithFont:[UIFont systemFontOfSize: 14.0] constrainedToSize:wSz2xh lineBreakMode:NSLineBreakByWordWrapping ]; However this is marked as deprecated: NSString *aboutInfo=@"blah"; CGSize textSize = [aboutInfo sizeWithFont:[UIFont systemFontOfSize: 14.0] constrainedToSize:wSz2xh lineBreakMode:NSLineBreakByWordWrapping ]; Both work fine. Would that mean that...

Info.plist not in correct format

ios,objective-c,xcode,xcode6,info-plist
I was working through my iOS Xcode project just fine, and then all of a sudden when I tried to run it, I started getting the error below: error: couldn't parse contents of '/Users/pavitarsidhu/Desktop/AmigoDash/SidebarDemo/AmigoDash-Info.plist': The data couldn’t be read because it isn’t in the correct format. I'm really confused. I've...

Does Clang Static Analyzer can be used with Swift?

swift,xcode6,clang-static-analyzer
When I analyse a Swift project on Xcode 6, the build succeed with no issues. So I wonder if the Clang Static Analyser work with Swift!

In App Notifications For Social App IOS

ios,push-notification,xcode6
Does anybody know a way to implement in app notifications? For example like Facebook and Twitter have notifications in the app so if you receive a message or have been tagged you get a notification inside the app. Then when you click that notification it shows you a list of...

Unified title and toolbar in swift with storyboards without title visibilty

osx,swift,cocoa,xcode6
I want unified title toolbar like in calendar app without title. I have tried following- in viewDidLoad I added- self.view.window?.titleVisibility = .Hidden I have selected unified title and toolbar in attribute inspector. I also tried adding titleVisibility to 1 in user defined runtime attributes in identity inspector. I am not...

Image inside html in UIWebview not fit properly

iphone,ios8,uiwebview,xcode6
I want to show google updates ,webpages are responsive but image width is not showing properly and go out of the boundary. Here is content of webpage. <div dir="ltr" style="text-align: left;" trbidi="on"><span id="docs-internal-guid-489c1670-b0dc-d32d-645e-eaf6ca555069"><span style="font-family: Verdana; font-size: 13.3333333333333px; font-weight: bold; vertical-align: baseline; white-space: pre-wrap;"><img alt="whats_new_doc_header_may2015LL.gif" height="112px;"...

Apple Health Kit Error Domain=com.apple.healthkit Code=5 “Authorization not determined”

ios,objective-c,xcode6,health-kit
I have determined authorization before actually trying to save any data or do anything with it. The error is happening at the moment of query: HKSampleQuery *query = [[HKSampleQuery alloc] initWithSampleType:foodType predicate:predicate limit:HKObjectQueryNoLimit sortDescriptors:nil resultsHandler:^(HKSampleQuery *query, NSArray *results, NSError *error){ ... } Yes, I have read apple documentation that says:...

iOS : pod update (unable to find the utility “xcode-select”)

ios,xcode,osx,xcode6,cocoapods
xI am a new iOS developer. Recently when I ran "pod update" sth just went wrong see the detail in the following: (unable to find the utility "xcode-select") bash-3.2$ pod install Analyzing dependencies sh: line 1: 4936 Abort trap: 6 /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk / -find xcode-select 2> /dev/null xcrun: error: unable...

Could not find '+' that accepts the supplied arguments

swift,xcode6
I am trying to make a monthly Loan payment calculator here is the code for it: import UIKit class monthlypayment: UIViewController { @IBOutlet weak var loanamounttextfield: UITextField! @IBOutlet weak var numberofmonthstextfield: UITextField! @IBOutlet weak var loanpercentagetextfield: UITextField! @IBOutlet weak var answerlabel: UILabel! @IBAction func calculate(sender: AnyObject) { var loanamounttext =...

How to add a Notification Scene to WatchKit target after it has been created?

ios,xcode,xcode6,watchkit
I have already created a WatchKit Target without a notification scene, or glance scene. Is there any way I can add either of those two scenes after the target has been created?...

UITableview with more than One Custom Cells with Swift

swift,uitableview,ios8,xcode6
As absolute beginner I have to ask those questions: I want to use a UItableview with different custom TableviewCells. One Cell should have an image and a label. Another cell should have two label. A third cell should have a dayPicker. I don't have to create Tage cell in the...

How to calculate values based on neighbouring rows in UITableView

ios,swift,xcode6
I have an Xcode Swift application that is using a UITableView to display a list of results. Each row has a value which is calculated to be the difference of a value in the next row. When the data loads, all is good. However I noticed that, as I have...

why is my app stalling when the play button is tapped

ios,swift,uiviewcontroller,uibutton,xcode6
import UIKit class ViewController: UIViewController { var timerCount = 5 var timerRunning = false var timer = NSTimer() func shuffle<C: MutableCollectionType where C.Index == Int>(var list: C) -> C { let c = count(list) for i in 0..<(c - 1) { let j = Int(arc4random_uniform(UInt32(c - i))) + i swap(&list[i],...

How can I show Google maps into a WebView?

swift,uiwebview,xcode6
When I click the button my app shows a map: it opens the google map perfectly in the browser safari. Now I just want to show the map into a WebView, how can I do it please? Here is the code I use to show the map: @IBAction func newAction(sender:...

One storyboard not seeing localization .strings while the other one localizes perfectly

ios,ios8,localization,xcode6,xcode6.3
I have two storyboards in my app, and I'm trying to add Turkish language option to both using localizable strings. My main storyboard maps just fine; when I change simulator language to Turkish, it loads the Turkish strings and displays them perfectly. However, my other storyboard still displays in English....

How to display any coordinate on indoor floor plan? [closed]

ios,xcode6,indoor-positioning-system,footprint
I am using iBeacons for indoor positioning system and my algorithm generates user's 2D coordinate at any point in floor plan. I need to display this coordinate on screen of iOS device as a footprint. I got some ideas from Footprint (Apple) but couldn't figure out the exact way to...

UIPopoverController arrow not the same white as my UINavigationBar

ios,objective-c,xcode6,uipopovercontroller
So the problem that I have is my UIPopoverController's arrow is a different color to my UINavigationBar color. If you look at the image there is a slight shadow on the white and you can see it is not the same white: This only happens on iOS 8 and not...

Install multiple Pods in swift

swift,google-analytics,xcode6,cocoapods
I currently have the Google Places Pod in my Xcode workspace. I would also like to use Google analytics. Should I just add pod 'Google/Analytics', '~> 1.0.0' to my Podfile and run pod install again the same as I did the first time? Thanks...

Delete row in TableView and remove the core data - iOS / Swift

swift,core-data,xcode6,delete-row
I am having an issue with my swift app. I am trying to implement the swipe feature that will prompt the user with the "DELETE" option. As of right now my code only allows me to swipe but the delete button is not being generated. I am currently using Xcode...

Get no. Of words in swift for average calculator

arrays,swift,xcode6
I want to an algorithm that could help find out how many words are there in a string separated by space or comma or some character. And then append each word separated by a character to an array which could be added up later I'm making an average calculator so...

Getting nil values in Swift when i create new Instance to the class

ios,xcode,swift,xcode6
I am getting problem in swift with the creating new instance to the class. I am setting a dictionary to HttpVo class in the httpUtils but unable to get that dictionay in other place by creating new instance to the same class. Thanks This is my demo project you can...

Mach-o Linker Error

objective-c,xcode6,linker-error,mach-o
I can't build my project because I keep getting this error. As I understood it deals with the constant tagShift I'm using in my code. I would appreciate if anyone could help me to solve this issue

Alamofire “installation” not working (red text in Embedded Binaries)

ios,xcode,swift,xcode6,alamofire
I am trying to add Alamofire to my xcode v6.3.2 project but it's not working for me. I followed all the steps in the readme from the github repo but when I select the framework to add as an "Embedded Binary" it shows with red text and is not available...

How do I compare the value of password stored in CoreData with user input?

swift,core-data,ios8,xcode6
This is the code for login page where I want to compare input with stored data. import UIKit import CoreData class ViewController: UIViewController { @IBOutlet weak var userName: UITextField! @IBOutlet weak var passwordText: UITextField! @IBAction func login(sender: AnyObject) { var appdel : AppDelegate = (UIApplication.sharedApplication().delegate as! AppDelegate) var context :...

GeneratorOf Cannot find an initializer Error

ios,swift,xcode6
My attempts to understand Generators and Sequences lead me to an idea to implement a Fibonacci sequence. This works perfect: struct FibonacciGenerator : GeneratorType { typealias Element = Int var current = 0, nextValue = 1 mutating func next() -> Int? { let ret = current current = nextValue nextValue...

Pods project with App Extension started failing to build

ios,xcode,xcode6,cocoapods,ios-app-extension
I was working on my app, haven't changed any setting or pod, and I tried to archive a build after about two weeks, and it failed. Then I tried to debug build (normal Cmd+R) and it failed with the error: ld: library not found for -lPods-AFNetworking I've tried pod install...

XCode will build 'debug' but not 'release' because “-Swift.h” header is not found

xcode,osx,swift,xcode6
G'day, This is really killing me my framework project builds without error or warning in the debug configuration, but when I try to build for archive it fails because the <Module>-Swift.h is not found. Apparently it's not being generated in this configuration. Sometimes when this happens (in Debug) I can...

How can I get the length of text entered into UITextView as the user types?

ios,objective-c,xcode6,uitextview,uitextviewdelegate
I have aUITextView. I would like to have a way of updating aUILabel as the user times to indicate how many remaining characters are permitted? In theViewController theUITextView is referenced as IBOutlet UITextView *message; I have tried looking at the show connections inspector and I don't see an edit changed...

Swift - How to disable a button after being clicked 3 times in a row?

swift,xcode6
I have a button in a viewcontroller. I need to make it so the button is disabled if clicked 3 times in a row. Then if the user clicks on any other button (or meets another condition), the button should be enabled again.

Is there a way to use height map with scene kit iOS?

ios,xcode,xcode6,scenekit
Can I use height map with scene kit? Is there a function or api that I can use to achieve that? I would like to make a game and it would really help me....

Xcode: Issue adding localization to my project (Resource file / Reference language not found)

ios,xcode,xcode6,storyboard
I'm trying to add a Spanish version for my app. I'm following several tutorials and they all get me to this point: Screenshot from http://www.raywenderlich.com/64401/internationalization-tutorial-for-ios-2014 But when I try doing the same thing step by step in my existing project, I don't see any files to choose from: What do...

The last inserted row id in database is successfully inserted but to get that id is 0?

ios,objective-c,iphone,sqlite3,xcode6
This is the last row inserted method that return me the last id. Code: -(int)LastId { int noteID; NSString * sqlStr; sqlStr = [NSString stringWithFormat:@"select * from notes"]; sqlite3_stmt *ReturnStatement = (sqlite3_stmt *) [self getStatement: sqlStr]; while(sqlite3_step(ReturnStatement) == SQLITE_ROW){ @try{ noteID=[[NSString stringWithUTF8String:(char *)sqlite3_column_text(ReturnStatement, 0)] intValue]; } @catch (NSException *ept) {...

Warning when presenting UIActivityViewController

ios,swift,xcode6,uistoryboard
When i present an UIActivityController using the code below i get, it is presented but the console shows "Warning: Attempt to present <UIActivityViewController: 0x7f8788e7aed0> on <MyApp.CustomTableViewController: 0x7f8788e3db60> which is already presenting (null)". @IBAction func shareImage(sender: AnyObject) { let images: [UIImage] = [image.image!] let activityViewController = UIActivityViewController(activityItems: images, applicationActivities: nil) self.presentViewController(activityViewController,...

Activity indicator starts before function is called

ios,swift,xcode6,uiactivityindicatorview
I have a button that calls this IBAction function. The activity indicator starts as soon as the app runs instead of when the button is tapped, disappears as expected when the function completes its work then never appears again. This seems like a really simple interface thing but I'm stumped....

getting null in InAppPurchase product name and description

ios,objective-c,swift,xcode6,in-app-purchase
My app was okay a few days ago. But from past 4-5 days when I retrieve product list from app store the product name and description is null but its identifier and price is okay. I didn't changed anything after last working code. What might be the reason, any hints?...

xcode 6 import enterprise provisioning profile

xcode,xcode6,provisioning-profile
I have received new mobileproviion file and certificate from my company i.e. the enterprise distribution profile. Could you please let me know How to import the mobileprovision profile into xcode 6.

Swift 1.2: GAI -> Cannot invoke 'send' with an argument list of type '(NSMutableDictionary!)'

ios,objective-c,swift,google-analytics,xcode6
I'm trying to convert this into Swift 1.2: GAI.sharedInstance().defaultTracker.send(GAIDictionaryBuilder.createEventWithCategory("ui_action", action: "app_launched",label:"launch",value:nil).build()) This is my best attempt: let build = GAIDictionaryBuilder.createEventWithCategory("ui_action", action: "app_launched",label:"launch",value:nil) GAI.sharedInstance().defaultTracker.send(build: [NSObject : AnyObject]) But it keeps on resulting into this: Cannot invoke 'send' with an argument list of type '(NSMutableDictionary!)' Could someone...

iOS Swift: Using AWS SDK with xCode6 - error message

ios,xcode,swift,xcode6,aws-sdk
Using CocoaPods have added the AWS libraries to my project. Created a BridgingHeader.h file: #import "AWSCore.h" #import "AWSCognito.h" #import "AWSS3.h" In application Build Settings > Objective-C Bridging Headers included this BridgingHeader.h file. Now in my code when i use the credentials initialisation code: let credentialsProvider = AWSCognitoCredentialsProvider.credentialsWithRegionType( AWSRegionType.USEast1, accountId: "999999999999",...

I want my image in xCode to fade in

xcode6,fade,duration
I want my image to fade IN, not out. With this code, it's backwards. Any help? [UIView animateWithDuration:3.0 animations:^{ self.circleOne.alpha = 0.0; }]; ...

UITableViewRowAction: Delete

uitableview,swift,xcode6
I want to let the user to be able to delete a table cell at the moment I have the delete swipe action but I don't know how to actually delete the selected cell! As you can tell I am programming in Swift and Xcode 6.3.1 var deleteAction = UITableViewRowAction(style:...

iOS - Autolayout - Increase/Decrease view size proportionally on orientation change

ios,xcode6,autolayout
I went through ray wenderlich's tutorial about autolayouts (link) and then began working on a demo project thinking I've figured it all out but I was wrong. As shown in the screenshot below I have a navigation bar, 2 views and 1 button. The layout on portrait mode looks fine...

How to always show debug window in XCode6

xcode,xcode6
I'm having trouble keeping my debug window open in XCode6. Every time I run the code the debug window disappears. I then have to press CMD SHIFT Y to show it again or use the upper right window icon. How do I make the debugger window stay at all times?

Getting a Expected identifier or '(' issue in Xcode 6.1

c,pointers,hashmap,xcode6,expected-exception
I'm quite new to C. I've tried other links but no dice. I'm using Xcode 6.1 and I get the following issues: Parse Issue: Expected identifier or '(' Semantic Issue: Unexpected type name 'map' Here's my code: //hashmap.h #ifndef __HashMap__hashmap__ #define __HashMap__hashmap__ void map_init(); void map_insert(uint8_t, uint8_t); uint8_t map_getVal(uint8_t); #endif...

Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier

ios,xcode,xcode6
I trying to compile the Lister example code from app and I keep getting the error below: error: Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier. Embedded Binary Bundle Identifier: com.example.apple-samplecode.Lister.watchkitextension Parent App Bundle Identifier: nz.co.icaro.listner.Lister I already change the bundle name, the name of...

UILabel blinking effect

ios,objective-c,iphone,xcode6
I am using UIButton with blinking effect. I have used this code for blinking effect on UIButton UIButton *random = (UIButton *)[self.view viewWithTag:i+20]; random.alpha = 0; [UIView animateWithDuration:0.2 delay:0.2 options:UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse animations:^{ random.alpha = 1; } completion:nil]; This code will blink the UIButton but I want to stop this...

What is the proper way to search for regions in CoreLocation with Swift?

ios,swift,xcode6,bluetooth-lowenergy,core-location
I've been working with a number of tutorials and continuously have the exact same issue with each of them. When I run the following code or other incarnations of it in other tutorials, I keep getting: 2015-06-12 13:50:33.797 Scanner[4599:2593734] *** Assertion failure in -[CLLocationManager startRangingBeaconsInRegion:], /SourceCache/CoreLocationFramework/CoreLocation-1756.0.20/Framework/CoreLocation/CLLocationManager.m:1129 2015-06-12 13:50:33.798 Scanner[4599:2593734] ***...

UITableView Customize Cell

ios,xcode6
I am trying ti implement table view cell with customization in that case i need to make a dynamic Heights in specific cell not at all. show is this possible to define dynamic height for uictableview cell and if yes the how can i perform this operation ? Thank You....

Dealing with graphical assets for iPhone 5/5S/6/6 Plus

ios,iphone,xcode6,iphone-6,iphone-6-plus
Since the induction of 6 and 6 plus its the first time I'm starting to work on a new app. Now I'm a bit confused about the use of graphical assets for my app. See for 5/5S things were pretty simple. If I have to make an image view of...

Swift Core Data - Group doesn't Work

ios,objective-c,swift,xcode6,nsfetchrequest
I am working on a simple iOS Swift app and can't find any solution for a small problem with core data. I have to group some data which i fetch out of core data, but it doesn't work. This is my fetchRequest: <NSFetchRequest: 0x7f82fbe105e0> (entity: Sets; predicate: ((null)); sortDescriptors: ((...

Why does the window background remain black in fullscreen?

osx,swift,cocoa,xcode6,storyboard
I have created a window without title by- override func windowDidLoad() { super.windowDidLoad() self.window?.styleMask = NSBorderlessWindowMask self.window?.movableByWindowBackground = true } I have set canBecomeKeyWindow by- override var canBecomeKeyWindow:Bool { get{ return true } } I have changed the background color of container view by- override func drawRect(dirtyRect: NSRect) { super.drawRect(dirtyRect)...

Xcode no longer autocompletes #import statements

xcode,xcode6
Running Xcode 6.3.2 OSX 10.10.3. On my rMBP 2012, Xcode isn't auto-complete statements #import, but my rMBP 2014 is. It's able to autocomplete code snippets and other code statements. Not sure what other information I can give, it just started happening a couple of months ago....

Swift - UIImageview URL slideshow

ios,swift,uiimageview,xcode6,slideshow
Hello everyone I have a problem I can not solve , I have an application written in Object C and I wanted to make it or rewrite it or compatible with Swift . Being novice with Swift would like to know how I can set this piece of code written...

Edited UITableViewController in storyboard and after defining the VC class

uitableview,swift,xcode6,storyboard,tableview
I am using swift and XCode 6.3.1. I edited a table view controller in storyboard with static cells. Wanting to program a label and a outlet, I created a new UITableViewController Cocoa Touch File and defined the view controllers class the Cocoa Touch File that I just made. However once...

Managing multiple versions of an iOS App

ios,swift,xcode6
Lets say I have an iOS App for let's say, Football news, now I want to create an other version for Basketball news that will be based mostly on the Football App but with a freedom to create a different behaviour in some aspects of each app + adding more...

NSURLRequest setAllowsAnyHTTPSCertificate to Swift

objective-c,swift,xcode6
What is the equivalent Swift code of the Objective-C code below? [NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:[url host]]; ...

UISplitViewController - Use as slideout-style menu

ios,iphone,swift,xcode6,uisplitviewcontroller
I'm struggling a bit with the new UISplitViewController in iOS 8. I want to achieve a slideout-style menu on iPhone (landscape and portrait) as well as on iPad in portrait orientation and a persistent sidebar on iPad in landscape orientation. I got a UITableViewController as the master and a UINavigationController...

How to make a view with picker and toolbar stay at the bottom of iphone screen

ios,xcode6,interface-builder
I am using this code and its placing my view at the top of the viewing area instead of the bottom. Any idea what I am doing wrong? I am not creating the view in swift because I already have it created in IB with a toolbar and pickerview inside...

Set RootViewController in UIViewController

ios,xcode6
Currently i working on iOS App and my requirement is to set TabbarController as a root view controller in all the upcoming features ViewController. so anyone can please suggest me how it possible ? This my TabBarController and this was Viewcontroller for Edit Profile which is outside viewcontroller means not...

Retrieving CreatedAt Data From Parse - Swift

ios,swift,parse.com,xcode6
I want to retrieve the createdAt column data from parse via swift. But somehow I am getting a "unexpectedly found nil while unwrapping an Optional value" error. I am using the below code to retrieve the data, when I uncomment the createdAT part, the rest data is retrieved well in...

JSON: read array from DB

json,database,swift,xcode6
I need to get the location from the database, it's an array. I already try a lot of code but every code get me an error like "Could not cast a value of type NSArray to NSDictionary" or something like that. This is my last try: let jsonData:NSDictionary = NSJSONSerialization.JSONObjectWithData(urlData!,...

Textview Frame is become squeez and cannot come back to its original form?

ios,objective-c,iphone,xcode6,uitextview
keyboardWillShow method implementation : - (void)keyboardWillShow:(NSNotification *)notification { [UIView beginAnimations:nil context:nil]; CGRect endRect = [[notification.userInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue]; CGRect newRect = txtNotes.frame; //Down size your text view newRect.size.height -= endRect.size.height; txtNotes.frame = newRect; [UIView commitAnimations]; } keyboardWillHide method implementation : - (void)keyboardWillHide:(NSNotification *)notification { // Resize your textview when keyboard...

Custom TableViewCell without storyboard

ios,swift,xcode6
I am using custom cocoa class extends from TableViewCell and it doesn't give any error message but the cells do not appear in the tableview. The scroll gets longer but the table cells are not viewable. I typed this in my ViewController : tableView.registerClass(CustomTableViewCell.self, forCellReuseIdentifier: "Cell") func tableView(tableView: UITableView, cellForRowAtIndexPath...

How can Create Model class in swift and get values form model class in another class [closed]

ios,xcode,swift,xcode6
How can i create model class in Swift. I am getting errors wile accessing values form the model class. Thank you. Here I am attaching my demo project, U can download it

How can I get an image to fit the whole screen?

ios,swift,uiimageview,xcode6
I'm new to Swift, and I'm trying to make an image in a tabbed application fill the whole screen. This is what I've got so far. let imageName = "bkgrd" let image = UIImage(named: imageName) let imageView = UIImageView(image: image!) imageView.frame = CGRect( 0, 0, 100, 200) However this doesn't...

how/where do Xcode 6 launch screen sizes correspond to Apple docs?

iphone,xcode6
I am sure this info is somewhere but I can't find it, and the Apple Developer hotline seems to have no idea what I'm talking about. In the assets library for launch screen in Xcode, there are slots labeled: iPhone Portrait ---> Retina HD 5.5 & Retina HD 4.7 iOS8...

DrawRect overriding properties of view

ios,swift,uiview,xcode6
I'm creating a custom view which will basically just be a checkmark inside a cirlce. I've created a circle using layer.cornerRadius = 0.5 * frame.width but when I override drawRect, it causes that line to be ignored and my view becomes a square. Why is this? And how can I...

changing UITableViewCell text font

uitableview,swift,xcode6,uifont,textlabel
I was able to change the font of the tableViewCell text using this code cell.textLabel?.font = UIFont(name: "Snell Roundhand", size: 40) However i would also like to make this font bold, so far I've tried to do this by using this code cell.textLabel?.font = UIFont.boldSystemFontOfSize(40) Although this does change the...

IOS XIB storyboard Launch Screen file displays wrong orientation of an image inside

ios,iphone,xcode6,orientation
I am using js based app with the support of ejecta kitchen. My problem is an image which i have set on the MainWindow that displays wrong orientation or in other words it displays fixed orientation. My application require everything to be displays in landscape mode but XIB file display...

Prevent user from entering more characters into uitextview

ios7,xcode6,uitextview,edit
How could I prevent the user from entering any more characters into a uitextview after the textview has reached a given height? Here is the code I thought would work but does not. I can't put in any more characters but for some reason I can't even delete any.. -...

Xcode - Communication Failed

xcode,xcode6
When I'm trying to submit a build to AppStore I'm get "Communication Failed" error: "An error occurred while communicating with the Member Center. Please file a bug and include a copy of your System log from Console.app: http://bugreporter.apple.com/." How to fix it? I'm using Xcode 6.3.2 (6D2105)...

How to set layout constraints for variable hight calculated at run time?

ios,xcode6,autolayout,size-classes
I have a UIView with 3 UIViews as its subviews. I have set layout constraints for these subview as fixed aspect ratio. i.e if the screen size changes their width will change but aspect ratio will always be the same. Now i have also made width of the UIView (the...

Xcode 6 crashes on submitting Archive

xcode,xcode6
Today I uploaded my first build of first app successfully to App Store for beta testing. After making a few changes, when I tried to submit the new archive again Xcode crashed, and still crashes. It's the log: Process: Xcode [36810] Path: /Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 6.3.2 (7718) Build Info:...

Coco2dx - Changing To Background Image

ios,iphone,xcode,xcode6,ios-simulator
I need someone's help. Actually I have no idea what to replace to get a custom background image. I'm just can't do it anymore. -(id) init { // always call "super" init // Apple recommends to re-assign "self" with the "super's" return value if( (self=[super initWithColor:ccc4(219,31,94, 999)]) ) { ws=[[CCDirector...

create a popup window with just a textview/string and a button SWIFT ios 8

iphone,swift,ios8,popup,xcode6
I am very new to ios 8 and swift but I have not found a way to make a simple popup window whenever a button is pushed. I payed for tutorials and they still don't cover it. All i would like is for when the user pushes a button (the...

Fix iOS ipa file (missing code-signing certificate)

ios,xcode,xcode6,application-loader
I'm able to compile and deploy my iPad app to my iPad device with no problems. But when I use Apple's Application Loader program to submit the ipa to iTunes Connect, I always get this error: Invalid Provisioning Profile and Missing code-signing certificate. Is there any way with xcode or...

Loading multiple saved images in app slows it down

ios,swift,uiimage,xcode6
I am developing an app where user can save 13 screenshots and display them on a single view as thumbnails or as a full screen image. let fileName:String = self.stickerUsed + ".png" var arrayPaths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as NSString var pngFileName = arrayPaths.stringByAppendingPathComponent(fileName) UIImagePNGRepresentation(screenshot).writeToFile(pngFileName, atomically:true) NSUserDefaults.standardUserDefaults().setObject(fileName, forKey: self.stickerUsed)...

swift multilpe pickerView

ios,swift,xcode6,uipickerview
I can't seem to get all of my three options to appear when I populate my picker view. It will only give me the last selected column result. import UIKit class ViewThree: UIViewController, UIPickerViewDelegate { @IBOutlet var sizePicker: UIPickerView! var wheelContents:[[String]] = [] var one = ["1", "2"] var two...

Undefined symbols for architecture i386: “_sqlite3_open”, referenced from:

ios,objective-c,sqlite3,xcode6
i have sqlite3.dylib also in my application, but it give me that upper error i don't know that how to fix this error. please someone help me i am waiting? Undefined symbols for architecture i386: "_sqlite3_open", referenced from: -[MyDataBase openOrCreateDatabase:] in MyDataBase.o "_sqlite3_exec", referenced from: -[MyDataBase createTable:] in MyDataBase.o -[MyDataBase...

Displaying random questions by looping through a dictionary

ios,swift,dictionary,random,xcode6
I started to learn swift by trying to make a quiz game. But i'm stuck at trying to display random questions from an dictionary. The reason why i use a dictionary is because the quiz i'm working on is based on chemistry elements which has different symbols. So Based on...

IOS - Objective C - How do I remove Tableview Menu from my Login View Controller?

ios,objective-c,uitableview,uiviewcontroller,xcode6
In my iOS Project, there is a login ViewController that sends the user to a TabViewController if he has the right credentials. This TabViewController has 5 tabs, the fifth one is for Logout, which send the user back to the Login ViewController, and of course clears out the already filled...

Swift: NSDate losing sub-Second precision after loading

ios,swift,xcode6,nsdate
I have a 2-dimensional array of NSDates, working at sub-second precision. But when I save the array like this: let pathes = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true) as NSArray let documentsDirectory = pathes.objectAtIndex(0) as! NSString let path = documentsDirectory.stringByAppendingPathComponent("tj_001.plist") var dicti = NSMutableDictionary() dicti.setObject(tDate, forKey: "tTimes") dicti.writeToFile(path, atomically: false) and load it...

Load images from “HTTPS” type of url and display in UIImageview

ios,objective-c,https,uiimageview,xcode6
I am developing an iOS app in which I receive "HTTPS" URLs from server for images. I am now unable to load images from those URLs. I have tried several frameworks like AFNetworking, SDImageView, etc. But none of them are able to load image from these type of URLs. Update:...

Can't create an outlet connection by drag and drop

ios,objective-c,xcode6
I'm new to iOS XCode6 ,trying to create a single view app . When I try to create an outlet connection to the label by drag and drop , nothing shows up as you see in the picture below. I did search the web all over to find an answer...

How to fix “linker command failed with exit code 1 (use -v to see invocation)”

objective-c,ios8,xcode6
I was solving some conflict issues in Xcode, but when I run the application it returned these error messages: duplicate symbol _OBJC_IVAR_$_MessagesViewController._users in: /Users/BrenoMorais/Library/Developer/Xcode/DerivedData/SimplyCircle-fbtbskibjbfgzofjcvomrqorcxuq/Build/Intermediates/SimplyCircle.build/Debug-iphonesimulator/SimplyCircle.build/Objects-normal/i386/MessagesViewController-8AA2A9C32D34C91E.o duplicate symbol _OBJC_CLASS_$_MessagesViewController in:...

Core data model not finding auto-generated entity classes after upgrading to XCode 6.3.2 (using Objective-C rather than Swift)

ios,objective-c,core-data,xcode6
Today I upgraded to XCode 6.3.2. I have a single XCode project that generates a number of different apps. Each app is a different compile target. All apps use the same core data model. There are 4 versions of the core data model. The lastest one is the current one....