swift3

Error while adding data in userID in Firebase Swift 3

不问归期 提交于 2019-12-25 16:46:13
问题 I am trying to add data by respective userIDs in Firebase by sign up the user, but it gives me error " unexpectedly found nil while unwrapping an optional value " now I don't know what the matter is. But when I use code without adding userID in ref respectively the data is added successfully. but when I add userID following ref then got error. SignUp let userID = FIRAuth.auth()?.currentUser?.uid ref.child("user_registration").child(userID!).setValue(["username": self.fullName.text, "email":

Get part of image saved on disk (Swift)

孤者浪人 提交于 2019-12-25 16:41:56
问题 A very large image saved at DocumentDirectory. This image is asked to be display at the image view depending on users current window that can change by zooming and dragging. I can't load the Image at memory with it full size and then start cropping. This is so costy. The following code gets resized(smaller,scaled) copy of the image saved on disk: if let imageSource = CGImageSourceCreateWithURL(imageURL, nil) { let maxSize = max(thumbSize.width, thumbSize.height) / 2.0 let options = [

Get part of image saved on disk (Swift)

 ̄綄美尐妖づ 提交于 2019-12-25 16:41:02
问题 A very large image saved at DocumentDirectory. This image is asked to be display at the image view depending on users current window that can change by zooming and dragging. I can't load the Image at memory with it full size and then start cropping. This is so costy. The following code gets resized(smaller,scaled) copy of the image saved on disk: if let imageSource = CGImageSourceCreateWithURL(imageURL, nil) { let maxSize = max(thumbSize.width, thumbSize.height) / 2.0 let options = [

swift 3 - core data relationship - fetch data

空扰寡人 提交于 2019-12-25 16:09:49
问题 i work with core data and swift 3 for macOS. i have to entities: Person and Books I can create a person i can create a book which will assign to a person and i know how i can get the information which book is assign to which person with this code at the end but how can i get the information which person has which book? more details in my last post: swift 3 - create entry with relationship Thank you very much :) let appdelegate = NSApplication.shared().delegate as! AppDelegate let context =

swift 3 - core data relationship - fetch data

谁说胖子不能爱 提交于 2019-12-25 16:09:27
问题 i work with core data and swift 3 for macOS. i have to entities: Person and Books I can create a person i can create a book which will assign to a person and i know how i can get the information which book is assign to which person with this code at the end but how can i get the information which person has which book? more details in my last post: swift 3 - create entry with relationship Thank you very much :) let appdelegate = NSApplication.shared().delegate as! AppDelegate let context =

Manual approval / rejection of user registration by admin using Firebase

心已入冬 提交于 2019-12-25 15:54:06
问题 Currently I'm designing an application in Swift 3.0 that will be used by a small group up to 100 users. Users will register through a simple registration form using email id and password but Admin will have to approve or reject the user registration request manually. Workflow I can think of is if a user register, admin will get some notification or email that a new user registration request is there and then when admin approve or rejects the user registration request and user will get a email

Passing data from table view to view controller

余生长醉 提交于 2019-12-25 14:39:47
问题 i am do a function when i click on the row and then will go to another view controller to show the detail but it's get an error this is the error => fatal error: unexpectedly found nil while unwrapping an Optional value this is my code on table view didselectRow func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { let popup = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "popUp") as! PopupViewController let pro_name = preCakeArray

How to load part of HTML from URL even after clicking event?

房东的猫 提交于 2019-12-25 10:46:52
问题 I have wrote some code to load all html from url and parse it to remove header. So I got the rest of the html under header to show. However, after clicking event in the body html, the screen shows full html from the URL. Is there any solution for this? or Did I make a mistake to approach this problem? The code I made is below import UIKit import Fuzi class ViewController: UIViewController { @IBOutlet weak var webView: UIWebView! override func viewDidLoad() { super.viewDidLoad() let

How to load part of HTML from URL even after clicking event?

冷暖自知 提交于 2019-12-25 10:46:48
问题 I have wrote some code to load all html from url and parse it to remove header. So I got the rest of the html under header to show. However, after clicking event in the body html, the screen shows full html from the URL. Is there any solution for this? or Did I make a mistake to approach this problem? The code I made is below import UIKit import Fuzi class ViewController: UIViewController { @IBOutlet weak var webView: UIWebView! override func viewDidLoad() { super.viewDidLoad() let

2 Table View in One View Controller with Swift 3

不想你离开。 提交于 2019-12-25 09:29:56
问题 I have 2 table views in one View Controller. I declare these two tables. @IBOutlet weak var packTableView: UITableView! @IBOutlet weak var mediapackTableView: UITableView! I declare this code in ViewDidLoad. mediapackTableView.delegate = self mediapackTableView.dataSource = self mediapackTableView.register(MediaPackTableViewCell.self, forCellReuseIdentifier: "mediaPackCell") packTableView.delegate = self packTableView.dataSource = self and I also add these following codes. func tableView(_