[swift-users] Swift 3 Whole Module Optimization Issue

Jun Zhang jhzhangdev at gmail.com
Wed Dec 21 20:48:11 CST 2016


Hi, everyone.
   I think I found a swift 3 whole module optimization issue. The code
below, when building with release configuration and running on an iOS 10
real device, will always causes a crash.

import UIKit
> class ViewController: UIViewController {
>     override func viewDidLoad() {
>         super.viewDidLoad()
>         // Do any additional setup after loading the view.
>         super.viewDidLoad()
>
>         let orderby = "time"
>         let url = "http://www.sample.com/api/index.php?\(orderby)"
>
>         Log("Request url: \(url)")
>
>         if let url = URL(string: url) {
>             let request = URLRequest(url: url)
>             print(request)
>         }
>     }
>     override func didReceiveMemoryWarning() {
>         super.didReceiveMemoryWarning()
>         // Dispose of any resources that can be recreated.
>     }
>
> }
> func Log(_ log: String) {
>     //    NSLog("%@", log)
> }


You can see the attachment for more detail info.
Or if you use github, this is the repo:
https://github.com/zaczh/Swift3ClosureDemo
​
 Swift3ClosureDemo-master.zip
<https://drive.google.com/file/d/0B5P4DPGNr-B0RUhTMlFKaFg3Q1k/view?usp=drive_web>
​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20161222/eb704441/attachment.html>


More information about the swift-users mailing list