swift3

UIScrollView stops scrolling on keyboard dismiss

杀马特。学长 韩版系。学妹 提交于 2019-12-12 04:23:19
问题 I'm currently working on an app for iPhone using Swift 3 however I have ran into an issue with the scrollview. Prior to selecting a text field and having the keyboard appear, the scrollview work normally (ie.: I can scroll up and down), however after dismissing the keyboard, the scrollview does not allow me to scroll anymore which is my problem. Note: if I select a text field again and make the keyboard appear it works fine and stops working once it is dismissed again. I have checked the

Button action and navigation not working in viewcontroller in swift ios

眉间皱痕 提交于 2019-12-12 04:22:48
问题 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { self.window = UIWindow(frame:UIScreen.main.bounds) let homeVC = ConstDetailViewController(nibName: "ConstDetailViewController", bundle: nil) //homeVC.tabBarItem.title = "Home"; homeVC.tabBarItem.image = UIImage(named: "HomeRe.png") // Settings controller let settingsVC = LeaderboardViewController(nibName: "LeaderboardViewController", bundle: nil)

Prevent duplicate users with Firebase Database, Swift 3

随声附和 提交于 2019-12-12 04:21:33
问题 I try to prevent the creation of already existing usernames. This is my code where I upload usernames to the database: ref?.child("users").child(FIRAuth.auth()!.currentUser!.uid).child("username").setValue(self.createUserName.text) And this is the code where I try to get if the username already exists or not ref?.child("users") .queryOrdered(byChild: "username") .queryEqual(toValue: self.createUserName.text?.uppercased()) .observeSingleEvent(of: .value, with: { (snapshot) in if !snapshot

Disable Alert Button when Text Field is Null with Swift 3

空扰寡人 提交于 2019-12-12 04:19:50
问题 I would like to disable the alert button when the text box is null. I put the button in Table View Cell. So, when you click that button, the alert box will pop up. My codes are below. func cellTapped(cell: DeviceListTableCell) { self.showAlertForRow(row: tableView.indexPath(for: cell)!.row) } func showAlertForRow(row: Int) { let alert = UIAlertController( title: "Enter Password !!!!!", message: "", preferredStyle: .alert) alert.addTextField { (textField) in } let okAction = UIAlertAction

How to perform sequential request with Alamofire and update a progressHUD at every step in Swift 3

假如想象 提交于 2019-12-12 04:12:16
问题 Ok, I am going nuts over this one... I'm using Alamofire 4.x (Swift 3 and XCode 8.1). I need to fetch and parse several html requests from a site that requires authentication (no json API, unfortunately). The HTML is then parsed with Fuzi and this progress can take some time so I plan to use a ProgressHUD (PKHUD to be exact) to let users know about what is going on. I also need to grab some html that is not behind an authentication. I created a struct and functions to handle the overall

Using Firebase in the App and Today Extension doesn't work

跟風遠走 提交于 2019-12-12 04:08:55
问题 I'm using Firebase in My App, I used it via pod and everything was work correctly, Then we Add Today Extensions (2 extensions) to our app, and also we need to use Firebase in it, so I added it to podfile like this: use_frameworks! project ‘projectName.xcodeproj' target ‘appName’ do pod 'Firebase/Core' post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['SWIFT_VERSION'] = '3.0' end end end end target

Rotating only affect one time in iPad in swift 3

不羁的心 提交于 2019-12-12 04:06:20
问题 I have 2 view controllers. First view controller has many videos and when user clicks on the Video, then it will goes to second view controller. When user reaches to second view controller, then the screen will rotate automatically to the landscape mode. But, user rotates the device and the video display will rotates to portrait and cannot set to landscape mode anymore. --------------------- I set some config in Project > General. I would like to set landscape whatever the user rotates the

iOS ADMOB Reward based video ad failed to load

徘徊边缘 提交于 2019-12-12 04:04:57
问题 until today I was able to show the reward video, but now the video doesn't appear, a log of admod alert me to install the new ADMOB SDK 7.23.0 Now with the new ADMOB SDK the reward video fails to load. with the test id , seems to work: GADRewardBasedVideoAd.sharedInstance().load(GADRequest(),withAdUnitID: "ca-app-pub-3940256099942544/1712485313") if I change with my reference ID, the video fails to load. I've also added in AppDelegate: //ADMOB import GoogleMobileAds func application(_

Firebase Upload Images and getting URL issue

纵然是瞬间 提交于 2019-12-12 04:04:14
问题 I am trying to take 3 images and post it in firebase storage and get a download URL and put it in the Firebase Database. My code only uploads the first image but won't upload anything if there is a second. @IBOutlet weak var titleText: UITextField! @IBOutlet weak var subtitleText: UITextField! @IBOutlet weak var authorText: UITextField! @IBOutlet weak var dateText: UITextField! @IBOutlet weak var articleText: UITextView! @IBOutlet weak var tagsText: UITextField! @IBOutlet weak var

How to add Read more/less in Paragraph with Swift 3?

喜夏-厌秋 提交于 2019-12-12 03:58:48
问题 I have a problem with adding Read More/Less text in paragraph. That text needs in iPod but no need for iPad. Please view the attached image below. The first problem is that before I clicking "Read More" button, there is a space at the top left corner. When I click on Read More button, the label is goes to top and there is no space . The second problem is that Read More button does not require if the device is iPad because the screen size is big and all the texts are show. For iPod , it needs