2018-06-30         Kim

UIStatusBar Appearance with Multiple Windows

First, my app's setup:Most of the app's view controllers exist in your standard navigation controller hierarchy, but I also have a second window over the main app window, which hosts a view controller (NotificationVC). If NotificationVC is presenting a notification, it will change the status bar style to contrast with the notifications, but otherwise it defers the style to the main window's root view controller.My issue is that changes in the main window that would normally trigger a status bar appearance update (pushing, popping or presenting a view controller, or calling ...

 ios                     2 answers                     71 view
 2018-06-30         Dave

Adding a subview that stays in place as you navigate through views

I am looking to create a subview that looks like a banner drop down view from the Navigation Bar. or like this I feel like I see this effect all the time but have been struggling for a while to recreate this. I have it working on single view applications but I would like it to stay in place as I navigate from view to view. Right now I have the view setup in the storyboard and would like use this because I had issues attempting this programatically.To create this "drop down banner view" and have it stay in place (until the user dismisses it) as a user navigates from sc...

 ios                     1 answers                     72 view
 2018-06-30         Harry

Update or reload UITableView after completion of delete action on detail view

I have a uitableview that collects data from mysql through json. Then it has a detail view that has two action edit and delete. Edit works fine. Delete action deletes mysql data but problem is it does not update data from uitableview.Here is screen shot and code//Table View Controllerimport UIKitclass TableViewController: UITableViewController { var storeList = [Store]() //var storeList:Store? override func viewDidLoad() { super.viewDidLoad() /* if let s = storeList { txtName.text = s.storeName }*/ // Uncomment t...

 ios                     3 answers                     73 view
 2018-06-30         Shirley

Issues with casting celltypes to dequeue

Hi i'm having issues in my cellForItemAt its saying the error below. I don't see why i'm unable to cast the cells. It occurs at the first line of the else statement.The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in may also be helpful. Could not cast value of type 'Spoexs.MenuCell2' (0x10d059660) to 'Spoexs.MenuCell1' (0x10d0595c0).import UIKitimport MIBadgeButton_Swiftclass SecondMenuBar: UIView, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout { lazy var collectionView: UICollectionView = { ...

 ios                     2 answers                     74 view
 2018-06-30         Gladys

Adding a custom UIViewcontroller to subview programmically but getting an error message "Cannot convert value of type..."

I am trying to add a custom UIViewController class (UIPickerView) to my main ViewController programmatically in Swift (without using a storyboard) but I get the following error message..."Cannot convert value of type 'HabitViewViewController' to expected argument type 'UIView'Any ideas would be most welcomed ;-)Custom UIPicker class: import UIKit class HabitViewController: UIViewController,UIPickerViewDataSource,UIPickerViewDelegate { @IBOutlet weak var myPicker: UIPickerView! @IBOutlet weak var myLabel: UILabel! let pickerData = ["Mozzarella","G...

 ios                     1 answers                     75 view
 2018-06-30         Jodie

Swift 4.2 Syntax change - What happened to Swift type inference?

I'm running Xcode 10 beta with Swift 4.2. Xcode wants to convert my Xcode 9.4.1 with Swift 4.1 code to Swift 4.2 syntax. The changes are all UIView.animate(... options: ...).I using options like .curveEaseIn which worked fine before but it wants to change them to UIView.AnimationOptions.curveEaseIn. What happened to Swift's ENUM type inference? It was UIViewAnimationOptions.curveEaseIn in Swift 4.1. So, the migrator has detected your .curveEaseIn as UIViewAnimationOptions.curveEaseIn and trying to convert it to UIView.AnimationOptions.curveEaseIn.Seems current migrator d...

 ios                     1 answers                     78 view
 2018-06-30         Judy

How to detect when tap on google map iOS Swift?

I wanna check and detect when tap on map not marker or anythings. Is there exist any delegates for this case in google map iOS Swift 4? Thanks. func mapView(_ mapView: GMSMapView, didTapAt coordinate: CLLocationCoordinate2D) {} [XXX]

 ios                     1 answers                     79 view
 2018-06-30         Elliot

Update label text in Viewcontroller from Tableview

My question is similar to the one as here: Update label.text at runtimeI have a viewcontroller that contains a tableview with some textfields. When the user enters the quantity and amount in the perspective textfields I want to update a label outside the tableview after I press return on the final keyboard during at runtimeAfter doing some research I realize that this will get some in the textfieldDidEndEditing function of the textfield delegate in the cell itself but how will i access the label text from the viewcontroller so that i can update it? I will provide the code I...

 ios                     1 answers                     81 view
 2018-06-30         Cornell

Instaling without cocoapods

https://github.com/IBM-Swift/Swift-SMTPIm sorry if this is a dumb question but I am trying to install this inside my app and there is no documentation on how to add it. I always use cocoapods but it seems this can't be used for this project. Could anyone help me I need this functionality That particular project/repo uses Swift Package Manager, so in Terminal cd into the project root:$ swift package generate-xcodeprojThis will create an .xcodeproject which you'll then open and build. Once you've done that just drag the built framework into the project you'd like to includ...

 ios                     1 answers                     82 view
 2018-06-30         Gloria

How do I save a UIButton being selected (showing checkmark) and load it in iOS?

I am a beginner and the following is what code I have so far. When clicking the button, it'll switch between the checkmark and the empty box (that's good). However, when exiting the app, the button won't save the state of being selected (check marked).Attached is all my code, so that you can clearly see what's going on.import UIKitclass ViewController: UIViewController { @IBOutlet weak var checkMarkButton: UIButton! let save = "save" override func viewDidLoad() { super.viewDidLoad() if UserDefaults.standard.bool(forKey: "save") == true { c...

 ios                     1 answers                     83 view
 2018-06-30         Don

Swift iOS -How to Switch / Toggle between two UIWindows and make either the keyWindow

I created an additional UIWindow that will get presented on top of the main window. The user presses a button and it transitions over the main window. The user can minimize the additional window and it will sit above the tabBar like it the picture below. They can enlarge it to cover the main window or dismiss it and it gets destroyed. It works fine.I also created a custom action sheet that launches from the bottom of the screen. If the additional window completely covers the main window and the action sheet is launched, it will launch perfectly inside the additional window....

 ios                     2 answers                     86 view
 2018-06-30         Carter

Creating new view controller

I am trying to create a new view controller programmatically rather than use the storyboard on Xcode. I am quite new to coding and don't understand what value I have to put on in the brackets where frame is. The Code is all on the app delegate, could you please help. let layout = UICollectionViewFlowLayout() window = UIWindow(frame: UIScreen.main.bounds) window?.makeKeyAndVisible() window?.rootViewController = UINavigationController(rootViewController: Homecontroller(frame: -, collectionViewLayout: layout)) Check thiswindow = UIWindow(frame: UIScreen.main.bou...

 ios                     1 answers                     85 view
 2018-06-30         Abel

How to segue with left to right animation and alpha 0 to 1

I just want to go to next ViewController using segue and the next ViewController will come from left to right with alpha 0 at the starting and 1 at the when next ViewController is on display.Here is the code i tried so far without any luck,let transition = CATransition() transition.duration = 1.0 transition.type = kCATransitionPush transition.subtype = kCATransitionFromRight transition.timingFunction = CAMediaTimingFunction(name:kCAMediaTimingFunctionEaseInEaseOut)self.view.window!.layer.add(transition, forKey: kCATransition)self.performSegue(withIdentifier: "login", sender...

 ios                     1 answers                     86 view
 2018-06-30         Maxine

Removing all notification observer from all view controllers in swift

There is any way to remove notification observer from all view controllers at one time (or from current view controller). Try this:[[NSNotificationCenter defaultCenter] removeObserver:self]; [XXX]

 ios                     1 answers                     87 view
 2018-06-30         Jennifer

Programmatically transitioning between two UIViewControllers (Xcode 9, Swift 4)

The app I am currently working on requires that I do not use ANY storyboards. Therefore I need to do everything programmatically. One thing I seem to be struggling with is switching between two UIViewControllers.The issue is that every time I call the self.present() method; it creates a brand new instance of the class I would like to show. So when I go into Xcode's visual debugger, I see over 15 different views that are all stacked and are merely instantiations of one another. Ex: View1, View2, View1, View2, View1, View2, View1... This constant repetition of the views is si...

 ios                     2 answers                     88 view
 2018-06-30         Truman

UIAlertController pushed up and offscreen by modal view controller

I have a viewController, presented by a navigationController, and when I press a button I do two things: first I present a UIAlertController, which appears just fine. Then in 2 seconds, I modally present a second UIViewController, and when it slides upward, (maybe due to a bug in UIKit) it literally pushes the UIAlertController upward as well until it is almost off-screen. What could be going on to cause this?In another experiment with UIAlertView (deprecated), this does not happen. UIAlertController is always presented as a modal, and one view controller shouldn't prese...

 ios                     1 answers                     88 view

Page 4132 of 4132  |  Show More Pages:  Top Prev Next Last