Tag: swift

Save Alamofire Result as Variable?

I’ve been trying to find out how to save a part of a JSON response from Alamofire as a variable to make an if statement and can’t seem to find how to do it. I made a piece of code to use as an example for the question which consists of the following: import UIKit […]

How do I create connected text fields in ios?

I want to create a login screen similar to facebook’s for my iOS app. How do I create 2 text-fields that are both in that rounded box?

UINavigationBar frame height returns 44.0 but is actually 64.0

I have a UINavigationController in a storyboard which is not using AutoLayout. With the status bar visible the actual height of the UINavigationBar is 64.0 and yet when I log self.navigationBar.frame.size.height I get 44.0. How do I get the actual height of the UINavigationBar? I’m using Xcode 7.3 and the storyboard builds for iOS 6.

Cannot print the FBSDKAccessToken.currentAccessToken().tokenString in my iOS9 app

I was creating an app in Swift for iOS 9 for learning purposes. I was trying to print the current access Token of Facebook at time when I log into Facebook through my app. When I click the fblogin button it opens Safari and shows me that I already have authorized my app but when […]

Swift – Custom SearchController and SearchBar

I am trying to recreate the search field as seen in the Yahoo Finance app. I followed an online tutorial for customizing the UISearchBar and UISearchController, however I still have some problems. If any of you could open up my project and see where Im going wrong / where I need to add these lines […]

Error 'xcodebuild: Returned an unsuccessful exit code' after trying publishing Pod

Command ‘pod trunk push –verbose’ outputs the following: Build settings from command line: CODE_SIGN_IDENTITY = – SDKROOT = iphonesimulator10.1 === CLEAN TARGET GTNetworkQualityChecker OF PROJECT Pods WITH CONFIGURATION Release === Check dependencies ** INTERNAL ERROR: Uncaught exception ** Uncaught Exception: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil Stack: 0 __exceptionPreprocess (in CoreFoundation) 1 objc_exception_throw (in […]

iOS – Implementing UI on Objective-c and Swift together

A legacy project was done on Objective-c, where there is a tab view. A full new feature is required with a new tab which I want to implement on Swift. Right now there is no time to convert full project into Swift but the new feature is to be implemented on Swift. Can anyone guide […]

Controlling the gap between cells in UICollectionViewController

My cells seem to have a gap of about 20 points, I want to control that value, but every answer I found regarding this question does not work. I tried: func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { return 0 } func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: […]

Where to Write Shared Application Data -Between Users in OSX

I understand that I need to store data in ~/Library/Application Support/YourApp for current user or /Library/Application Support/YourApp for shared users. But it seems I need to get root access to write data to /Library/Application Support/YourApp.. right? Can I write to Users/Shared ,Does this required root privileges? Is there anything wrong in doing this?

How to add texture (image) to SceneKit model so that it covers the model (mesh) uniformly?

Just started playing around with SceneKit & ARKit. One issue I’m having is covering the 3DModel with an image texture. What is happening is that part of the 3DModel when rendered in ARKit uses the texture correctly. The other parts are not. For example I’m using a sofa 3DModel at scale roughly (80 inches W […]