ios - Xcode8 : Why Xcode8 is not building/compiling after converting to Swift3 syntax's -


i ran project in xcode8 asked me convert swift3 syntax's did it, there many errors errors fixing 2 days. after converted swift3 step step(error resolving). when build not ran once either in device or simulator.

why not moving further ?

it not throwing errors fix any(checked again , again)

i worried. there need check in build settings or in code ?

please refer below image

enter image description here

warnings:

enter image description here

xcode8 compiler bug :

sometimes compiler not detecting errors in xcode8

so started commenting 1 one method/class in swift files

there found 1 method troubling compiler has not updated swift3 syntax's after changed syntax's ran successfully

many things need check if facing above issue in xcode8 swift3 please refer below syntax's

thank above comments helps me think issue

nsfetchrequest before :

 //let fetchrequest = nsfetchrequest() 

nsfetchrequest in swift3:

let fetchrequest = nsfetchrequest<sample>(entityname: "sample") 

note: **all delegate methods please re - write


declaring method parameters - no change in calling method

func getpagethumbnail(upc:string, pagenum:int)-> uiimage  {   } 

before:

if let ximage = gf.getpagethumbnail(self.upclabel.text!, pagenum: 3) uiimage? 

now in swift3:

if let ximage = gf.getpagethumbnail(upc:self.upclabel.text!, pagenum: 3) uiimage? 

dispatch queues in swift3 :

dispatchqueue.global().async {           dispatchqueue.main.async {          }  } 

swift3: cgrectmake cgrect

cgrect(x:0, y:0, width:80, height:80) 

cgpointmake cgpoint

cgpoint(x:10,  y:20); 

selectors in swift3:

let mytapgesture = uitapgesturerecognizer(target: self, action: #selector(tapped(_:)) )  func tapped(_ sender: uitapgesturerecognizer) { } 

subscript in swift3

extension string {   //   right(x) , left(x) function substring func right(i: int) -> string? {     return self[self.length-i ... self.length-1 ] }   func left(i: int) -> string? {     return self[0 ... i-1] }    subscript (i: int) -> character {     return self[self.characters.index(self.startindex, offsetby: i)] }  subscript (i: int) -> string {     return string(self[i] character) }  //added  swift3 replacement subscript (r: countableclosedrange<int>) -> string {     {         let startindex =  self.index(self.startindex, offsetby: r.lowerbound)         let endindex = self.index(startindex, offsetby: r.upperbound - r.lowerbound)         return self[startindex...endindex]     } } } 

Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -