Firebase observSingleEvent does not fire Swift

I am creating an ios app that integrates with Google Firebase using Swift. However, for some reason the observeSingleEvent is not triggering. From my understanding this should be called once and then stop. Below is the code: var handle: AuthStateDidC

How to add Firebase to Today Extension iOS

I need to be able to use Firebase in my Today View Extension, however I cannot seem to import the Firebase module. I think it's because I need a new target in my cocoa pods file, but I'm not sure on how to do this. Thanks.You have to treat the today

How to obtain JSON table values ​​in iOS

I got JSON dictionary, but i want to get in this son values. like NAME, SECTION,CLASS,IMAGE,DOB. how to get values and mostly how to get image by this bit code. how to show image and convert bit code to image. please help my Json [ { "ID": "

Swift: The unpacking force is zero and yet no crash?

The Facebook SDK (4.x) has a delegate protocol that force unwraps the error that is returned. extension FacebookLoginViewController: FBSDKLoginButtonDelegate { func loginButton(loginButton: FBSDKLoginButton!, didCompleteWithResult result: FBSDKLoginM

Specify spaces between cells in UICollectionView

This question already has an answer here: Cell spacing in UICollectionView 20 answers I have a UICollectionView somewhat similar to the screenshot as shown, but this image is taken off from the Internet. In my app, I also have 3 items per row. My pro

MBProgressHUD hide before tableView reloadData ()

Here are the codes,HUD just hide very quickly. And I need 2~5s to reloadData,is there any way to accelerate or just keep the HUD appear? func loadDorms() { var hud = MBProgressHUD.showHUDAddedTo(self.view, animated: true) hud.labelText = "加载中" h

Error: Int is not convertible to NSRange

I'm getting the error: int is not convertible to NSRange on var range:NSrange = 0: let predicate = NSPredicate(block: { (city: AnyObject!, b: [NSObject : AnyObject]!) -> Bool in var range:NSRange = 0; //convert error happens here on 0 if city is NSSt

How to cancel one of the many threads in swift

Well .. I'm in situation like this: I have a function that starts 3 asynchronous threads. Each thread do something wich take some time. When some thread finish first, I need it to stop the other 2, but I dont know how to do it (yet). My code: class S

Character occurrence after specific index

Is there any way to achieve what JAVA function int indexOf(int ch, int fromIndex) do. Let me explain it: NSString *steSample = @"This is sample test string"; Now i want to get the index of i but after 2nd index. How can I achieve this. Thanks in

Text is not displayed in cells

Trying to get my app to display text in its cells. Been scratching my head for a while. This is the code used to display the text but nothing appears. Any advice? - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexP

Adjust the height of a foot of section uitableview

I am just starting to use a UITableView section footer, but am having some problems. So I have a UITableView with an edit button attached to the bottom using a footer. My first problem is that when you click on that button, the footer should double i

NSPredicate to get all students with a certain course name?

I have two Entities, Student and Course, where each has a to-many relationship to the other (i.e., a Student has 0 or more Courses, and a Course has 0 or more Students). I need to obtain all Students who are enrolled in a Course. I also need to obtai

Sprite CGPoint kit does not work as expected

I am writing a game in Sprite Kit and I am having a problem with CGPoint, at the moment if the phone is portrait the object comes in from the right side of the screen and goes to the left, I need it to come in from the top of the screen and fall to t

Adding a new version of the application

I am in a dilemma about adding a new app/adding a new version. Basically the scenario is that I have uploaded an app already onto the App Store(free), which is live. Now I want to deploy a Paid version of the same application. My question is whether

is this a valid keyboard workaround obscuring the content

I have a Tableview where the user can enter values into a textField as one of the custom cells Apple have some documentation about how to adjust view content by repositioning the view clear of the keyboard's vertical dimension ( Here ) but it relies

Disable the Edit button from the tab bar application

I am using Storyboard to create a tab bar which has 6 tabs. The tab bar is the initial view controller. I am not using any custom class for my tabbarcontroller. The more tab gets a "edit" button. How can I remove that button?Set the customizable

The right way to create a custom UITabBar in UITabBarController

I'm trying to create an app with UITabBarController, in order to use Cocoa's own memory and view controllers management for switching between different view controllers. However I do need to make a very custom UITabBar, which after much Googling I fo

Date formatting gives null

I have string "24 Jan 2012 09:21:21 +0000" and I want to make it a NSDate object as NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setTimeStyle:NSDateFormatterFullStyle]; [dateFormatter setDateFormat:@"yyyy-

How to remove Address Bar from Safari in iOS?

Old trick with window.scrollTo(0,1); doesn't work. And even worse, the address bar moves only a bit and gets stuck halfway out sometimes.It is a combination of many things as I have found when researching this issue for myself. Here's the code that p

Custom Pins iOS MapKit

How do I show images instead of pins in the map. So far I can only add pins on tap. A sample code of the .m would extremely help since i'm still new to iOS programming. #pragma mark - #pragma mark MKMapView delegate - (MKAnnotationView *)mapView:(MKM

Loading data on a UITableViewCell with custom Xib

I created a custom cell with IB In my interface, I have 3 UILabels and an UIImageView. I wired all the outlets and then back in my controller, I have the following code - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NS

NSSortDescriptor can not count numbers at all

With this NSSortDescriptor *lessonDescriptor = [[NSSortDescriptor alloc] initWithKey:@"lesson" ascending:YES]; [resultArray sortUsingDescriptors:[NSArray arrayWithObject:lessonDescriptor]]; it's sorting the "lesson"-objects to ( { less