Latest leak purports to show closer look at back panel of Apple's 'iPhone 6'

1235

Comments

  • Reply 81 of 110
    solipsismxsolipsismx Posts: 19,566member
    mstone wrote: »
    That might be a bit optimistic. Right now there isn't any Swift info out there for people who do not already code in Objective-C. Just following the examples in the iBook isn't going to get you very far without a background in Objective-C. You still need all the libraries and frameworks and know how to use them which the Swift iBook doesn't explain. If you are planning to write the entire app in Swift without that background you are going to have to wait until someone offers a beginner to advanced complete Swift tutorial. If you wanted to jump right in now your best bet is to learn Object-C because it will be quite a while before a pure Swift implementation exists. If you look at the Lister example app on dev, it is still full of Object-C libraries and frameworks.

    There is are some really great Obj-C tutorials on Lynda. That is what I used to get up to speed. Not free, but reasonable. I always maintain an annual subscription there and can highly recommend all their tutorials. Fantastic instructors.

    I have spent several years struggling to learn Obj-C and write Cocoa and Cocoa Touch apps so I'm not coming in without prior knowledge, but I do get tripped up easily with the complex, repetitive and seemingly redundant syntax of Obj-C. I understand the logic of the code and how to use the Xcode IDE so I'm hoping Swift will help me cut the fat that I constantly choke on when trying to write apps.
     0Likes 0Dislikes 0Informatives
  • Reply 82 of 110
    mstonemstone Posts: 11,510member
    Quote:
    Originally Posted by SolipsismX View Post

     
    I have spent several years struggling to learn Obj-C and write Cocoa and Cocoa Touch apps so I'm not coming in without prior knowledge, but I do get tripped up easily with the complex, repetitive and seemingly redundant syntax of Obj-C. I understand the logic of the code and how to use the Xcode IDE so I'm hoping Swift will help me cut the fat that I constantly choke on when trying to write apps.


    I know what you mean nevertheless, that same legacy coding style is still present in  all the frameworks so although Swift offers some greatly simplified scripting like syntax the real meat of an Xcode app is coming from the frameworks. Sure you can write an app without the frameworks but that is reinventing the wheel. As of now you still need the 1000's of methods in NSObject.

     0Likes 0Dislikes 0Informatives
  • Reply 83 of 110
    I don’t think you understand. Blind people don’t have the right to comment on matters of sight.
    Mean @ssholes are not allowed to comment too, but they do!
     0Likes 0Dislikes 0Informatives
  • Reply 84 of 110
    solipsismxsolipsismx Posts: 19,566member
    mstone wrote: »
    I know what you mean nevertheless, that same legacy coding style is still present in  all the frameworks so although Swift offers some greatly simplified scripting like syntax the real meat of an Xcode app is coming from the frameworks. Sure you can write an app without the frameworks but that is reinventing the wheel. As of now you still need the 1000's of methods in NSObject.

    But it's reduced and that's a huge benefit, not to mention the gains from reduced errors and other things that can kill your progress as you have to hunt down a single issue in a sea of shitty syntax. This is a huge improvement. Next year I expect they will be have pretty much Swift-based sessions and a lot more changes to make the frameworks and APIs easier.

    Objective-C:
    UITableView *myTableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
    

    Swift:
    let myTableView: UITableView = UITableView(frame: CGRectZero, style: .Grouped)
    


    edit: http://nshipster.com/ios8/
     0Likes 0Dislikes 0Informatives
  • Reply 85 of 110
    mstonemstone Posts: 11,510member
    Quote:
    Originally Posted by SolipsismX View Post

    Swift:

    Code:

    let myTableView: UITableView = UITableView(frame: CGRectZero, style: .Grouped)


     

    Don't you still have to write initialization code for that "let"? It is not automatic in Swift. I'm pretty sure that is Obj-C shorthand not Swift shorthand.

     0Likes 0Dislikes 0Informatives
  • Reply 86 of 110
    dasanman69dasanman69 Posts: 13,002member
    You know i love apple!! But at last they should make something new!

    They can only change the outer part but so much.
     0Likes 0Dislikes 0Informatives
  • Reply 87 of 110
    solipsismxsolipsismx Posts: 19,566member
    mstone wrote: »
    You still have to write initialization code for that "let".

    Sure, this is still writing code. It sounds like you'd only be happy if the code wrote itself from a thought you had.

    I don't think Apple made any comment that it was going to be magic, just that Swift will reduce time and effort from the amount of code (in most cases) to reducing bugs and making it generally safer.

    The readability is world's better without the extreme repetition, excessive '@' symbols and brackets, but my favorite is the inclusion of values in strings.
    println("I picked \(number) \(fruit).")
    
     0Likes 0Dislikes 0Informatives
  • Reply 88 of 110
    dasanman69 wrote: »
    They can only change the outer part but so much.
    You know, i don't mean the material. Okay the anode aluminium is good, but they can do something new, not again these 2 places on the top and the bottom of the rear side. Anyway i hope Tim Cook finally keep his 2013 promise and ll see at last all these "amazing new products" this fall.
     0Likes 0Dislikes 0Informatives
  • Reply 89 of 110
    mstonemstone Posts: 11,510member
    Quote:
    Originally Posted by SolipsismX View Post



    Sure, this is still writing code. It sounds like you'd only be happy if the code wrote itself from a thought you had.

     

    No I'm all in on Swift,  I just don't have enough info on how it is going to work during transition or how one gets by without being familiar with the NS references. All I'm saying about "init", is that code you mentioned is not substantially shorter because you still have to initialize it somewhere else.

    Quote:
    Originally Posted by SolipsismX View Post



    Sure, this is still writing code. It sounds like you'd only be happy if the code wrote itself from a thought you had.



    The readability is world's better without the extreme repetition, excessive '@' symbols and brackets, but my favorite is the inclusion of values in strings.

    Code:

    println("I picked \(number) \(fruit).")


     


    NSLog(@"I picked %i %@.", number, fruit);

     

    The Swift version is probably  more readable from a concatenation perceptive but it isn't any shorter.

     0Likes 0Dislikes 0Informatives
  • Reply 90 of 110
    solipsismxsolipsismx Posts: 19,566member
    mstone wrote: »
    No I'm all in on Swift,  I just don't have enough info on how it is going to work during transition or how one gets by without being familiar with the NS references. All I'm saying about "init", is that code you mentioned is not substantially shorter because you still have to initialize it somewhere else.

    NSLog(@"I picked %i %@", number, fruit);
    

    The Swift version is probably  more readable from a concatenation perceptive but it isn't any shorter.

    In that example you have still less characters — 41 for Obj-C v 39 for Swift, which won't always be the case — but shorter also refers to various time elements involved. Having to use the @ symbol constantly (there wasn't an example of excessive brackets here), and trying to read the code and figure out what's going on will be huge time savers in both learning to use the code as well as others coming into project and trying to get up to speed. Again, there is a lot more than be done and I'm sure will be done as Swift matures but this is a great start.


    edit:
    Xcode 4:
    NSArray *names = [[NSArray alloc] initWithObjects: @"Tom";, @"Dick";, @"Harry";, nil];
    
    Xcode 5:
    NSArray *names = @[@"Tom";, @"Dick";, @"Harry";];
    
    Swift:
    let names = ["Tom", "Dick", "Harry"]
    
     0Likes 0Dislikes 0Informatives
  • Reply 91 of 110
    mstonemstone Posts: 11,510member
    Quote:
    Originally Posted by SolipsismX View Post



    In that example you have still less characters — 41 for Obj-C v 39 for Swift, which won't always be the case — but shorter also refers to various time elements involved. Having to use the @ symbol constantly (there wasn't an example of excessive brackets here), and trying to read the code and figure out what's going on will be huge time savers in both learning to use the code as well as others coming into project and trying to get up to speed. Again, there is a lot more than be done and I'm sure will be done as Swift matures but this is a great start.

    I don't disagree. I am just making a point that programming with Swift without a working knowledge of Obj-C is not all that easy right now because there are limited examples or documentation available. Programming is programming. I've been through a few different languages over the past couple decades. I was never, and still not, a huge fan of Obj-C, but if you want to write iOS apps that is what we use. In many ways it is better than pure C. NeXt really took the high road when they forked C. Java and C++/C# broke all compatibility with C and Swift is staying on that course by leveraging the compiler functionality to remain binary compatible even though the language is not.

     

    With respect to the code examples: the placeholder replacement style of Obj-C comes directly from traditional C and Regular Expression syntax which is rather nerdy so I see your point, however I still think Swift's supplanting of Obj-C is not going to happen overnight. It will probably be a mash-up for a number of years. As I mentioned earlier, go look at what Apple is offering as an example of a Swift app on dev. It looks a lot like Obj-C to me.

     0Likes 0Dislikes 0Informatives
  • Reply 92 of 110
    tallest skiltallest skil Posts: 43,388member
    Originally Posted by cicconegreek View Post

    Mean @ssholes are not allowed to comment too, but they do!

     

    Try looking at the pictures before spewing lies instead, okay champ?

     0Likes 0Dislikes 0Informatives
  • Reply 93 of 110
    solipsismxsolipsismx Posts: 19,566member
    mstone wrote: »
    ...however I still think Swift's supplanting of Obj-C is not going to happen overnight. It will probably be a mash-up for a number of years.

    Sure. I bet a decade from now there will still be code that need the 'NS' prefix, but it's a great start and not one that anyone was expecting. And frankly, anything that will reduce time and effort, even if just a little right now is a big deal to me.
     0Likes 0Dislikes 0Informatives
  • Reply 94 of 110
    mstonemstone Posts: 11,510member
    Quote:
    Originally Posted by SolipsismX View Post

     

    Code:

    Xcode 5:
    NSArray *names = @[@"Tom";, @"Dick";, @"Harry";];

    Swift:
    let names = ["Tom", "Dick", "Harry"]


    I think it is worth mentioning that the @ signs are a signal to the compiler that what follows is Obj-C code, not traditional C code. Swift inherits its abbreviated syntax to the fact that the compiler engineers figured out a way to recognize , C, Obj-C and Swift code automatically thus the shorthand of Swift can be used sans semicolons, etc.  The same type of shorthand simplification has been ongoing within Obj-C itself, as well, over the last couple of versions of Xcode/LLVM, just not as dramatically as with the announcement of Swift.

     0Likes 0Dislikes 0Informatives
  • Reply 95 of 110
    mstonemstone Posts: 11,510member
    Quote:

    Originally Posted by mstone View Post

     
    Quote:
    Originally Posted by SolipsismX View Post

     

    Code:

    Xcode 5:
    NSArray *names = @[@"Tom";, @"Dick";, @"Harry";];

    Swift:
    let names = ["Tom", "Dick", "Harry"]




    Swift is new. I have not tested it at all. One thing I question about the above code is how do the bounds check work with a Swift array. If I asked for the value of names{101] , what would I get back? I know what the answer is in NSArray.

     0Likes 0Dislikes 0Informatives
  • Reply 96 of 110
    solipsismxsolipsismx Posts: 19,566member
    mstone wrote: »
    I think it is worth mentioning that the @ signs are a signal to the compiler that what follows is Obj-C code, not traditional C code. Swift inherits its abbreviated syntax to the fact that the compiler engineers figured out a way to recognize , C, Obj-C and Swift code automatically thus the shorthand of Swift can be used sans semicolons, etc.  The same type of shorthand simplification has been ongoing within Obj-C itself, as well, over the last couple of versions of Xcode/LLMV, just not as dramatically as with the announcement of Swift.

    Sure, but that was a huge annoyance for me when trying to learning Obj-C and also attempting to write it today. Besides being visually unappealing I find it easy to omit an @ not catch it right away.

    Personally, I wish Swift did even more by realizing that Tom, Dick, and Harry are single word strings and allowing me to omit the quotes unless it's required. For example, let me use...
    let names = [Tom, Dick, Harry]
    

    ...or add the quotes if the string will have a space...
    let names = [Tom, "Dick Applebaum", Harry]
    
     0Likes 0Dislikes 0Informatives
  • Reply 97 of 110
    solipsismxsolipsismx Posts: 19,566member
    mstone wrote: »
    Swift is new. I have not tested it at all. One thing I question about the above code is how do the bounds check work with a Swift array. If I asked for the value of names{101] , what would I get back? I know what the answer is in NSArray.

    You mean something like this?
     0Likes 0Dislikes 0Informatives
  • Reply 98 of 110

    As I understand it, the price of iphone 5 iphone 6 will be more expensive around $ 100, I'm waiting for an official date iphone 6 sold in the market. Hopefully utility features will not disappoint me.

     0Likes 0Dislikes 0Informatives
  • Reply 99 of 110
    jccjcc Posts: 339member
    True tone is not being abandoned. Notice that the hole for the flash is BIGGER than the standard single tone LEDs? They probably have some new design that embed both into the larger circle.
     0Likes 0Dislikes 0Informatives
  • Reply 100 of 110
    mstonemstone Posts: 11,510member
    Quote:
    Originally Posted by SolipsismX View Post

     
    Personally, I wish Swift did even more by realizing that Tom, Dick, and Harry are single word strings and allowing me to omit the quotes unless it's required. For example, let me use...



    Code:

    let names = [Tom, Dick, Harry]



    ...or add the quotes if the string will have a space...

    Code:

    let names = [Tom, "Dick Applebaum", Harry]


    Sure, Swift is smart but it isn't a mind reader. What if one of your array values is something that has either a constant, variable, keyword or method name already associated with it. You need uniformity and non ambiguous syntax. a string needs quotes, ALWAYS!

     0Likes 0Dislikes 0Informatives
Sign In or Register to comment.