Tag: swift

My navigation bar is showing up in storyboard but not in the simulator

When trying to add a navigation bar for searching on the left button and eventually a setting button on the right bar button, the bar isn’t showing up in the simulator. Screenshot Should I be using a regular toolbar like the temporary one I have on the bottom? I’d prefer the search button for loading […]

UIViewanimation trantitionfromView using UIViewflip animation

Building an app containing flashCards. They surely require the ability to flip a card. To do this i have a UIViewController and to avoid flipping the whole view I’ve implemented my subView into a container. I have declared two subviews in the container named, frontView and backView. frontView got red background and label saying front […]

<unknown>:0: error: type 'Key' constrained to non-protocol type 'String'

Migrating to Swift 3 from 2.3 and am running into this issue. The error is traceable to a view controller. I do not see any extensions/protocols which would require a ‘Key’ constrained to ‘String’. I’ve tried to comment out code that might be causing the error, and have had strange results – ie removing an […]

How to bring the navigation bar on top of the camera frame?

I am creating a QR code scanner in my app. It includes the navigation bar, QRcode camera and a result box. Here is what I want to do. With navigation bar But when I run in my phone, the navigation bar is behind the camera frame. Without navigation bar I have tried to insert a […]

Upload Facebook image URL to Firebase Storage

I am trying to upload the users facebook profile picture to Firebase Storage. let dictionary = result as? NSDictionary let data = dictionary?.objectForKey(“data”) let urlPic = (data?.objectForKey(“url”))! as! String print(urlPic) //Direct link to facebook profile picture print(“Down Casting to a string”) print(“\(urlPic)”) The code above gives me the url to the facebook picture. So that […]

Interstitial Ads SpriteKit

Can someone please help me? I really want to add interstitial ads to my spritekit game but have no clue. I have tried a lot of tutorials and even google firebase but i cant seem to get to work.

How to parse JSON code to Swift 3 Table View data?

I am creating an ios application using swift 3 and MySQL and PHP as database. I wanted to output the data from database to a tableview but i kept having an error: Error Domain=NSCocoaErrorDomain Code=3840 “JSON text did not start with array or object and option to allow fragments not set.” I tried to check […]

How to change button title from table static cells?

I have HomeViewController that’s segued modally to a Navigation Controller with an identifier of: pickSubjectAction And on SubjectPickerTableViewController is where my subjects to choose. This is my code import UIKit class SubjectPickerTableViewController: UITableViewController { var subjects:[String] = [ “English”, “Math”, “Science”, “Geology”, “Physics”, “History”] var selectedSubject:String? { didSet { if let subject = selectedSubject { […]

Passing data while dismissing a view

I’m working on an app with two different views which can modally present a “settings” viewController with a tableView embedded in it. To pass the data from the embedded tableView to the first two views I would have to use prepareForSegue in each view transition (to my understanding). However, when I’m in the Settings view […]

Alerts on iPhone X shows different color with UIAlertController popup

I have an app I built in Xcode 8 for iOS 10 originally. I recently upgraded to Xcode 9 and have been making fixes to my app for the iPhone X and iOS 11. One issue I’m having a lot of trouble with is how to make the whole screen (including the area by the […]