Tag: swift

How to swipe right to show new View Controller in Swift 3?

I want to be able to swipe right in my ViewController which will show another view controller, CommunitiesViewController. I have looked on other threads and found some ways of doing this though I believe they are for Swift 2. This is the code I am using in my ViewController: override func viewDidLoad() { super.viewDidLoad() let […]

Create UITextField Extension in Swift with custom styling

I have several UITextFields on the view that have to look the same. I figured out that I might create an Extension that will pre-style my text fields (those that I want to have the same style). let passTextField: UITextField = { let tf = UITextField() //tf.backgroundColor = UIColor.blueColor() tf.translatesAutoresizingMaskIntoConstraints = false tf.layer.cornerRadius = 25 […]

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: […]