├── doc
├── screenshot.gif
├── screenshot.png
└── complex-plane.png
├── .gitignore
├── SwiftComplex.xcodeproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
└── project.pbxproj
├── SwiftComplex
├── Images.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Info.plist
├── MasterViewController.swift
├── AppDelegate.swift
├── Complex.swift
├── ComplexPlane.swift
├── DetailViewController.swift
└── Base.lproj
│ ├── LaunchScreen.xib
│ └── Main.storyboard
├── SwiftComplexTests
├── Info.plist
└── SwiftComplexTests.swift
├── LICENSE.md
└── README.md
/doc/screenshot.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taketo1024/SwiftComplex/HEAD/doc/screenshot.gif
--------------------------------------------------------------------------------
/doc/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taketo1024/SwiftComplex/HEAD/doc/screenshot.png
--------------------------------------------------------------------------------
/doc/complex-plane.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/taketo1024/SwiftComplex/HEAD/doc/complex-plane.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Mac
2 | .DS_Store
3 |
4 | # Xcode
5 | build/*
6 | *.pbxuser
7 | *.xcworkspace
8 | xcuserdata
9 |
10 | #CocoaPod
11 | Pods/*
12 |
--------------------------------------------------------------------------------
/SwiftComplex.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/SwiftComplex/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/SwiftComplexTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | jp.taketo1024.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/SwiftComplexTests/SwiftComplexTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SwiftComplexTests.swift
3 | // SwiftComplexTests
4 | //
5 | // Created by Taketo Sano on 2014/10/18.
6 | //
7 | //
8 |
9 | import UIKit
10 | import XCTest
11 |
12 | class SwiftComplexTests: XCTestCase {
13 |
14 | override func setUp() {
15 | super.setUp()
16 | // Put setup code here. This method is called before the invocation of each test method in the class.
17 | }
18 |
19 | override func tearDown() {
20 | // Put teardown code here. This method is called after the invocation of each test method in the class.
21 | super.tearDown()
22 | }
23 |
24 | func testExample() {
25 | // This is an example of a functional test case.
26 | XCTAssert(true, "Pass")
27 | }
28 |
29 | func testPerformanceExample() {
30 | // This is an example of a performance test case.
31 | self.measureBlock() {
32 | // Put the code you want to measure the time of here.
33 | }
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) {{{year}}} {{{fullname}}}
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | SwiftComplex
2 | ============
3 |
4 | 
5 |
6 | *Interact with Complex Numbers!* This is a simple project which you can visually understand how complex multiplication works.
7 |
8 | # Complex
9 |
10 | ```swift
11 | let z = 3 + 2 * i
12 | let w = -2 - i
13 | z + w == 1 + i
14 | z * w == -4 - 7 * i
15 | ```
16 |
17 | Also supports polar form.
18 |
19 | ```swift
20 | let z = Complex(r: 2, θ: M_PI / 4)
21 | abs(z) == 2
22 | arg(z) == M_PI / 4
23 | ```
24 |
25 | [Check out the code](./SwiftComplex/Complex.swift) and see how simple they are implemented!
26 |
27 | # ComplexPlane
28 |
29 | 
30 |
31 | ```
32 | let cplane = ComplexPlane(frame: …)
33 | cplane["1"] = Complex(1)
34 | cplane["i"] = i
35 |
36 | let z = Complex(r: 2, θ: M_PI / 3)
37 | cplane["z"] = z
38 | cplane.colors["z"] = UIColor.redColor()
39 |
40 | let w = z * z
41 | cplane["w"] = w
42 | cplane.colors["w"] = UIColor.blueColor()
43 | ```
44 |
45 | [Here's the code](./SwiftComplex/ComplexPlane.swift).
46 |
47 | # Copyright and license
48 |
49 | copyright 2014 Taketo Sano. Code released under the [MIT license](LICENSE.md).
50 |
--------------------------------------------------------------------------------
/SwiftComplex/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | jp.taketo1024.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UIStatusBarTintParameters
34 |
35 | UINavigationBar
36 |
37 | Style
38 | UIBarStyleDefault
39 | Translucent
40 |
41 |
42 |
43 | UISupportedInterfaceOrientations
44 |
45 | UIInterfaceOrientationPortrait
46 | UIInterfaceOrientationLandscapeLeft
47 | UIInterfaceOrientationLandscapeRight
48 | UIInterfaceOrientationPortraitUpsideDown
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/SwiftComplex/MasterViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // MasterViewController.swift
3 | // SwiftComplex
4 | //
5 | // Created by Taketo Sano on 2014/10/18.
6 | //
7 | //
8 |
9 | import UIKit
10 |
11 | class MasterViewController: UITableViewController {
12 |
13 | let titles = ["w = z * z", "w = 1 / z", "w = z^2 + z + 1"]
14 |
15 | func map(index: Int) -> ((Complex) -> Complex) {
16 | switch(index) {
17 | case 0: return {$0 * $0}
18 | case 1: return {1 / $0}
19 | case 2: return {$0 * $0 + $0 + 1}
20 | default: return {$0}
21 | }
22 | }
23 |
24 | override func awakeFromNib() {
25 | super.awakeFromNib()
26 | }
27 |
28 | override func viewDidLoad() {
29 | super.viewDidLoad()
30 | }
31 |
32 | override func didReceiveMemoryWarning() {
33 | super.didReceiveMemoryWarning()
34 | }
35 |
36 | // MARK: - Segue
37 |
38 | override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
39 | if segue.identifier == "showDetail" {
40 | let vc = segue.destinationViewController as DetailViewController
41 | if let indexPath = self.tableView.indexPathForSelectedRow() {
42 | let index = indexPath.row
43 | vc.title = titles[index];
44 | vc.map = map(index)
45 | }
46 | }
47 | }
48 |
49 | // MARK: - Table View
50 |
51 | override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
52 | return 1
53 | }
54 |
55 | override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
56 | return titles.count
57 | }
58 |
59 | override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
60 | let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as UITableViewCell
61 |
62 | let object = titles[indexPath.row] as String
63 | cell.textLabel?.text = object
64 | return cell
65 | }
66 | }
67 |
68 |
--------------------------------------------------------------------------------
/SwiftComplex/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // SwiftComplex
4 | //
5 | // Created by Taketo Sano on 2014/10/18.
6 | //
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 | var window: UIWindow?
15 |
16 |
17 | func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
18 | // Override point for customization after application launch.
19 | return true
20 | }
21 |
22 | func applicationWillResignActive(application: UIApplication) {
23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
24 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
25 | }
26 |
27 | func applicationDidEnterBackground(application: UIApplication) {
28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
30 | }
31 |
32 | func applicationWillEnterForeground(application: UIApplication) {
33 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
34 | }
35 |
36 | func applicationDidBecomeActive(application: UIApplication) {
37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
38 | }
39 |
40 | func applicationWillTerminate(application: UIApplication) {
41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
42 | }
43 |
44 |
45 | }
46 |
47 |
--------------------------------------------------------------------------------
/SwiftComplex/Complex.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Complex.swift
3 | // SwiftComplex
4 | //
5 | // Created by Taketo Sano on 2014/10/18.
6 | //
7 | //
8 |
9 | import Foundation
10 |
11 | struct Complex: Equatable, IntegerLiteralConvertible, FloatLiteralConvertible {
12 | let x: Double
13 | let y: Double
14 |
15 | init(_ x: Double, _ y: Double) {
16 | self.x = x
17 | self.y = y
18 | }
19 |
20 | init(_ x: Double) {
21 | self.x = x
22 | self.y = 0
23 | }
24 |
25 | init(integerLiteral x: IntegerLiteralType) {
26 | self.x = Double(x)
27 | self.y = 0
28 | }
29 |
30 | init(floatLiteral x: FloatLiteralType) {
31 | self.x = x
32 | self.y = 0
33 | }
34 |
35 | init(r: Double, θ: Double) {
36 | self.x = r * cos(θ)
37 | self.y = r * sin(θ)
38 | }
39 | }
40 |
41 | func == (z: Complex, w: Complex) -> Bool {
42 | return z.x == w.x && z.y == w.y
43 | }
44 |
45 | func Re(a: Complex) -> Double {
46 | return a.x
47 | }
48 |
49 | func Im(a: Complex) -> Double {
50 | return a.y
51 | }
52 |
53 | prefix func ~(a: Complex) -> Complex {
54 | return Complex(a.x, -a.y);
55 | }
56 |
57 | func + (z: Complex, w: Complex) -> Complex {
58 | return Complex(z.x + w.x, z.y + w.y)
59 | }
60 |
61 | func - (z: Complex, w: Complex) -> Complex {
62 | return Complex(z.x - w.x, z.y - w.y)
63 | }
64 |
65 | prefix func -(z: Complex) -> Complex {
66 | return Complex(-z.x, -z.y);
67 | }
68 |
69 | func * (a: Double, z: Complex) -> Complex {
70 | return Complex(a * z.x, a * z.y)
71 | }
72 |
73 | func * (z: Complex, w: Complex) -> Complex {
74 | return Complex(z.x * w.x - z.y * w.y, z.x * w.y + z.y * w.x)
75 | }
76 |
77 | func / (z: Complex, w: Complex) -> Complex {
78 | let w_inv = Complex(w.x / (w.x * w.x + w.y * w.y), -w.y / (w.x * w.x + w.y * w.y))
79 | return z * w_inv
80 | }
81 |
82 | func abs(z: Complex) -> Double {
83 | return sqrt(z.x * z.x + z.y * z.y)
84 | }
85 |
86 | func arg(z: Complex) -> Double {
87 | let r = abs(z)
88 | if(r == 0) {
89 | return 0
90 | }
91 |
92 | let t = acos(z.x / r)
93 | return (z.y >= 0) ? t : 2 * M_PI - t
94 | }
95 |
96 | func exp(z: Complex) -> Complex {
97 | return Complex(exp(z.x) * cos(z.y), exp(z.x) * sin(z.y))
98 | }
99 |
100 | let i = Complex(0, 1)
101 |
--------------------------------------------------------------------------------
/SwiftComplex/ComplexPlane.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ComplexPlane.swift
3 | // SwiftComplex
4 | //
5 | // Created by Taketo Sano on 2014/10/18.
6 | //
7 | //
8 |
9 | import UIKit
10 |
11 | class ComplexPlane : UIView {
12 | var pointSize: CGFloat = 8.0
13 | var unit: CGFloat = 50.0
14 | var scale: CGFloat = 1.0
15 | var points: [String: Complex] = [:]
16 | var colors: [String: UIColor] = [:]
17 |
18 | subscript(name: String) -> Complex? {
19 | get {
20 | return points[name]
21 | }
22 | set(value) {
23 | points[name] = value
24 | }
25 | }
26 |
27 | override func drawRect(rect: CGRect) {
28 | let ctx = UIGraphicsGetCurrentContext()
29 | let centerX = self.bounds.width / 2
30 | let centerY = self.bounds.height / 2
31 |
32 | // fill background
33 | CGContextSetFillColorWithColor(ctx, UIColor.whiteColor().CGColor)
34 | CGContextFillRect(ctx, self.bounds)
35 |
36 | // draw axises
37 | CGContextSetLineWidth(ctx, 1)
38 | CGContextSetStrokeColorWithColor(ctx, UIColor.blackColor().CGColor)
39 |
40 | CGContextMoveToPoint(ctx, 0, centerY)
41 | CGContextAddLineToPoint(ctx, self.bounds.width, centerY)
42 | CGContextStrokePath(ctx)
43 |
44 | CGContextMoveToPoint(ctx, centerX, 0)
45 | CGContextAddLineToPoint(ctx, centerX, self.bounds.height)
46 | CGContextStrokePath(ctx)
47 |
48 | // draw points
49 | for (name, z) in points {
50 | let u = unit / scale
51 | let point = CGPoint(x: centerX + u * CGFloat(z.x), y: centerY - u * CGFloat(z.y))
52 | let color = (colors[name] != nil) ? colors[name]! : UIColor.blackColor()
53 |
54 | // draw point
55 | CGContextSetFillColorWithColor(ctx, color.CGColor)
56 | CGContextAddArc(ctx, point.x, point.y, pointSize / 2, 0, CGFloat(2 * M_PI), 0)
57 | CGContextFillPath(ctx)
58 |
59 | // draw name
60 | let text: NSString = name
61 | let textPoint = CGPoint(x: point.x + 5, y: point.y)
62 | text.drawAtPoint(textPoint, withAttributes:[NSForegroundColorAttributeName: color])
63 | }
64 | }
65 |
66 | func complexAtPoint(point: CGPoint) -> Complex {
67 | let u = unit / scale
68 | let centerX = self.bounds.width / 2
69 | let centerY = self.bounds.height / 2
70 |
71 | return Complex(Double((point.x - centerX) / u), -Double((point.y - centerY) / u))
72 | }
73 | }
--------------------------------------------------------------------------------
/SwiftComplex/DetailViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DetailViewController.swift
3 | // SwiftComplex
4 | //
5 | // Created by Taketo Sano on 2014/10/18.
6 | //
7 | //
8 |
9 | import UIKit
10 |
11 | class DetailViewController: UIViewController {
12 |
13 | @IBOutlet weak var plane: ComplexPlane!
14 | @IBOutlet weak var autoButton: UIButton!
15 |
16 | var map: ((Complex) -> Complex)?
17 |
18 | private var z: Complex = 0
19 | private var timer: NSTimer?
20 | private var touched = false
21 |
22 | override func viewDidLoad() {
23 | super.viewDidLoad()
24 |
25 | plane.scale = 1.0
26 | plane.pointSize = 10
27 | plane["1"] = 1
28 | plane["i"] = i
29 |
30 | z = Complex(r: 2, θ: M_PI / 3)
31 | self.update()
32 | }
33 |
34 | deinit {
35 | timer?.invalidate()
36 | }
37 |
38 | func update() {
39 | plane["z"] = z
40 | plane.colors["z"] = UIColor.redColor()
41 | plane["w"] = map?(z)
42 | plane.colors["w"] = UIColor.blueColor()
43 | plane.setNeedsDisplay()
44 | }
45 |
46 | override func touchesBegan(touches: NSSet, withEvent event: UIEvent) {
47 | let touch = (touches.anyObject() as UITouch?)!
48 | let point = touch.locationInView(plane)
49 |
50 | if (plane.pointInside(point, withEvent: nil)) {
51 | z = plane.complexAtPoint(point)
52 | self.update()
53 | }
54 |
55 | touched = true
56 | }
57 |
58 | override func touchesMoved(touches: NSSet, withEvent event: UIEvent) {
59 | let touch = (touches.anyObject() as UITouch?)!
60 | let point = touch.locationInView(plane)
61 |
62 | if (plane.pointInside(point, withEvent: nil)) {
63 | z = plane.complexAtPoint(point)
64 | self.update()
65 | }
66 | }
67 |
68 | override func touchesCancelled(touches: NSSet!, withEvent event: UIEvent!) {
69 | touched = false
70 | }
71 |
72 | override func touchesEnded(touches: NSSet, withEvent event: UIEvent) {
73 | touched = false
74 | }
75 |
76 | @IBAction func autoButtonTapped() {
77 | autoButton.selected = !autoButton.selected;
78 | if(autoButton.selected) {
79 | timer = NSTimer.scheduledTimerWithTimeInterval(0.01, target:self, selector:"timerFired", userInfo: nil, repeats: true)
80 | timer?.fire()
81 | } else {
82 | timer?.invalidate()
83 | }
84 | }
85 |
86 | func timerFired() {
87 | if(!touched) {
88 | z = Complex(r: abs(z), θ: arg(z) + M_PI / 60)
89 | self.update()
90 | }
91 | }
92 | }
93 |
94 |
--------------------------------------------------------------------------------
/SwiftComplex/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/SwiftComplex/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
--------------------------------------------------------------------------------
/SwiftComplex.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 2BEB564219F235BF0069F44A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BEB564119F235BF0069F44A /* AppDelegate.swift */; };
11 | 2BEB564419F235BF0069F44A /* MasterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BEB564319F235BF0069F44A /* MasterViewController.swift */; };
12 | 2BEB564619F235BF0069F44A /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BEB564519F235BF0069F44A /* DetailViewController.swift */; };
13 | 2BEB564919F235BF0069F44A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2BEB564719F235BF0069F44A /* Main.storyboard */; };
14 | 2BEB564B19F235BF0069F44A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2BEB564A19F235BF0069F44A /* Images.xcassets */; };
15 | 2BEB564E19F235BF0069F44A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2BEB564C19F235BF0069F44A /* LaunchScreen.xib */; };
16 | 2BEB565A19F235BF0069F44A /* SwiftComplexTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BEB565919F235BF0069F44A /* SwiftComplexTests.swift */; };
17 | 2BEB566519F2368E0069F44A /* Complex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BEB566419F2368E0069F44A /* Complex.swift */; };
18 | 2BEB566719F236C90069F44A /* ComplexPlane.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2BEB566619F236C90069F44A /* ComplexPlane.swift */; };
19 | /* End PBXBuildFile section */
20 |
21 | /* Begin PBXContainerItemProxy section */
22 | 2BEB565419F235BF0069F44A /* PBXContainerItemProxy */ = {
23 | isa = PBXContainerItemProxy;
24 | containerPortal = 2BEB563419F235BF0069F44A /* Project object */;
25 | proxyType = 1;
26 | remoteGlobalIDString = 2BEB563B19F235BF0069F44A;
27 | remoteInfo = SwiftComplex;
28 | };
29 | /* End PBXContainerItemProxy section */
30 |
31 | /* Begin PBXFileReference section */
32 | 2BEB563C19F235BF0069F44A /* SwiftComplex.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SwiftComplex.app; sourceTree = BUILT_PRODUCTS_DIR; };
33 | 2BEB564019F235BF0069F44A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
34 | 2BEB564119F235BF0069F44A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
35 | 2BEB564319F235BF0069F44A /* MasterViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MasterViewController.swift; sourceTree = ""; };
36 | 2BEB564519F235BF0069F44A /* DetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = ""; };
37 | 2BEB564819F235BF0069F44A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
38 | 2BEB564A19F235BF0069F44A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; };
39 | 2BEB564D19F235BF0069F44A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
40 | 2BEB565319F235BF0069F44A /* SwiftComplexTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftComplexTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
41 | 2BEB565819F235BF0069F44A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
42 | 2BEB565919F235BF0069F44A /* SwiftComplexTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftComplexTests.swift; sourceTree = ""; };
43 | 2BEB566419F2368E0069F44A /* Complex.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Complex.swift; sourceTree = ""; };
44 | 2BEB566619F236C90069F44A /* ComplexPlane.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ComplexPlane.swift; sourceTree = ""; };
45 | /* End PBXFileReference section */
46 |
47 | /* Begin PBXFrameworksBuildPhase section */
48 | 2BEB563919F235BF0069F44A /* Frameworks */ = {
49 | isa = PBXFrameworksBuildPhase;
50 | buildActionMask = 2147483647;
51 | files = (
52 | );
53 | runOnlyForDeploymentPostprocessing = 0;
54 | };
55 | 2BEB565019F235BF0069F44A /* Frameworks */ = {
56 | isa = PBXFrameworksBuildPhase;
57 | buildActionMask = 2147483647;
58 | files = (
59 | );
60 | runOnlyForDeploymentPostprocessing = 0;
61 | };
62 | /* End PBXFrameworksBuildPhase section */
63 |
64 | /* Begin PBXGroup section */
65 | 2BEB563319F235BF0069F44A = {
66 | isa = PBXGroup;
67 | children = (
68 | 2BEB563E19F235BF0069F44A /* SwiftComplex */,
69 | 2BEB566319F236330069F44A /* Complex */,
70 | 2BEB565619F235BF0069F44A /* SwiftComplexTests */,
71 | 2BEB563D19F235BF0069F44A /* Products */,
72 | );
73 | sourceTree = "";
74 | };
75 | 2BEB563D19F235BF0069F44A /* Products */ = {
76 | isa = PBXGroup;
77 | children = (
78 | 2BEB563C19F235BF0069F44A /* SwiftComplex.app */,
79 | 2BEB565319F235BF0069F44A /* SwiftComplexTests.xctest */,
80 | );
81 | name = Products;
82 | sourceTree = "";
83 | };
84 | 2BEB563E19F235BF0069F44A /* SwiftComplex */ = {
85 | isa = PBXGroup;
86 | children = (
87 | 2BEB564C19F235BF0069F44A /* LaunchScreen.xib */,
88 | 2BEB564719F235BF0069F44A /* Main.storyboard */,
89 | 2BEB564119F235BF0069F44A /* AppDelegate.swift */,
90 | 2BEB564319F235BF0069F44A /* MasterViewController.swift */,
91 | 2BEB564519F235BF0069F44A /* DetailViewController.swift */,
92 | 2BEB564A19F235BF0069F44A /* Images.xcassets */,
93 | 2BEB563F19F235BF0069F44A /* Supporting Files */,
94 | );
95 | path = SwiftComplex;
96 | sourceTree = "";
97 | };
98 | 2BEB563F19F235BF0069F44A /* Supporting Files */ = {
99 | isa = PBXGroup;
100 | children = (
101 | 2BEB564019F235BF0069F44A /* Info.plist */,
102 | );
103 | name = "Supporting Files";
104 | sourceTree = "";
105 | };
106 | 2BEB565619F235BF0069F44A /* SwiftComplexTests */ = {
107 | isa = PBXGroup;
108 | children = (
109 | 2BEB565919F235BF0069F44A /* SwiftComplexTests.swift */,
110 | 2BEB565719F235BF0069F44A /* Supporting Files */,
111 | );
112 | path = SwiftComplexTests;
113 | sourceTree = "";
114 | };
115 | 2BEB565719F235BF0069F44A /* Supporting Files */ = {
116 | isa = PBXGroup;
117 | children = (
118 | 2BEB565819F235BF0069F44A /* Info.plist */,
119 | );
120 | name = "Supporting Files";
121 | sourceTree = "";
122 | };
123 | 2BEB566319F236330069F44A /* Complex */ = {
124 | isa = PBXGroup;
125 | children = (
126 | 2BEB566419F2368E0069F44A /* Complex.swift */,
127 | 2BEB566619F236C90069F44A /* ComplexPlane.swift */,
128 | );
129 | name = Complex;
130 | path = SwiftComplex;
131 | sourceTree = "";
132 | };
133 | /* End PBXGroup section */
134 |
135 | /* Begin PBXNativeTarget section */
136 | 2BEB563B19F235BF0069F44A /* SwiftComplex */ = {
137 | isa = PBXNativeTarget;
138 | buildConfigurationList = 2BEB565D19F235BF0069F44A /* Build configuration list for PBXNativeTarget "SwiftComplex" */;
139 | buildPhases = (
140 | 2BEB563819F235BF0069F44A /* Sources */,
141 | 2BEB563919F235BF0069F44A /* Frameworks */,
142 | 2BEB563A19F235BF0069F44A /* Resources */,
143 | );
144 | buildRules = (
145 | );
146 | dependencies = (
147 | );
148 | name = SwiftComplex;
149 | productName = SwiftComplex;
150 | productReference = 2BEB563C19F235BF0069F44A /* SwiftComplex.app */;
151 | productType = "com.apple.product-type.application";
152 | };
153 | 2BEB565219F235BF0069F44A /* SwiftComplexTests */ = {
154 | isa = PBXNativeTarget;
155 | buildConfigurationList = 2BEB566019F235BF0069F44A /* Build configuration list for PBXNativeTarget "SwiftComplexTests" */;
156 | buildPhases = (
157 | 2BEB564F19F235BF0069F44A /* Sources */,
158 | 2BEB565019F235BF0069F44A /* Frameworks */,
159 | 2BEB565119F235BF0069F44A /* Resources */,
160 | );
161 | buildRules = (
162 | );
163 | dependencies = (
164 | 2BEB565519F235BF0069F44A /* PBXTargetDependency */,
165 | );
166 | name = SwiftComplexTests;
167 | productName = SwiftComplexTests;
168 | productReference = 2BEB565319F235BF0069F44A /* SwiftComplexTests.xctest */;
169 | productType = "com.apple.product-type.bundle.unit-test";
170 | };
171 | /* End PBXNativeTarget section */
172 |
173 | /* Begin PBXProject section */
174 | 2BEB563419F235BF0069F44A /* Project object */ = {
175 | isa = PBXProject;
176 | attributes = {
177 | LastUpgradeCheck = 0600;
178 | ORGANIZATIONNAME = "yahoo japan";
179 | TargetAttributes = {
180 | 2BEB563B19F235BF0069F44A = {
181 | CreatedOnToolsVersion = 6.0.1;
182 | };
183 | 2BEB565219F235BF0069F44A = {
184 | CreatedOnToolsVersion = 6.0.1;
185 | TestTargetID = 2BEB563B19F235BF0069F44A;
186 | };
187 | };
188 | };
189 | buildConfigurationList = 2BEB563719F235BF0069F44A /* Build configuration list for PBXProject "SwiftComplex" */;
190 | compatibilityVersion = "Xcode 3.2";
191 | developmentRegion = English;
192 | hasScannedForEncodings = 0;
193 | knownRegions = (
194 | en,
195 | Base,
196 | );
197 | mainGroup = 2BEB563319F235BF0069F44A;
198 | productRefGroup = 2BEB563D19F235BF0069F44A /* Products */;
199 | projectDirPath = "";
200 | projectRoot = "";
201 | targets = (
202 | 2BEB563B19F235BF0069F44A /* SwiftComplex */,
203 | 2BEB565219F235BF0069F44A /* SwiftComplexTests */,
204 | );
205 | };
206 | /* End PBXProject section */
207 |
208 | /* Begin PBXResourcesBuildPhase section */
209 | 2BEB563A19F235BF0069F44A /* Resources */ = {
210 | isa = PBXResourcesBuildPhase;
211 | buildActionMask = 2147483647;
212 | files = (
213 | 2BEB564919F235BF0069F44A /* Main.storyboard in Resources */,
214 | 2BEB564E19F235BF0069F44A /* LaunchScreen.xib in Resources */,
215 | 2BEB564B19F235BF0069F44A /* Images.xcassets in Resources */,
216 | );
217 | runOnlyForDeploymentPostprocessing = 0;
218 | };
219 | 2BEB565119F235BF0069F44A /* Resources */ = {
220 | isa = PBXResourcesBuildPhase;
221 | buildActionMask = 2147483647;
222 | files = (
223 | );
224 | runOnlyForDeploymentPostprocessing = 0;
225 | };
226 | /* End PBXResourcesBuildPhase section */
227 |
228 | /* Begin PBXSourcesBuildPhase section */
229 | 2BEB563819F235BF0069F44A /* Sources */ = {
230 | isa = PBXSourcesBuildPhase;
231 | buildActionMask = 2147483647;
232 | files = (
233 | 2BEB566519F2368E0069F44A /* Complex.swift in Sources */,
234 | 2BEB564619F235BF0069F44A /* DetailViewController.swift in Sources */,
235 | 2BEB566719F236C90069F44A /* ComplexPlane.swift in Sources */,
236 | 2BEB564419F235BF0069F44A /* MasterViewController.swift in Sources */,
237 | 2BEB564219F235BF0069F44A /* AppDelegate.swift in Sources */,
238 | );
239 | runOnlyForDeploymentPostprocessing = 0;
240 | };
241 | 2BEB564F19F235BF0069F44A /* Sources */ = {
242 | isa = PBXSourcesBuildPhase;
243 | buildActionMask = 2147483647;
244 | files = (
245 | 2BEB565A19F235BF0069F44A /* SwiftComplexTests.swift in Sources */,
246 | );
247 | runOnlyForDeploymentPostprocessing = 0;
248 | };
249 | /* End PBXSourcesBuildPhase section */
250 |
251 | /* Begin PBXTargetDependency section */
252 | 2BEB565519F235BF0069F44A /* PBXTargetDependency */ = {
253 | isa = PBXTargetDependency;
254 | target = 2BEB563B19F235BF0069F44A /* SwiftComplex */;
255 | targetProxy = 2BEB565419F235BF0069F44A /* PBXContainerItemProxy */;
256 | };
257 | /* End PBXTargetDependency section */
258 |
259 | /* Begin PBXVariantGroup section */
260 | 2BEB564719F235BF0069F44A /* Main.storyboard */ = {
261 | isa = PBXVariantGroup;
262 | children = (
263 | 2BEB564819F235BF0069F44A /* Base */,
264 | );
265 | name = Main.storyboard;
266 | sourceTree = "";
267 | };
268 | 2BEB564C19F235BF0069F44A /* LaunchScreen.xib */ = {
269 | isa = PBXVariantGroup;
270 | children = (
271 | 2BEB564D19F235BF0069F44A /* Base */,
272 | );
273 | name = LaunchScreen.xib;
274 | sourceTree = "";
275 | };
276 | /* End PBXVariantGroup section */
277 |
278 | /* Begin XCBuildConfiguration section */
279 | 2BEB565B19F235BF0069F44A /* Debug */ = {
280 | isa = XCBuildConfiguration;
281 | buildSettings = {
282 | ALWAYS_SEARCH_USER_PATHS = NO;
283 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
284 | CLANG_CXX_LIBRARY = "libc++";
285 | CLANG_ENABLE_MODULES = YES;
286 | CLANG_ENABLE_OBJC_ARC = YES;
287 | CLANG_WARN_BOOL_CONVERSION = YES;
288 | CLANG_WARN_CONSTANT_CONVERSION = YES;
289 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
290 | CLANG_WARN_EMPTY_BODY = YES;
291 | CLANG_WARN_ENUM_CONVERSION = YES;
292 | CLANG_WARN_INT_CONVERSION = YES;
293 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
294 | CLANG_WARN_UNREACHABLE_CODE = YES;
295 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
296 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
297 | COPY_PHASE_STRIP = NO;
298 | ENABLE_STRICT_OBJC_MSGSEND = YES;
299 | GCC_C_LANGUAGE_STANDARD = gnu99;
300 | GCC_DYNAMIC_NO_PIC = NO;
301 | GCC_OPTIMIZATION_LEVEL = 0;
302 | GCC_PREPROCESSOR_DEFINITIONS = (
303 | "DEBUG=1",
304 | "$(inherited)",
305 | );
306 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
307 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
308 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
309 | GCC_WARN_UNDECLARED_SELECTOR = YES;
310 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
311 | GCC_WARN_UNUSED_FUNCTION = YES;
312 | GCC_WARN_UNUSED_VARIABLE = YES;
313 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
314 | MTL_ENABLE_DEBUG_INFO = YES;
315 | ONLY_ACTIVE_ARCH = YES;
316 | SDKROOT = iphoneos;
317 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
318 | };
319 | name = Debug;
320 | };
321 | 2BEB565C19F235BF0069F44A /* Release */ = {
322 | isa = XCBuildConfiguration;
323 | buildSettings = {
324 | ALWAYS_SEARCH_USER_PATHS = NO;
325 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
326 | CLANG_CXX_LIBRARY = "libc++";
327 | CLANG_ENABLE_MODULES = YES;
328 | CLANG_ENABLE_OBJC_ARC = YES;
329 | CLANG_WARN_BOOL_CONVERSION = YES;
330 | CLANG_WARN_CONSTANT_CONVERSION = YES;
331 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
332 | CLANG_WARN_EMPTY_BODY = YES;
333 | CLANG_WARN_ENUM_CONVERSION = YES;
334 | CLANG_WARN_INT_CONVERSION = YES;
335 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
336 | CLANG_WARN_UNREACHABLE_CODE = YES;
337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
339 | COPY_PHASE_STRIP = YES;
340 | ENABLE_NS_ASSERTIONS = NO;
341 | ENABLE_STRICT_OBJC_MSGSEND = YES;
342 | GCC_C_LANGUAGE_STANDARD = gnu99;
343 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
344 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
345 | GCC_WARN_UNDECLARED_SELECTOR = YES;
346 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
347 | GCC_WARN_UNUSED_FUNCTION = YES;
348 | GCC_WARN_UNUSED_VARIABLE = YES;
349 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
350 | MTL_ENABLE_DEBUG_INFO = NO;
351 | SDKROOT = iphoneos;
352 | VALIDATE_PRODUCT = YES;
353 | };
354 | name = Release;
355 | };
356 | 2BEB565E19F235BF0069F44A /* Debug */ = {
357 | isa = XCBuildConfiguration;
358 | buildSettings = {
359 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
360 | INFOPLIST_FILE = SwiftComplex/Info.plist;
361 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
362 | PRODUCT_NAME = "$(TARGET_NAME)";
363 | TARGETED_DEVICE_FAMILY = "1,2";
364 | };
365 | name = Debug;
366 | };
367 | 2BEB565F19F235BF0069F44A /* Release */ = {
368 | isa = XCBuildConfiguration;
369 | buildSettings = {
370 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
371 | INFOPLIST_FILE = SwiftComplex/Info.plist;
372 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
373 | PRODUCT_NAME = "$(TARGET_NAME)";
374 | TARGETED_DEVICE_FAMILY = "1,2";
375 | };
376 | name = Release;
377 | };
378 | 2BEB566119F235BF0069F44A /* Debug */ = {
379 | isa = XCBuildConfiguration;
380 | buildSettings = {
381 | BUNDLE_LOADER = "$(TEST_HOST)";
382 | FRAMEWORK_SEARCH_PATHS = (
383 | "$(SDKROOT)/Developer/Library/Frameworks",
384 | "$(inherited)",
385 | );
386 | GCC_PREPROCESSOR_DEFINITIONS = (
387 | "DEBUG=1",
388 | "$(inherited)",
389 | );
390 | INFOPLIST_FILE = SwiftComplexTests/Info.plist;
391 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
392 | PRODUCT_NAME = "$(TARGET_NAME)";
393 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftComplex.app/SwiftComplex";
394 | };
395 | name = Debug;
396 | };
397 | 2BEB566219F235BF0069F44A /* Release */ = {
398 | isa = XCBuildConfiguration;
399 | buildSettings = {
400 | BUNDLE_LOADER = "$(TEST_HOST)";
401 | FRAMEWORK_SEARCH_PATHS = (
402 | "$(SDKROOT)/Developer/Library/Frameworks",
403 | "$(inherited)",
404 | );
405 | INFOPLIST_FILE = SwiftComplexTests/Info.plist;
406 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
407 | PRODUCT_NAME = "$(TARGET_NAME)";
408 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SwiftComplex.app/SwiftComplex";
409 | };
410 | name = Release;
411 | };
412 | /* End XCBuildConfiguration section */
413 |
414 | /* Begin XCConfigurationList section */
415 | 2BEB563719F235BF0069F44A /* Build configuration list for PBXProject "SwiftComplex" */ = {
416 | isa = XCConfigurationList;
417 | buildConfigurations = (
418 | 2BEB565B19F235BF0069F44A /* Debug */,
419 | 2BEB565C19F235BF0069F44A /* Release */,
420 | );
421 | defaultConfigurationIsVisible = 0;
422 | defaultConfigurationName = Release;
423 | };
424 | 2BEB565D19F235BF0069F44A /* Build configuration list for PBXNativeTarget "SwiftComplex" */ = {
425 | isa = XCConfigurationList;
426 | buildConfigurations = (
427 | 2BEB565E19F235BF0069F44A /* Debug */,
428 | 2BEB565F19F235BF0069F44A /* Release */,
429 | );
430 | defaultConfigurationIsVisible = 0;
431 | };
432 | 2BEB566019F235BF0069F44A /* Build configuration list for PBXNativeTarget "SwiftComplexTests" */ = {
433 | isa = XCConfigurationList;
434 | buildConfigurations = (
435 | 2BEB566119F235BF0069F44A /* Debug */,
436 | 2BEB566219F235BF0069F44A /* Release */,
437 | );
438 | defaultConfigurationIsVisible = 0;
439 | };
440 | /* End XCConfigurationList section */
441 | };
442 | rootObject = 2BEB563419F235BF0069F44A /* Project object */;
443 | }
444 |
--------------------------------------------------------------------------------