Proyectos de Subversion Iphone Microlearning - Nuevo Interface

Rev

Rev 9 | Rev 17 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 9 Rev 11
Línea 157... Línea 157...
157
            NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillShowNotification, object: nil, queue: .main) { (notification) in
157
            NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillShowNotification, object: nil, queue: .main) { (notification) in
158
                let keyboardHeight: CGFloat = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue.height ?? 0
158
                let keyboardHeight: CGFloat = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue.height ?? 0
Línea 159... Línea 159...
159
                
159
                
160
         
160
         
Línea 161... Línea 161...
161
                self.keyboardHeight = keyboardHeight
161
                self.keyboardHeight = keyboardHeight
Línea 162... Línea 162...
162
                print("keyboardHeightShow = \(keyboardHeight)")
162
                //print("keyboardHeightShow = \(keyboardHeight)")
Línea 163... Línea 163...
163
                
163
                
Línea 164... Línea 164...
164
            }*/
164
            }*/
165
            
165
            
Línea 166... Línea 166...
166
            NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillHideNotification, object: nil, queue: .main) { (notification) in
166
            NotificationCenter.default.addObserver(forName: UIResponder.keyboardWillHideNotification, object: nil, queue: .main) { (notification) in
Línea 191... Línea 191...
191
        if !self.isValidEmail || !self.isValidPassword {
191
        if !self.isValidEmail || !self.isValidPassword {
192
            return
192
            return
193
        }
193
        }
Línea 194... Línea -...
194
        
-
 
-
 
194
        
195
        
195
        
Línea 196... Línea 196...
196
        
196
        let appData = appDao.selectOne()
197
        let device_uuid = appData.deviceUuid
197
        let device_uuid = appData.deviceUuid
198
 
198
 
199
        print("signin")
199
        //print("signin")
Línea 200... Línea 200...
200
        print(" aes  = \(appData.aes) " )
200
        //print(" aes  = \(appData.deviceAes) " )
201
        print(" email  = \(self.email) " )
201
        //print(" email  = \(self.email) " )
Línea 202... Línea 202...
202
        print(" password  = \(self.password) " )
202
        //print(" password  = \(self.password) " )
Línea 203... Línea 203...
203
        
203
        
204
 
204
 
Línea 232... Línea 232...
232
        }
232
        }
Línea 233... Línea 233...
233
        
233
        
Línea 234... Línea 234...
234
        self.showProgressView = true;
234
        self.showProgressView = true;
235
 
235
 
236
        let emailData = email.data(using: .utf8)!
236
        let emailData = email.data(using: .utf8)!
Línea 237... Línea 237...
237
        let emailCipherData = RNCryptor.encrypt(data: emailData, withPassword: appData.aes)
237
        let emailCipherData = RNCryptor.encrypt(data: emailData, withPassword: appData.deviceAes)
238
        let emailEncrypted = emailCipherData.base64EncodedString()
238
        let emailEncrypted = emailCipherData.base64EncodedString()
239
                  
239
                  
Línea 240... Línea 240...
240
        let passwordData = password.data(using: .utf8)!
240
        let passwordData = password.data(using: .utf8)!
241
        let passwordCipherData = RNCryptor.encrypt(data: passwordData, withPassword: appData.aes)
241
        let passwordCipherData = RNCryptor.encrypt(data: passwordData, withPassword: appData.deviceAes)
Línea 242... Línea 242...
242
        let passwordEncrypted = passwordCipherData.base64EncodedString()
242
        let passwordEncrypted = passwordCipherData.base64EncodedString()
243
                   
243
                   
244
 
244
 
245
        print(" email encrypted = \(emailEncrypted) " )
245
        //print(" email encrypted = \(emailEncrypted) " )
Línea 255... Línea 255...
255
        
255
        
256
        let headers: HTTPHeaders = [
256
        let headers: HTTPHeaders = [
257
            .accept(Constants.HTTP_HEADER_ACCEPT)
257
            .accept(Constants.HTTP_HEADER_ACCEPT)
Línea 258... Línea 258...
258
        ]
258
        ]
Línea 259... Línea 259...
259
        
259
        
260
        print("URL signin : \(Config.URL_SIGNIN)")
260
        //print("URL signin : \(Config.URL_SIGNIN)")
261
        
261
        
Línea 262... Línea 262...
262
        self.showProgressView = true
262
        self.showProgressView = true
263
        AF.request(Config.URL_SIGNIN, method: .post, parameters: parameters, encoding: URLEncoding.default, headers: headers).responseJSON{(response) in
263
        AF.request(Config.URL_SIGNIN, method: .post, parameters: parameters, encoding: URLEncoding.default, headers: headers).responseJSON{(response) in
264
            self.showProgressView = false
264
            self.showProgressView = false
Línea 265... Línea 265...
265
            
265
            
Línea 266... Línea 266...
266
            switch response.result {
266
            switch response.result {
267
                case .success:
267
                case .success:
Línea 268... Línea 268...
268
                    let json = try? JSON(data: response.data!)
268
                    let json = try? JSON(data: response.data!)
Línea 337... Línea 337...
337
 
337
 
338
    
338
    
Línea 339... Línea 339...
339
    private func validate() -> Bool
339
    private func validate() -> Bool
340
    {
340
    {
Línea 341... Línea 341...
341
 
341
 
342
        print("validate - email : \(email)")
342
        //print("validate - email : \(email)")
343
        print("validate - password : \(password)")
343
        //print("validate - password : \(password)")
Línea 621... Línea 621...
621
     
621
     
622
                    SecureField("", text: self.$password, onCommit: {
622
                    SecureField("", text: self.$password, onCommit: {
623
                        self.isEditingPassword = false
623
                        self.isEditingPassword = false
624
                        self.isValidPassword = Validator.checkPassword(password: self.password)
624
                        self.isValidPassword = Validator.checkPassword(password: self.password)
625
                    })
-
 
626
                    .onHover { hovering in
-
 
627
                        if hovering {
-
 
628
                            print("onHover")
-
 
629
                        } else {
-
 
630
                            print("offHover")
-
 
631
                        }
-
 
632
                                }
625
                    })
633
                    .onTapGesture {
626
                    .onTapGesture {
634
                        self.isEditingPassword = true
627
                        self.isEditingPassword = true
635
                    }
628
                    }
636
                    .font(Font.custom(Config.FONT_NAME_REGULAR, size: 11))
629
                    .font(Font.custom(Config.FONT_NAME_REGULAR, size: 11))