├── MPS_Subclassing
├── DSC00773.jpg
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── AdditionalCompositing.metal
├── Info.plist
├── Base.lproj
│ ├── Main.storyboard
│ └── LaunchScreen.storyboard
├── AppDelegate.swift
└── ViewController.swift
├── MPS_Subclassing.xcodeproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
├── xcuserdata
│ └── simongladman.xcuserdatad
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── MPS_Subclassing.xcscheme
└── project.pbxproj
└── LICENSE.md
/MPS_Subclassing/DSC00773.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/FlexMonkey/Bokeh/HEAD/MPS_Subclassing/DSC00773.jpg
--------------------------------------------------------------------------------
/MPS_Subclassing.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MPS_Subclassing.xcodeproj/xcuserdata/simongladman.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | MPS_Subclassing.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 3E0811FC1CD3B1C4001581D3
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/MPS_Subclassing/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "ipad",
5 | "size" : "29x29",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "ipad",
10 | "size" : "29x29",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "ipad",
15 | "size" : "40x40",
16 | "scale" : "1x"
17 | },
18 | {
19 | "idiom" : "ipad",
20 | "size" : "40x40",
21 | "scale" : "2x"
22 | },
23 | {
24 | "idiom" : "ipad",
25 | "size" : "76x76",
26 | "scale" : "1x"
27 | },
28 | {
29 | "idiom" : "ipad",
30 | "size" : "76x76",
31 | "scale" : "2x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/MPS_Subclassing/AdditionalCompositing.metal:
--------------------------------------------------------------------------------
1 | //
2 | // AdditionalCompositing.metal
3 | // MPS_Subclassing
4 | //
5 | // Created by Simon Gladman on 29/04/2016.
6 | // Copyright © 2016 Simon Gladman. All rights reserved.
7 | //
8 |
9 | #include
10 | using namespace metal;
11 |
12 | kernel void additionalCompositing(texture2d primaryTexture [[texture(0)]],
13 | texture2d secondaryTexture [[texture(1)]],
14 | texture2d destinationTexture [[texture(2)]],
15 | constant float &secondryTextureBrightness [[ buffer(0) ]],
16 | uint2 id [[thread_position_in_grid]])
17 | {
18 | float4 primaryPixel = primaryTexture.read(id);
19 | float4 secondaryPixel = secondaryTexture.read(id);
20 |
21 | destinationTexture.write(saturate(primaryPixel + (secondaryPixel * secondryTextureBrightness)), id);
22 | }
23 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 simon gladman
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 |
--------------------------------------------------------------------------------
/MPS_Subclassing/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
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 | UISupportedInterfaceOrientations~ipad
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationPortraitUpsideDown
37 | UIInterfaceOrientationLandscapeLeft
38 | UIInterfaceOrientationLandscapeRight
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/MPS_Subclassing/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 |
--------------------------------------------------------------------------------
/MPS_Subclassing/Base.lproj/LaunchScreen.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 |
--------------------------------------------------------------------------------
/MPS_Subclassing/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // MPS_Subclassing
4 | //
5 | // Created by Simon Gladman on 29/04/2016.
6 | // Copyright © 2016 Simon Gladman. All rights reserved.
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 |
--------------------------------------------------------------------------------
/MPS_Subclassing.xcodeproj/xcuserdata/simongladman.xcuserdatad/xcschemes/MPS_Subclassing.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/MPS_Subclassing/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // MPS_Subclassing
4 | //
5 | // Created by Simon Gladman on 29/04/2016.
6 | // Copyright © 2016 Simon Gladman. All rights reserved.
7 | //
8 |
9 | import UIKit
10 | import MetalPerformanceShaders
11 | import MetalKit
12 |
13 | class ViewController: UIViewController, MTKViewDelegate
14 | {
15 | let highlightsOnly = false
16 |
17 | // MARK: Metal Objects
18 |
19 | let device = MTLCreateSystemDefaultDevice()
20 |
21 | lazy var commandQueue: MTLCommandQueue =
22 | {
23 | return self.device!.newCommandQueue()
24 | }()
25 |
26 | lazy var imageTexture: MTLTexture =
27 | {
28 | let textureLoader = MTKTextureLoader(device: self.device!)
29 | let imageTexture:MTLTexture
30 |
31 | let sourceImage = UIImage(named: "DSC00773.jpg")!
32 |
33 | do
34 | {
35 | imageTexture = try textureLoader.newTextureWithCGImage(
36 | sourceImage.CGImage!,
37 | options: nil)
38 | }
39 | catch
40 | {
41 | fatalError("unable to create texture from image")
42 | }
43 |
44 | return imageTexture
45 | }()
46 |
47 | // MARK: UI Components
48 |
49 | lazy var imageView: MTKView =
50 | {
51 | let imageView = MTKView(
52 | frame: CGRect(x: 0, y: 0, width: 640, height: 640),
53 | device: self.device!)
54 |
55 | imageView.framebufferOnly = false
56 | imageView.delegate = self
57 |
58 | return imageView
59 | }()
60 |
61 | // MARK: Metal Performance Shaders
62 |
63 | lazy var additionalCompositing: AdditionalCompositing =
64 | {
65 | let compositing = AdditionalCompositing(device: self.device!)
66 | compositing.secondryTextureBrightness = 0.4
67 |
68 | return compositing
69 | }()
70 |
71 | lazy var threshold: MPSImageThresholdBinary =
72 | {
73 | return MPSImageThresholdBinary(
74 | device: self.device!,
75 | thresholdValue: 0.99,
76 | maximumValue: 1.0,
77 | linearGrayColorTransform: nil)
78 | }()
79 |
80 | lazy var dilate: MPSImageDilate =
81 | {
82 | var probe = [Float]()
83 |
84 | let size = 45
85 | let v = Float(size / 4)
86 | let h = v * sqrt(3.0)
87 | let mid = Float(size) / 2
88 |
89 | for i in 0 ..< size
90 | {
91 | for j in 0 ..< size
92 | {
93 | let x = abs(Float(i) - mid)
94 | let y = abs(Float(j) - mid)
95 |
96 | let element = Float((x > h || y > v * 2.0) ?
97 | 1.0 :
98 | ((2.0 * v * h - v * x - h * y) >= 0.0) ? 0.0 : 1.0)
99 |
100 | probe.append(element)
101 | }
102 | }
103 |
104 | let dilate = MPSImageDilate(
105 | device: self.device!,
106 | kernelWidth: size,
107 | kernelHeight: size,
108 | values: probe)
109 |
110 | dilate.edgeMode = .Clamp
111 |
112 | return dilate
113 | }()
114 |
115 | lazy var rotate: MPSImageLanczosScale =
116 | {
117 | let scale = MPSImageLanczosScale(device: self.device!)
118 |
119 | var tx = MPSScaleTransform(
120 | scaleX: 1,
121 | scaleY: -1,
122 | translateX: 0,
123 | translateY: Double(-self.imageTexture.height))
124 |
125 | withUnsafePointer(&tx)
126 | {
127 | scale.scaleTransform = $0
128 | }
129 |
130 | return scale
131 | }()
132 |
133 | lazy var blur: MPSImageGaussianBlur =
134 | {
135 | return MPSImageGaussianBlur(device: self.device!, sigma: 5)
136 | }()
137 |
138 | // MARK: Layout
139 |
140 | override func viewDidLoad()
141 | {
142 | super.viewDidLoad()
143 |
144 | view.addSubview(imageView)
145 | }
146 |
147 | override func viewDidLayoutSubviews()
148 | {
149 | imageView.frame.origin.x = view.frame.midX - imageView.frame.midX
150 | imageView.frame.origin.y = view.frame.midY - imageView.frame.midY
151 | }
152 |
153 | // MARK: MTKViewDelegate
154 |
155 | func mtkView(view: MTKView, drawableSizeWillChange size: CGSize)
156 | {
157 |
158 | }
159 |
160 | func drawInMTKView(view: MTKView)
161 | {
162 | if view.frame.size == CGSizeZero
163 | {
164 | return
165 | }
166 |
167 | guard let currentDrawable = view.currentDrawable where imageView.frame.size != CGSizeZero else
168 | {
169 | return
170 | }
171 |
172 | let commandQueue = device!.newCommandQueue()
173 |
174 | let commandBuffer = commandQueue.commandBuffer()
175 |
176 | let rotatedTexture = newTexture(width: imageTexture.width, height: imageTexture.height)
177 | let thresholdTexture = newTexture(width: imageTexture.width, height: imageTexture.height)
178 | let dilatedTexture = newTexture(width: imageTexture.width, height: imageTexture.height)
179 | let compositedTexture = newTexture(width: imageTexture.width, height: imageTexture.height)
180 |
181 | rotate.encodeToCommandBuffer(
182 | commandBuffer,
183 | sourceTexture: imageTexture,
184 | destinationTexture: rotatedTexture)
185 |
186 | if highlightsOnly
187 | {
188 | rotate.encodeToCommandBuffer(
189 | commandBuffer,
190 | sourceTexture: imageTexture,
191 | destinationTexture: rotatedTexture)
192 |
193 | threshold.encodeToCommandBuffer(
194 | commandBuffer,
195 | sourceTexture: rotatedTexture,
196 | destinationTexture: thresholdTexture)
197 |
198 | dilate.encodeToCommandBuffer(
199 | commandBuffer,
200 | sourceTexture: thresholdTexture,
201 | destinationTexture: dilatedTexture)
202 |
203 | additionalCompositing.encodeToCommandBuffer(
204 | commandBuffer,
205 | primaryTexture: rotatedTexture,
206 | secondaryTexture: dilatedTexture,
207 | destinationTexture: compositedTexture)
208 |
209 | blur.encodeToCommandBuffer(
210 | commandBuffer,
211 | sourceTexture: compositedTexture,
212 | destinationTexture: currentDrawable.texture)
213 | }
214 | else
215 | {
216 | dilate.encodeToCommandBuffer(
217 | commandBuffer,
218 | sourceTexture: rotatedTexture,
219 | destinationTexture: dilatedTexture)
220 |
221 | blur.encodeToCommandBuffer(
222 | commandBuffer,
223 | sourceTexture: dilatedTexture,
224 | destinationTexture: currentDrawable.texture)
225 | }
226 |
227 |
228 |
229 | commandBuffer.presentDrawable(imageView.currentDrawable!)
230 |
231 | commandBuffer.commit();
232 | }
233 |
234 | func newTexture(width width: Int, height: Int) -> MTLTexture
235 | {
236 | let textureDesciptor = MTLTextureDescriptor.texture2DDescriptorWithPixelFormat(
237 | MTLPixelFormat.RGBA8Unorm,
238 | width: imageTexture.width,
239 | height: imageTexture.height,
240 | mipmapped: false)
241 |
242 | let texture = device!.newTextureWithDescriptor(textureDesciptor)
243 |
244 | return texture
245 | }
246 | }
247 |
248 | class AdditionalCompositing: MPSBinaryImageKernel
249 | {
250 | var secondryTextureBrightness: Float = 0.2
251 |
252 | override init(device: MTLDevice)
253 | {
254 | super.init(device: device)
255 | }
256 |
257 | lazy var defaultLibrary: MTLLibrary =
258 | {
259 | return self.device.newDefaultLibrary()!
260 | }()
261 |
262 | lazy var pipelineState: MTLComputePipelineState =
263 | {
264 | let kernelFunction = self.defaultLibrary.newFunctionWithName("additionalCompositing")!
265 |
266 | do
267 | {
268 | let pipelineState = try self.device.newComputePipelineStateWithFunction(kernelFunction)
269 | return pipelineState
270 | }
271 | catch
272 | {
273 | fatalError("Unable to create pipeline state for additionalCompositing")
274 | }
275 | }()
276 |
277 | lazy var threadsPerThreadgroup: MTLSize =
278 | {
279 | let maxTotalThreadsPerThreadgroup = Double(self.pipelineState.maxTotalThreadsPerThreadgroup)
280 | let threadExecutionWidth = Double(self.pipelineState.threadExecutionWidth)
281 |
282 | let threadsPerThreadgroupSide = 0.stride(
283 | to: Int(sqrt(maxTotalThreadsPerThreadgroup)),
284 | by: 1).reduce(16)
285 | {
286 | return (Double($1 * $1) / threadExecutionWidth) % 1 == 0 ? $1 : $0
287 | }
288 |
289 | return MTLSize(
290 | width:threadsPerThreadgroupSide,
291 | height:threadsPerThreadgroupSide,
292 | depth:1)
293 | }()
294 |
295 | override func encodeToCommandBuffer(commandBuffer: MTLCommandBuffer,
296 | inPlacePrimaryTexture: UnsafeMutablePointer,
297 | secondaryTexture: MTLTexture,
298 | fallbackCopyAllocator copyAllocator: MPSCopyAllocator?) -> Bool
299 | {
300 | fatalError("not implemented")
301 | }
302 |
303 | override func encodeToCommandBuffer(commandBuffer: MTLCommandBuffer,
304 | primaryTexture: MTLTexture,
305 | inPlaceSecondaryTexture: UnsafeMutablePointer,
306 | fallbackCopyAllocator copyAllocator: MPSCopyAllocator?) -> Bool {
307 | fatalError("not implemented")
308 | }
309 |
310 | override func encodeToCommandBuffer(commandBuffer: MTLCommandBuffer,
311 | primaryTexture: MTLTexture,
312 | secondaryTexture: MTLTexture,
313 | destinationTexture: MTLTexture)
314 | {
315 | let commandEncoder = commandBuffer.computeCommandEncoder()
316 |
317 | commandEncoder.setComputePipelineState(pipelineState)
318 |
319 | commandEncoder.setTexture(primaryTexture, atIndex: 0)
320 | commandEncoder.setTexture(secondaryTexture, atIndex: 1)
321 | commandEncoder.setTexture(destinationTexture, atIndex: 2)
322 |
323 | let buffer = device.newBufferWithBytes(
324 | &secondryTextureBrightness,
325 | length: sizeof(Float),
326 | options: MTLResourceOptions.CPUCacheModeDefaultCache)
327 |
328 | commandEncoder.setBuffer(buffer, offset: 0, atIndex: 0)
329 |
330 | let threadgroupsPerGrid = MTLSizeMake(
331 | destinationTexture.width / threadsPerThreadgroup.width,
332 | destinationTexture.height / threadsPerThreadgroup.height, 1)
333 |
334 | commandEncoder.dispatchThreadgroups(
335 | threadgroupsPerGrid,
336 | threadsPerThreadgroup: threadsPerThreadgroup)
337 |
338 | commandEncoder.endEncoding()
339 | }
340 | }
--------------------------------------------------------------------------------
/MPS_Subclassing.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 3E0812011CD3B1C4001581D3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E0812001CD3B1C4001581D3 /* AppDelegate.swift */; };
11 | 3E0812031CD3B1C4001581D3 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E0812021CD3B1C4001581D3 /* ViewController.swift */; };
12 | 3E0812061CD3B1C4001581D3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3E0812041CD3B1C4001581D3 /* Main.storyboard */; };
13 | 3E0812081CD3B1C4001581D3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 3E0812071CD3B1C4001581D3 /* Assets.xcassets */; };
14 | 3E08120B1CD3B1C4001581D3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3E0812091CD3B1C4001581D3 /* LaunchScreen.storyboard */; };
15 | 3E0812131CD3B4F2001581D3 /* AdditionalCompositing.metal in Sources */ = {isa = PBXBuildFile; fileRef = 3E0812121CD3B4F2001581D3 /* AdditionalCompositing.metal */; };
16 | 3E252DEF1CD474FD0009A9CF /* DSC00773.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 3E252DEE1CD474FD0009A9CF /* DSC00773.jpg */; };
17 | /* End PBXBuildFile section */
18 |
19 | /* Begin PBXFileReference section */
20 | 3E0811FD1CD3B1C4001581D3 /* MPS_Subclassing.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MPS_Subclassing.app; sourceTree = BUILT_PRODUCTS_DIR; };
21 | 3E0812001CD3B1C4001581D3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
22 | 3E0812021CD3B1C4001581D3 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
23 | 3E0812051CD3B1C4001581D3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
24 | 3E0812071CD3B1C4001581D3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
25 | 3E08120A1CD3B1C4001581D3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
26 | 3E08120C1CD3B1C4001581D3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
27 | 3E0812121CD3B4F2001581D3 /* AdditionalCompositing.metal */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.metal; path = AdditionalCompositing.metal; sourceTree = ""; };
28 | 3E252DEE1CD474FD0009A9CF /* DSC00773.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = DSC00773.jpg; sourceTree = ""; };
29 | /* End PBXFileReference section */
30 |
31 | /* Begin PBXFrameworksBuildPhase section */
32 | 3E0811FA1CD3B1C4001581D3 /* Frameworks */ = {
33 | isa = PBXFrameworksBuildPhase;
34 | buildActionMask = 2147483647;
35 | files = (
36 | );
37 | runOnlyForDeploymentPostprocessing = 0;
38 | };
39 | /* End PBXFrameworksBuildPhase section */
40 |
41 | /* Begin PBXGroup section */
42 | 3E0811F41CD3B1C4001581D3 = {
43 | isa = PBXGroup;
44 | children = (
45 | 3E0811FF1CD3B1C4001581D3 /* MPS_Subclassing */,
46 | 3E0811FE1CD3B1C4001581D3 /* Products */,
47 | );
48 | sourceTree = "";
49 | };
50 | 3E0811FE1CD3B1C4001581D3 /* Products */ = {
51 | isa = PBXGroup;
52 | children = (
53 | 3E0811FD1CD3B1C4001581D3 /* MPS_Subclassing.app */,
54 | );
55 | name = Products;
56 | sourceTree = "";
57 | };
58 | 3E0811FF1CD3B1C4001581D3 /* MPS_Subclassing */ = {
59 | isa = PBXGroup;
60 | children = (
61 | 3E252DEE1CD474FD0009A9CF /* DSC00773.jpg */,
62 | 3E0812001CD3B1C4001581D3 /* AppDelegate.swift */,
63 | 3E0812021CD3B1C4001581D3 /* ViewController.swift */,
64 | 3E0812041CD3B1C4001581D3 /* Main.storyboard */,
65 | 3E0812071CD3B1C4001581D3 /* Assets.xcassets */,
66 | 3E0812091CD3B1C4001581D3 /* LaunchScreen.storyboard */,
67 | 3E08120C1CD3B1C4001581D3 /* Info.plist */,
68 | 3E0812121CD3B4F2001581D3 /* AdditionalCompositing.metal */,
69 | );
70 | path = MPS_Subclassing;
71 | sourceTree = "";
72 | };
73 | /* End PBXGroup section */
74 |
75 | /* Begin PBXNativeTarget section */
76 | 3E0811FC1CD3B1C4001581D3 /* MPS_Subclassing */ = {
77 | isa = PBXNativeTarget;
78 | buildConfigurationList = 3E08120F1CD3B1C4001581D3 /* Build configuration list for PBXNativeTarget "MPS_Subclassing" */;
79 | buildPhases = (
80 | 3E0811F91CD3B1C4001581D3 /* Sources */,
81 | 3E0811FA1CD3B1C4001581D3 /* Frameworks */,
82 | 3E0811FB1CD3B1C4001581D3 /* Resources */,
83 | );
84 | buildRules = (
85 | );
86 | dependencies = (
87 | );
88 | name = MPS_Subclassing;
89 | productName = MPS_Subclassing;
90 | productReference = 3E0811FD1CD3B1C4001581D3 /* MPS_Subclassing.app */;
91 | productType = "com.apple.product-type.application";
92 | };
93 | /* End PBXNativeTarget section */
94 |
95 | /* Begin PBXProject section */
96 | 3E0811F51CD3B1C4001581D3 /* Project object */ = {
97 | isa = PBXProject;
98 | attributes = {
99 | LastSwiftUpdateCheck = 0730;
100 | LastUpgradeCheck = 0730;
101 | ORGANIZATIONNAME = "Simon Gladman";
102 | TargetAttributes = {
103 | 3E0811FC1CD3B1C4001581D3 = {
104 | CreatedOnToolsVersion = 7.3;
105 | };
106 | };
107 | };
108 | buildConfigurationList = 3E0811F81CD3B1C4001581D3 /* Build configuration list for PBXProject "MPS_Subclassing" */;
109 | compatibilityVersion = "Xcode 3.2";
110 | developmentRegion = English;
111 | hasScannedForEncodings = 0;
112 | knownRegions = (
113 | en,
114 | Base,
115 | );
116 | mainGroup = 3E0811F41CD3B1C4001581D3;
117 | productRefGroup = 3E0811FE1CD3B1C4001581D3 /* Products */;
118 | projectDirPath = "";
119 | projectRoot = "";
120 | targets = (
121 | 3E0811FC1CD3B1C4001581D3 /* MPS_Subclassing */,
122 | );
123 | };
124 | /* End PBXProject section */
125 |
126 | /* Begin PBXResourcesBuildPhase section */
127 | 3E0811FB1CD3B1C4001581D3 /* Resources */ = {
128 | isa = PBXResourcesBuildPhase;
129 | buildActionMask = 2147483647;
130 | files = (
131 | 3E08120B1CD3B1C4001581D3 /* LaunchScreen.storyboard in Resources */,
132 | 3E0812081CD3B1C4001581D3 /* Assets.xcassets in Resources */,
133 | 3E0812061CD3B1C4001581D3 /* Main.storyboard in Resources */,
134 | 3E252DEF1CD474FD0009A9CF /* DSC00773.jpg in Resources */,
135 | );
136 | runOnlyForDeploymentPostprocessing = 0;
137 | };
138 | /* End PBXResourcesBuildPhase section */
139 |
140 | /* Begin PBXSourcesBuildPhase section */
141 | 3E0811F91CD3B1C4001581D3 /* Sources */ = {
142 | isa = PBXSourcesBuildPhase;
143 | buildActionMask = 2147483647;
144 | files = (
145 | 3E0812131CD3B4F2001581D3 /* AdditionalCompositing.metal in Sources */,
146 | 3E0812031CD3B1C4001581D3 /* ViewController.swift in Sources */,
147 | 3E0812011CD3B1C4001581D3 /* AppDelegate.swift in Sources */,
148 | );
149 | runOnlyForDeploymentPostprocessing = 0;
150 | };
151 | /* End PBXSourcesBuildPhase section */
152 |
153 | /* Begin PBXVariantGroup section */
154 | 3E0812041CD3B1C4001581D3 /* Main.storyboard */ = {
155 | isa = PBXVariantGroup;
156 | children = (
157 | 3E0812051CD3B1C4001581D3 /* Base */,
158 | );
159 | name = Main.storyboard;
160 | sourceTree = "";
161 | };
162 | 3E0812091CD3B1C4001581D3 /* LaunchScreen.storyboard */ = {
163 | isa = PBXVariantGroup;
164 | children = (
165 | 3E08120A1CD3B1C4001581D3 /* Base */,
166 | );
167 | name = LaunchScreen.storyboard;
168 | sourceTree = "";
169 | };
170 | /* End PBXVariantGroup section */
171 |
172 | /* Begin XCBuildConfiguration section */
173 | 3E08120D1CD3B1C4001581D3 /* Debug */ = {
174 | isa = XCBuildConfiguration;
175 | buildSettings = {
176 | ALWAYS_SEARCH_USER_PATHS = NO;
177 | CLANG_ANALYZER_NONNULL = YES;
178 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
179 | CLANG_CXX_LIBRARY = "libc++";
180 | CLANG_ENABLE_MODULES = YES;
181 | CLANG_ENABLE_OBJC_ARC = YES;
182 | CLANG_WARN_BOOL_CONVERSION = YES;
183 | CLANG_WARN_CONSTANT_CONVERSION = YES;
184 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
185 | CLANG_WARN_EMPTY_BODY = YES;
186 | CLANG_WARN_ENUM_CONVERSION = YES;
187 | CLANG_WARN_INT_CONVERSION = YES;
188 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
189 | CLANG_WARN_UNREACHABLE_CODE = YES;
190 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
191 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
192 | COPY_PHASE_STRIP = NO;
193 | DEBUG_INFORMATION_FORMAT = dwarf;
194 | ENABLE_STRICT_OBJC_MSGSEND = YES;
195 | ENABLE_TESTABILITY = YES;
196 | GCC_C_LANGUAGE_STANDARD = gnu99;
197 | GCC_DYNAMIC_NO_PIC = NO;
198 | GCC_NO_COMMON_BLOCKS = YES;
199 | GCC_OPTIMIZATION_LEVEL = 0;
200 | GCC_PREPROCESSOR_DEFINITIONS = (
201 | "DEBUG=1",
202 | "$(inherited)",
203 | );
204 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
205 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
206 | GCC_WARN_UNDECLARED_SELECTOR = YES;
207 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
208 | GCC_WARN_UNUSED_FUNCTION = YES;
209 | GCC_WARN_UNUSED_VARIABLE = YES;
210 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
211 | MTL_ENABLE_DEBUG_INFO = YES;
212 | ONLY_ACTIVE_ARCH = YES;
213 | SDKROOT = iphoneos;
214 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
215 | TARGETED_DEVICE_FAMILY = 2;
216 | };
217 | name = Debug;
218 | };
219 | 3E08120E1CD3B1C4001581D3 /* Release */ = {
220 | isa = XCBuildConfiguration;
221 | buildSettings = {
222 | ALWAYS_SEARCH_USER_PATHS = NO;
223 | CLANG_ANALYZER_NONNULL = YES;
224 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
225 | CLANG_CXX_LIBRARY = "libc++";
226 | CLANG_ENABLE_MODULES = YES;
227 | CLANG_ENABLE_OBJC_ARC = YES;
228 | CLANG_WARN_BOOL_CONVERSION = YES;
229 | CLANG_WARN_CONSTANT_CONVERSION = YES;
230 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
231 | CLANG_WARN_EMPTY_BODY = YES;
232 | CLANG_WARN_ENUM_CONVERSION = YES;
233 | CLANG_WARN_INT_CONVERSION = YES;
234 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
235 | CLANG_WARN_UNREACHABLE_CODE = YES;
236 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
237 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
238 | COPY_PHASE_STRIP = NO;
239 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
240 | ENABLE_NS_ASSERTIONS = NO;
241 | ENABLE_STRICT_OBJC_MSGSEND = YES;
242 | GCC_C_LANGUAGE_STANDARD = gnu99;
243 | GCC_NO_COMMON_BLOCKS = YES;
244 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
245 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
246 | GCC_WARN_UNDECLARED_SELECTOR = YES;
247 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
248 | GCC_WARN_UNUSED_FUNCTION = YES;
249 | GCC_WARN_UNUSED_VARIABLE = YES;
250 | IPHONEOS_DEPLOYMENT_TARGET = 9.3;
251 | MTL_ENABLE_DEBUG_INFO = NO;
252 | SDKROOT = iphoneos;
253 | TARGETED_DEVICE_FAMILY = 2;
254 | VALIDATE_PRODUCT = YES;
255 | };
256 | name = Release;
257 | };
258 | 3E0812101CD3B1C4001581D3 /* Debug */ = {
259 | isa = XCBuildConfiguration;
260 | buildSettings = {
261 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
262 | INFOPLIST_FILE = MPS_Subclassing/Info.plist;
263 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
264 | PRODUCT_BUNDLE_IDENTIFIER = "uk.co.flexmonkey.MPS-Subclassing";
265 | PRODUCT_NAME = "$(TARGET_NAME)";
266 | };
267 | name = Debug;
268 | };
269 | 3E0812111CD3B1C4001581D3 /* Release */ = {
270 | isa = XCBuildConfiguration;
271 | buildSettings = {
272 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
273 | INFOPLIST_FILE = MPS_Subclassing/Info.plist;
274 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
275 | PRODUCT_BUNDLE_IDENTIFIER = "uk.co.flexmonkey.MPS-Subclassing";
276 | PRODUCT_NAME = "$(TARGET_NAME)";
277 | };
278 | name = Release;
279 | };
280 | /* End XCBuildConfiguration section */
281 |
282 | /* Begin XCConfigurationList section */
283 | 3E0811F81CD3B1C4001581D3 /* Build configuration list for PBXProject "MPS_Subclassing" */ = {
284 | isa = XCConfigurationList;
285 | buildConfigurations = (
286 | 3E08120D1CD3B1C4001581D3 /* Debug */,
287 | 3E08120E1CD3B1C4001581D3 /* Release */,
288 | );
289 | defaultConfigurationIsVisible = 0;
290 | defaultConfigurationName = Release;
291 | };
292 | 3E08120F1CD3B1C4001581D3 /* Build configuration list for PBXNativeTarget "MPS_Subclassing" */ = {
293 | isa = XCConfigurationList;
294 | buildConfigurations = (
295 | 3E0812101CD3B1C4001581D3 /* Debug */,
296 | 3E0812111CD3B1C4001581D3 /* Release */,
297 | );
298 | defaultConfigurationIsVisible = 0;
299 | defaultConfigurationName = Release;
300 | };
301 | /* End XCConfigurationList section */
302 | };
303 | rootObject = 3E0811F51CD3B1C4001581D3 /* Project object */;
304 | }
305 |
--------------------------------------------------------------------------------