├── assets
├── Resizr-Icon-16@1x.png
├── Resizr-Icon-32@1x.png
├── Resizr-Icon-32@2x.png
├── Resizr-Icon-128@1x.png
├── Resizr-Icon-256@1x.png
├── Resizr-Icon-512@1x.png
└── Resizr-Icon-512@2x.png
├── Resizr
├── Assets.xcassets
│ ├── Contents.json
│ └── AppIcon.appiconset
│ │ ├── Resizr-Icon-16@1x.png
│ │ ├── Resizr-Icon-32@1x.png
│ │ ├── Resizr-Icon-32@2x.png
│ │ ├── Resizr-Icon-128@1x.png
│ │ ├── Resizr-Icon-256@1x.png
│ │ ├── Resizr-Icon-32@1x-1.png
│ │ ├── Resizr-Icon-512@1x.png
│ │ ├── Resizr-Icon-512@2x.png
│ │ ├── Resizr-Icon-256@1x-1.png
│ │ ├── Resizr-Icon-512@1x-1.png
│ │ └── Contents.json
├── AppDelegate.swift
├── DragViewDelegate.swift
├── Resizr.entitlements
├── AssetContents.json
├── Utility
│ ├── CALayer+Utility.swift
│ └── NSDraggingInfo+Utility.swift
├── Info.plist
├── DragView.swift
├── NSImage+Resized.swift
├── Contents.json
├── HomeController.swift
└── Base.lproj
│ └── Main.storyboard
├── Resizr.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
├── xcuserdata
│ └── onurgenes.xcuserdatad
│ │ ├── xcschemes
│ │ └── xcschememanagement.plist
│ │ └── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
├── xcshareddata
│ └── xcschemes
│ │ ├── Resizr.xcscheme
│ │ └── Resizr-RELEASE.xcscheme
└── project.pbxproj
├── README.md
├── LICENSE
└── .gitignore
/assets/Resizr-Icon-16@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onurgenes/Resizr/HEAD/assets/Resizr-Icon-16@1x.png
--------------------------------------------------------------------------------
/assets/Resizr-Icon-32@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onurgenes/Resizr/HEAD/assets/Resizr-Icon-32@1x.png
--------------------------------------------------------------------------------
/assets/Resizr-Icon-32@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onurgenes/Resizr/HEAD/assets/Resizr-Icon-32@2x.png
--------------------------------------------------------------------------------
/assets/Resizr-Icon-128@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onurgenes/Resizr/HEAD/assets/Resizr-Icon-128@1x.png
--------------------------------------------------------------------------------
/assets/Resizr-Icon-256@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onurgenes/Resizr/HEAD/assets/Resizr-Icon-256@1x.png
--------------------------------------------------------------------------------
/assets/Resizr-Icon-512@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onurgenes/Resizr/HEAD/assets/Resizr-Icon-512@1x.png
--------------------------------------------------------------------------------
/assets/Resizr-Icon-512@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onurgenes/Resizr/HEAD/assets/Resizr-Icon-512@2x.png
--------------------------------------------------------------------------------
/Resizr/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-16@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onurgenes/Resizr/HEAD/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-16@1x.png
--------------------------------------------------------------------------------
/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-32@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onurgenes/Resizr/HEAD/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-32@1x.png
--------------------------------------------------------------------------------
/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-32@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onurgenes/Resizr/HEAD/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-32@2x.png
--------------------------------------------------------------------------------
/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-128@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onurgenes/Resizr/HEAD/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-128@1x.png
--------------------------------------------------------------------------------
/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-256@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onurgenes/Resizr/HEAD/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-256@1x.png
--------------------------------------------------------------------------------
/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-32@1x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onurgenes/Resizr/HEAD/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-32@1x-1.png
--------------------------------------------------------------------------------
/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-512@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onurgenes/Resizr/HEAD/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-512@1x.png
--------------------------------------------------------------------------------
/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-512@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onurgenes/Resizr/HEAD/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-512@2x.png
--------------------------------------------------------------------------------
/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-256@1x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onurgenes/Resizr/HEAD/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-256@1x-1.png
--------------------------------------------------------------------------------
/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-512@1x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/onurgenes/Resizr/HEAD/Resizr/Assets.xcassets/AppIcon.appiconset/Resizr-Icon-512@1x-1.png
--------------------------------------------------------------------------------
/Resizr.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Resizr/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // Resizr
4 | //
5 | // Created by Onur Geneş on 5.03.2019.
6 | // Copyright © 2019 Onur Geneş. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | @NSApplicationMain
12 | class AppDelegate: NSObject, NSApplicationDelegate {
13 |
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/Resizr/DragViewDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DragViewDelegate.swift
3 | // Resizr
4 | //
5 | // Created by Onur Geneş on 6.03.2019.
6 | // Copyright © 2019 Onur Geneş. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | protocol DragViewDelegate {
12 | func dragView(didDragFileWith url: URL)
13 | }
14 |
--------------------------------------------------------------------------------
/Resizr.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Resizr/Resizr.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.files.downloads.read-write
8 |
9 | com.apple.security.files.user-selected.read-write
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Resizr/AssetContents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "asset@1x.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "asset@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "asset@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "Resizr"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Resizr/Utility/CALayer+Utility.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NSColor+Utility.swift
3 | // Resizr
4 | //
5 | // Created by Kyle Bendelow on 3/14/19.
6 | // Copyright © 2019 Onur Geneş. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | internal extension CALayer {
12 | /// Will make the parent view appear active or inactive (e.g. "active" setting will make the view turn blue)
13 | func appearActive(_ active: Bool) {
14 | // TODO: Make this look nice, apply fades, etc
15 | let color = active ? NSColor.blue : NSColor.gray
16 | backgroundColor = color.cgColor
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Resizr/Utility/NSDraggingInfo+Utility.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NSDraggingInfo+Utility.swift
3 | // Resizr
4 | //
5 | // Created by Kyle Bendelow on 3/14/19.
6 | // Copyright © 2019 Onur Geneş. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | extension NSDraggingInfo {
12 | /// Returns path of dragged item if available
13 | var path: String? {
14 | guard let pasteboard = draggingPasteboard.propertyList(forType: NSPasteboard.PasteboardType(rawValue: "NSFilenamesPboardType")) as? NSArray else {
15 | return nil
16 | }
17 | guard let path = pasteboard.firstObject as? String else {
18 | return nil
19 | }
20 |
21 | return path
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Resizr.xcodeproj/xcuserdata/onurgenes.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Resizr-RELEASE.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 1
11 |
12 | Resizr.xcscheme_^#shared#^_
13 |
14 | orderHint
15 | 0
16 |
17 |
18 | SuppressBuildableAutocreation
19 |
20 | 6E7997DD222EEE1600850D97
21 |
22 | primary
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Resizr
2 | [](https://github.com/serhii-londar/open-source-mac-os-apps#ios--macos)
3 |
4 | Resizr is a MacOS application for creating AppIcon for iOS and Android (coming soon) apps.
5 |
6 | ## TODO
7 | - [x] iOS Icon Set Support
8 | - [x] iOS Asset Resizr
9 | - [ ] Android Icon Set Support
10 | - [ ] Better UI
11 | - [x] Ask for saving location
12 | - [ ] Check for image size (preferably 1536x1536 PNG format) if not show warning
13 |
14 | ### Contribute
15 |
16 | Feel free to open `PR`s.
17 |
18 | ## LICENSE
19 |
20 | App is under MIT License.
21 |
22 | Resizr's logo icon is from [Font Awesome](https://fontawesome.com/icons/pencil-ruler?style=solid) and [it's under their own license](https://fontawesome.com/license).
23 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Onur Genes
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 |
--------------------------------------------------------------------------------
/Resizr/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(MARKETING_VERSION)
21 | CFBundleVersion
22 | $(CURRENT_PROJECT_VERSION)
23 | LSApplicationCategoryType
24 | public.app-category.developer-tools
25 | LSMinimumSystemVersion
26 | $(MACOSX_DEPLOYMENT_TARGET)
27 | NSHumanReadableCopyright
28 | Copyright © 2019 Onur Geneş. All rights reserved.
29 | NSMainStoryboardFile
30 | Main
31 | NSPrincipalClass
32 | NSApplication
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Resizr/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "Resizr-Icon-16@1x.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "Resizr-Icon-32@1x-1.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "Resizr-Icon-32@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "Resizr-Icon-32@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "Resizr-Icon-128@1x.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "Resizr-Icon-256@1x-1.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "Resizr-Icon-256@1x.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "Resizr-Icon-512@1x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "Resizr-Icon-512@1x-1.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "Resizr-Icon-512@2x.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/Resizr/DragView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // DragView.swift
3 | // Resizr
4 | //
5 | // Created by Onur Geneş on 5.03.2019.
6 | // Copyright © 2019 Onur Geneş. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | class DragView: NSView {
12 |
13 | var delegate: DragViewDelegate?
14 |
15 | private var filePath: String?
16 | private var acceptedFileExtensions = ["jpg", "png", "jpeg"]
17 |
18 | required init?(coder decoder: NSCoder) {
19 | super.init(coder: decoder)
20 |
21 | self.wantsLayer = true
22 | layer?.appearActive(false)
23 |
24 | registerForDraggedTypes([NSPasteboard.PasteboardType.URL, NSPasteboard.PasteboardType.fileURL])
25 | }
26 |
27 | override func draggingEntered(_ sender: NSDraggingInfo) -> NSDragOperation {
28 | if checkExtension(sender) == true {
29 | layer?.appearActive(true)
30 | return .copy
31 | } else {
32 | return NSDragOperation()
33 | }
34 | }
35 |
36 | override func draggingEnded(_ sender: NSDraggingInfo) {
37 | layer?.appearActive(false)
38 | }
39 |
40 | override func draggingExited(_ sender: NSDraggingInfo?) {
41 | layer?.appearActive(false)
42 | }
43 |
44 | override func performDragOperation(_ sender: NSDraggingInfo) -> Bool {
45 | guard let path = sender.path else {
46 | return false
47 | }
48 |
49 | let url = URL(fileURLWithPath: path)
50 | delegate?.dragView(didDragFileWith: url)
51 | return true
52 | }
53 |
54 | private func checkExtension(_ drag: NSDraggingInfo) -> Bool {
55 | guard let path = drag.path else {
56 | return false
57 | }
58 |
59 | let suffix = URL(fileURLWithPath: path).pathExtension
60 | for ext in self.acceptedFileExtensions {
61 | if ext.lowercased() == suffix {
62 | return true
63 | }
64 | }
65 | return false
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by https://www.gitignore.io/api/xcode,macos,cocoapods
2 | # Edit at https://www.gitignore.io/?templates=xcode,macos,cocoapods
3 |
4 | ### CocoaPods ###
5 | ## CocoaPods GitIgnore Template
6 |
7 | # CocoaPods - Only use to conserve bandwidth / Save time on Pushing
8 | # - Also handy if you have a large number of dependant pods
9 | # - AS PER https://guides.cocoapods.org/using/using-cocoapods.html NEVER IGNORE THE LOCK FILE
10 | Pods/
11 |
12 | ### macOS ###
13 | # General
14 | .DS_Store
15 | .AppleDouble
16 | .LSOverride
17 |
18 | # Icon must end with two \r
19 | Icon
20 |
21 | # Thumbnails
22 | ._*
23 |
24 | # Files that might appear in the root of a volume
25 | .DocumentRevisions-V100
26 | .fseventsd
27 | .Spotlight-V100
28 | .TemporaryItems
29 | .Trashes
30 | .VolumeIcon.icns
31 | .com.apple.timemachine.donotpresent
32 |
33 | # Directories potentially created on remote AFP share
34 | .AppleDB
35 | .AppleDesktop
36 | Network Trash Folder
37 | Temporary Items
38 | .apdisk
39 |
40 | ### Xcode ###
41 | # Xcode
42 | #
43 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
44 |
45 | ## User settings
46 | xcuserdata/
47 |
48 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
49 | *.xcscmblueprint
50 | *.xccheckout
51 |
52 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
53 | build/
54 | DerivedData/
55 | *.moved-aside
56 | *.pbxuser
57 | !default.pbxuser
58 | *.mode1v3
59 | !default.mode1v3
60 | *.mode2v3
61 | !default.mode2v3
62 | *.perspectivev3
63 | !default.perspectivev3
64 |
65 | ## Xcode Patch
66 | # *.xcodeproj/*
67 | # !*.xcodeproj/project.pbxproj
68 | # !*.xcodeproj/xcshareddata/
69 | # !*.xcworkspace/contents.xcworkspacedata
70 | # /*.gcno
71 |
72 | ### Xcode Patch ###
73 | # **/xcshareddata/WorkspaceSettings.xcsettings
74 |
75 | ### Firebase
76 | assets/GoogleService-Info.plist
77 |
78 | ### Bitrise
79 | codesigndoc_exports/
80 |
81 | # End of https://www.gitignore.io/api/xcode,macos,cocoapods
82 |
--------------------------------------------------------------------------------
/Resizr/NSImage+Resized.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NSImage+Resized.swift
3 | // Resizr
4 | //
5 | // Created by Onur Geneş on 6.03.2019.
6 | // Copyright © 2019 Onur Geneş. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | extension NSImage {
12 | func resized(to newSize: Int) -> NSImage? {
13 | if let bitmapRep = NSBitmapImageRep(
14 | bitmapDataPlanes: nil, pixelsWide: newSize, pixelsHigh: newSize,
15 | bitsPerSample: 8, samplesPerPixel: 4, hasAlpha: true, isPlanar: false,
16 | colorSpaceName: .calibratedRGB, bytesPerRow: 0, bitsPerPixel: 0
17 | ) {
18 | bitmapRep.size = NSSize(width: newSize, height: newSize)
19 | NSGraphicsContext.saveGraphicsState()
20 | NSGraphicsContext.current = NSGraphicsContext(bitmapImageRep: bitmapRep)
21 | draw(in: NSRect(x: 0, y: 0, width: newSize, height: newSize), from: .zero, operation: .copy, fraction: 1.0)
22 | NSGraphicsContext.restoreGraphicsState()
23 |
24 | let resizedImage = NSImage(size: NSSize(width: newSize, height: newSize))
25 | resizedImage.addRepresentation(bitmapRep)
26 | return resizedImage
27 | }
28 |
29 | return nil
30 | }
31 |
32 | func scaled(to newSize: NSSize) -> NSImage? {
33 | if let bitmapRep = NSBitmapImageRep(
34 | bitmapDataPlanes: nil,
35 | pixelsWide: Int(newSize.width), pixelsHigh: Int(newSize.height),
36 | bitsPerSample: 8, samplesPerPixel: 4,
37 | hasAlpha: true, isPlanar: false, colorSpaceName: .calibratedRGB,
38 | bytesPerRow: 0, bitsPerPixel: 0) {
39 |
40 | bitmapRep.size = newSize
41 | NSGraphicsContext.saveGraphicsState()
42 | NSGraphicsContext.current = NSGraphicsContext(bitmapImageRep: bitmapRep)
43 | draw(in: NSRect(x: 0, y: 0, width: newSize.width, height: newSize.height), from: .zero, operation: .copy, fraction: 1.0)
44 | NSGraphicsContext.restoreGraphicsState()
45 |
46 | let resizedImage = NSImage(size: newSize)
47 | resizedImage.addRepresentation(bitmapRep)
48 | return resizedImage
49 | }
50 |
51 | return nil
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/Resizr/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "ItunesArtwork@2x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/Resizr.xcodeproj/xcshareddata/xcschemes/Resizr.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
45 |
51 |
52 |
53 |
54 |
60 |
62 |
68 |
69 |
70 |
71 |
73 |
74 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/Resizr.xcodeproj/xcshareddata/xcschemes/Resizr-RELEASE.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
43 |
45 |
51 |
52 |
53 |
54 |
60 |
62 |
68 |
69 |
70 |
71 |
73 |
74 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/Resizr.xcodeproj/xcuserdata/onurgenes.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
9 |
21 |
22 |
23 |
25 |
37 |
38 |
39 |
41 |
53 |
54 |
55 |
57 |
69 |
70 |
71 |
73 |
85 |
86 |
87 |
89 |
101 |
102 |
103 |
105 |
117 |
118 |
119 |
120 |
121 |
--------------------------------------------------------------------------------
/Resizr/HomeController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // HomeController.swift
3 | // Resizr
4 | //
5 | // Created by Onur Geneş on 5.03.2019.
6 | // Copyright © 2019 Onur Geneş. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | class HomeController: NSViewController {
12 |
13 | @IBOutlet private var dragView: DragView!
14 | @IBOutlet private weak var imageView: NSImageView!
15 | @IBOutlet weak var segmentedControl: NSSegmentedControl!
16 |
17 | private var selectedFolder: URL?
18 | private var selectedAssetName: String?
19 |
20 | override func viewDidLoad() {
21 | super.viewDidLoad()
22 | dragView.delegate = self
23 | title = "Resizr"
24 | segmentedControl.selectedSegment = 0
25 | }
26 |
27 | @IBAction private func openSelection(_ sender: Any) {
28 | selectFolder()
29 | }
30 |
31 | private func selectFolder() {
32 | guard let window = view.window else { return }
33 |
34 | let panel = NSOpenPanel()
35 | panel.canChooseFiles = false
36 | panel.canChooseDirectories = true
37 | panel.allowsMultipleSelection = false
38 |
39 | panel.beginSheetModal(for: window) { (result) in
40 | if result == NSApplication.ModalResponse.OK {
41 | self.selectedFolder = panel.urls.first
42 | switch self.segmentedControl.selectedSegment {
43 | case 0:
44 | self.save(image: self.imageView.image!, url: self.selectedFolder)
45 | case 1:
46 | self.save(asset: self.imageView.image!, url: self.selectedFolder)
47 | default:
48 | break
49 | }
50 |
51 | }
52 | }
53 | }
54 |
55 | private func infoAbout(url: URL) -> String {
56 |
57 | let fileManager = FileManager.default
58 |
59 | do {
60 | let attributes = try fileManager.attributesOfItem(atPath: url.path)
61 | var report: [String] = ["\(url.path)", ""]
62 |
63 | for (key, value) in attributes {
64 | // ignore NSFileExtendedAttributes as it is a messy dictionary
65 | if key.rawValue == "NSFileExtendedAttributes" { continue }
66 | report.append("\(key.rawValue):\t \(value)")
67 | }
68 | return report.joined(separator: "\n")
69 | } catch {
70 | return "No information available for \(url.path)"
71 | }
72 | }
73 |
74 | private func resize(image: NSImage, completion: @escaping ([String: NSImage]?, String?) -> ()) {
75 | var images = [String: NSImage]()
76 | let sizes = ["Icon-App-20x20@1x.png": 20,
77 | "Icon-App-20x20@2x.png": 40,
78 | "Icon-App-20x20@3x.png": 60,
79 | "Icon-App-29x29@1x.png": 29,
80 | "Icon-App-29x29@2x.png": 58,
81 | "Icon-App-29x29@3x.png": 87,
82 | "Icon-App-40x40@1x.png": 40,
83 | "Icon-App-40x40@2x.png": 80,
84 | "Icon-App-40x40@3x.png": 120,
85 | "Icon-App-60x60@2x.png": 120,
86 | "Icon-App-60x60@3x.png": 180,
87 | "Icon-App-76x76@1x.png": 76,
88 | "Icon-App-76x76@2x.png": 152,
89 | "Icon-App-83.5x83.5@2x.png": 167,
90 | "ItunesArtwork@1x.png": 512,
91 | "ItunesArtwork@2x.png": 1024,
92 | "ItunesArtwork@3x.png": 1536]
93 |
94 | for (key, value) in sizes {
95 | DispatchQueue.global(qos: .userInitiated).async {
96 | if let resizedImage = image.resized(to: value) {
97 | let imageName = key
98 | images[imageName] = resizedImage
99 | } else {
100 | completion(nil, "Couldn't get image")
101 | return
102 | }
103 | DispatchQueue.main.async {
104 | completion(images, nil)
105 | }
106 | }
107 |
108 | }
109 | }
110 |
111 | private func assetResize(image: NSImage, completion: @escaping ([String: NSImage]?, String?) -> ()) {
112 | var images = [String: NSImage]()
113 | let rep = image.representations[0]
114 | let size = NSSize(width: rep.pixelsWide, height: rep.pixelsHigh)
115 | let sizes = ["asset@1x": NSSize(width: size.width / 3, height: size.height / 3),
116 | "asset@2x": NSSize(width: (size.width / 3) * 2, height: (size.height / 3) * 2),
117 | "asset@3x": size]
118 |
119 | for (key, value) in sizes {
120 | if let resizedImage = image.scaled(to: value) {
121 | let imageName = key
122 | images[imageName] = resizedImage
123 | } else {
124 | completion(nil, "Couldn't get image")
125 | return
126 | }
127 | DispatchQueue.main.async {
128 | completion(images, nil)
129 | }
130 | }
131 | }
132 |
133 | private func save(asset: NSImage, url: URL?) {
134 | self.assetResize(image: asset) { (imagesDict, errorString) in
135 | if let error = errorString {
136 | print(error)
137 | return
138 | }
139 |
140 | guard let imagesDict = imagesDict else { return }
141 | guard let selectedFolder = url else { return }
142 | let withFolder = selectedFolder.appendingPathComponent("Resizr").appendingPathComponent("asset").appendingPathComponent("iOS")
143 | var withAssetSet = withFolder
144 | if let selectedAssetName = self.selectedAssetName {
145 | withAssetSet = withAssetSet.appendingPathComponent(selectedAssetName + ".imageset")
146 | } else {
147 | withAssetSet = withFolder.appendingPathComponent("asset.imageset")
148 | }
149 | do {
150 | try FileManager.default.createDirectory(at: withFolder, withIntermediateDirectories: true, attributes: nil)
151 | try FileManager.default.createDirectory(at: withAssetSet, withIntermediateDirectories: true, attributes: nil)
152 | for (name, image) in imagesDict {
153 | let urlWithName = withAssetSet.appendingPathComponent(name + ".png")
154 | guard let tiffRepresantation = image.tiffRepresentation, let bitmapImage = NSBitmapImageRep(data: tiffRepresantation) else { return }
155 | let png = bitmapImage.representation(using: .png, properties: [:])
156 | do {
157 | try png?.write(to: urlWithName)
158 | } catch let error {
159 | print(error)
160 | }
161 | }
162 | guard let filePath = Bundle.main.url(forResource: "AssetContents", withExtension: "json") else { return }
163 | let originalData = try Data(contentsOf: filePath)
164 | try originalData.write(to: withAssetSet.appendingPathComponent("Contents.json"))
165 | } catch let error {
166 | print(error)
167 | }
168 | }
169 | }
170 |
171 | private func save(image: NSImage, url: URL?) {
172 | resize(image: image) { (imagesDict, errorString) in
173 | if let error = errorString {
174 | print(error)
175 | return
176 | }
177 |
178 | guard let imagesDict = imagesDict else { return }
179 | guard let selectedFolder = url else { return }
180 | let withFolder = selectedFolder.appendingPathComponent("Resizr").appendingPathComponent("icon").appendingPathComponent("iOS")
181 | let withAppIconSet = withFolder.appendingPathComponent("AppIcon.appiconset")
182 | do {
183 | try FileManager.default.createDirectory(at: withFolder, withIntermediateDirectories: true, attributes: nil)
184 | try FileManager.default.createDirectory(at: withAppIconSet, withIntermediateDirectories: true, attributes: nil)
185 | for (name, image) in imagesDict {
186 | let urlWithName = withAppIconSet.appendingPathComponent(name)
187 | guard let tiffRepresentation = image.tiffRepresentation, let bitmapImage = NSBitmapImageRep(data: tiffRepresentation) else { return }
188 | let png = bitmapImage.representation(using: .png, properties: [:])
189 | do {
190 | try png?.write(to: urlWithName)
191 | if name.contains("tunes") {
192 | try png?.write(to: withFolder.appendingPathComponent(name))
193 | }
194 | } catch let error {
195 | print(error)
196 | }
197 | }
198 | guard let filePath = Bundle.main.url(forResource: "Contents", withExtension: "json") else { return }
199 | let originalData = try Data(contentsOf: filePath)
200 | try originalData.write(to: withAppIconSet.appendingPathComponent("Contents.json"))
201 | } catch let error {
202 | print(error)
203 | }
204 | }
205 | }
206 | }
207 |
208 | extension HomeController: DragViewDelegate {
209 | func dragView(didDragFileWith url: URL) {
210 | guard let image = NSImage(contentsOf: url) else { return }
211 | imageView.image = image
212 | selectedAssetName = url.deletingPathExtension().lastPathComponent
213 | }
214 | }
215 |
--------------------------------------------------------------------------------
/Resizr.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 32378812223AC119009F4D04 /* CALayer+Utility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32378810223AC118009F4D04 /* CALayer+Utility.swift */; };
11 | 32378813223AC119009F4D04 /* NSDraggingInfo+Utility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32378811223AC119009F4D04 /* NSDraggingInfo+Utility.swift */; };
12 | 6E28A3F7223D1FC400A94784 /* AssetContents.json in Resources */ = {isa = PBXBuildFile; fileRef = 6E28A3F6223D1FC400A94784 /* AssetContents.json */; };
13 | 6E7997E2222EEE1600850D97 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E7997E1222EEE1600850D97 /* AppDelegate.swift */; };
14 | 6E7997E4222EEE1600850D97 /* HomeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E7997E3222EEE1600850D97 /* HomeController.swift */; };
15 | 6E7997E6222EEE1700850D97 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6E7997E5222EEE1700850D97 /* Assets.xcassets */; };
16 | 6E7997E9222EEE1700850D97 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6E7997E7222EEE1700850D97 /* Main.storyboard */; };
17 | 6E7997F2222EEEC300850D97 /* DragView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E7997F1222EEEC300850D97 /* DragView.swift */; };
18 | 6EF404AD22302AFB00A57454 /* Contents.json in Resources */ = {isa = PBXBuildFile; fileRef = 6EF404AC22302AFB00A57454 /* Contents.json */; };
19 | 6EF404AF22302F7200A57454 /* DragViewDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EF404AE22302F7200A57454 /* DragViewDelegate.swift */; };
20 | 6EF404B122302F9F00A57454 /* NSImage+Resized.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6EF404B022302F9F00A57454 /* NSImage+Resized.swift */; };
21 | /* End PBXBuildFile section */
22 |
23 | /* Begin PBXFileReference section */
24 | 32378810223AC118009F4D04 /* CALayer+Utility.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "CALayer+Utility.swift"; path = "Resizr/Utility/CALayer+Utility.swift"; sourceTree = SOURCE_ROOT; };
25 | 32378811223AC119009F4D04 /* NSDraggingInfo+Utility.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = "NSDraggingInfo+Utility.swift"; path = "Resizr/Utility/NSDraggingInfo+Utility.swift"; sourceTree = SOURCE_ROOT; };
26 | 6E28A3F6223D1FC400A94784 /* AssetContents.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = AssetContents.json; sourceTree = ""; };
27 | 6E7997DE222EEE1600850D97 /* Resizr.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Resizr.app; sourceTree = BUILT_PRODUCTS_DIR; };
28 | 6E7997E1222EEE1600850D97 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
29 | 6E7997E3222EEE1600850D97 /* HomeController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeController.swift; sourceTree = ""; };
30 | 6E7997E5222EEE1700850D97 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
31 | 6E7997E8222EEE1700850D97 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
32 | 6E7997EA222EEE1700850D97 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
33 | 6E7997EB222EEE1700850D97 /* Resizr.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Resizr.entitlements; sourceTree = ""; };
34 | 6E7997F1222EEEC300850D97 /* DragView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DragView.swift; sourceTree = ""; };
35 | 6EF404AC22302AFB00A57454 /* Contents.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = Contents.json; sourceTree = ""; };
36 | 6EF404AE22302F7200A57454 /* DragViewDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DragViewDelegate.swift; sourceTree = ""; };
37 | 6EF404B022302F9F00A57454 /* NSImage+Resized.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSImage+Resized.swift"; sourceTree = ""; };
38 | /* End PBXFileReference section */
39 |
40 | /* Begin PBXFrameworksBuildPhase section */
41 | 6E7997DB222EEE1600850D97 /* Frameworks */ = {
42 | isa = PBXFrameworksBuildPhase;
43 | buildActionMask = 2147483647;
44 | files = (
45 | );
46 | runOnlyForDeploymentPostprocessing = 0;
47 | };
48 | /* End PBXFrameworksBuildPhase section */
49 |
50 | /* Begin PBXGroup section */
51 | 3237880F223AC10B009F4D04 /* Utility */ = {
52 | isa = PBXGroup;
53 | children = (
54 | 32378810223AC118009F4D04 /* CALayer+Utility.swift */,
55 | 32378811223AC119009F4D04 /* NSDraggingInfo+Utility.swift */,
56 | );
57 | name = Utility;
58 | path = "New Group";
59 | sourceTree = "";
60 | };
61 | 6E7997D5222EEE1600850D97 = {
62 | isa = PBXGroup;
63 | children = (
64 | 6E7997E0222EEE1600850D97 /* Resizr */,
65 | 6E7997DF222EEE1600850D97 /* Products */,
66 | );
67 | sourceTree = "";
68 | };
69 | 6E7997DF222EEE1600850D97 /* Products */ = {
70 | isa = PBXGroup;
71 | children = (
72 | 6E7997DE222EEE1600850D97 /* Resizr.app */,
73 | );
74 | name = Products;
75 | sourceTree = "";
76 | };
77 | 6E7997E0222EEE1600850D97 /* Resizr */ = {
78 | isa = PBXGroup;
79 | children = (
80 | 3237880F223AC10B009F4D04 /* Utility */,
81 | 6E7997E1222EEE1600850D97 /* AppDelegate.swift */,
82 | 6EF404AE22302F7200A57454 /* DragViewDelegate.swift */,
83 | 6E7997F1222EEEC300850D97 /* DragView.swift */,
84 | 6E7997E3222EEE1600850D97 /* HomeController.swift */,
85 | 6EF404B022302F9F00A57454 /* NSImage+Resized.swift */,
86 | 6E7997E5222EEE1700850D97 /* Assets.xcassets */,
87 | 6E7997E7222EEE1700850D97 /* Main.storyboard */,
88 | 6E7997EA222EEE1700850D97 /* Info.plist */,
89 | 6E7997EB222EEE1700850D97 /* Resizr.entitlements */,
90 | 6EF404AC22302AFB00A57454 /* Contents.json */,
91 | 6E28A3F6223D1FC400A94784 /* AssetContents.json */,
92 | );
93 | path = Resizr;
94 | sourceTree = "";
95 | };
96 | /* End PBXGroup section */
97 |
98 | /* Begin PBXNativeTarget section */
99 | 6E7997DD222EEE1600850D97 /* Resizr */ = {
100 | isa = PBXNativeTarget;
101 | buildConfigurationList = 6E7997EE222EEE1700850D97 /* Build configuration list for PBXNativeTarget "Resizr" */;
102 | buildPhases = (
103 | 6E7997DA222EEE1600850D97 /* Sources */,
104 | 6E7997DB222EEE1600850D97 /* Frameworks */,
105 | 6E7997DC222EEE1600850D97 /* Resources */,
106 | );
107 | buildRules = (
108 | );
109 | dependencies = (
110 | );
111 | name = Resizr;
112 | productName = Resizr;
113 | productReference = 6E7997DE222EEE1600850D97 /* Resizr.app */;
114 | productType = "com.apple.product-type.application";
115 | };
116 | /* End PBXNativeTarget section */
117 |
118 | /* Begin PBXProject section */
119 | 6E7997D6222EEE1600850D97 /* Project object */ = {
120 | isa = PBXProject;
121 | attributes = {
122 | LastSwiftUpdateCheck = 1010;
123 | LastUpgradeCheck = 1110;
124 | ORGANIZATIONNAME = "Onur Geneş";
125 | TargetAttributes = {
126 | 6E7997DD222EEE1600850D97 = {
127 | CreatedOnToolsVersion = 10.1;
128 | LastSwiftMigration = 1020;
129 | SystemCapabilities = {
130 | com.apple.Sandbox = {
131 | enabled = 1;
132 | };
133 | };
134 | };
135 | };
136 | };
137 | buildConfigurationList = 6E7997D9222EEE1600850D97 /* Build configuration list for PBXProject "Resizr" */;
138 | compatibilityVersion = "Xcode 9.3";
139 | developmentRegion = en;
140 | hasScannedForEncodings = 0;
141 | knownRegions = (
142 | en,
143 | Base,
144 | );
145 | mainGroup = 6E7997D5222EEE1600850D97;
146 | productRefGroup = 6E7997DF222EEE1600850D97 /* Products */;
147 | projectDirPath = "";
148 | projectRoot = "";
149 | targets = (
150 | 6E7997DD222EEE1600850D97 /* Resizr */,
151 | );
152 | };
153 | /* End PBXProject section */
154 |
155 | /* Begin PBXResourcesBuildPhase section */
156 | 6E7997DC222EEE1600850D97 /* Resources */ = {
157 | isa = PBXResourcesBuildPhase;
158 | buildActionMask = 2147483647;
159 | files = (
160 | 6E28A3F7223D1FC400A94784 /* AssetContents.json in Resources */,
161 | 6E7997E6222EEE1700850D97 /* Assets.xcassets in Resources */,
162 | 6E7997E9222EEE1700850D97 /* Main.storyboard in Resources */,
163 | 6EF404AD22302AFB00A57454 /* Contents.json in Resources */,
164 | );
165 | runOnlyForDeploymentPostprocessing = 0;
166 | };
167 | /* End PBXResourcesBuildPhase section */
168 |
169 | /* Begin PBXSourcesBuildPhase section */
170 | 6E7997DA222EEE1600850D97 /* Sources */ = {
171 | isa = PBXSourcesBuildPhase;
172 | buildActionMask = 2147483647;
173 | files = (
174 | 6E7997E4222EEE1600850D97 /* HomeController.swift in Sources */,
175 | 6EF404B122302F9F00A57454 /* NSImage+Resized.swift in Sources */,
176 | 6EF404AF22302F7200A57454 /* DragViewDelegate.swift in Sources */,
177 | 6E7997E2222EEE1600850D97 /* AppDelegate.swift in Sources */,
178 | 32378813223AC119009F4D04 /* NSDraggingInfo+Utility.swift in Sources */,
179 | 32378812223AC119009F4D04 /* CALayer+Utility.swift in Sources */,
180 | 6E7997F2222EEEC300850D97 /* DragView.swift in Sources */,
181 | );
182 | runOnlyForDeploymentPostprocessing = 0;
183 | };
184 | /* End PBXSourcesBuildPhase section */
185 |
186 | /* Begin PBXVariantGroup section */
187 | 6E7997E7222EEE1700850D97 /* Main.storyboard */ = {
188 | isa = PBXVariantGroup;
189 | children = (
190 | 6E7997E8222EEE1700850D97 /* Base */,
191 | );
192 | name = Main.storyboard;
193 | sourceTree = "";
194 | };
195 | /* End PBXVariantGroup section */
196 |
197 | /* Begin XCBuildConfiguration section */
198 | 6E7997EC222EEE1700850D97 /* Debug */ = {
199 | isa = XCBuildConfiguration;
200 | buildSettings = {
201 | ALWAYS_SEARCH_USER_PATHS = NO;
202 | CLANG_ANALYZER_NONNULL = YES;
203 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
204 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
205 | CLANG_CXX_LIBRARY = "libc++";
206 | CLANG_ENABLE_MODULES = YES;
207 | CLANG_ENABLE_OBJC_ARC = YES;
208 | CLANG_ENABLE_OBJC_WEAK = YES;
209 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
210 | CLANG_WARN_BOOL_CONVERSION = YES;
211 | CLANG_WARN_COMMA = YES;
212 | CLANG_WARN_CONSTANT_CONVERSION = YES;
213 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
214 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
215 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
216 | CLANG_WARN_EMPTY_BODY = YES;
217 | CLANG_WARN_ENUM_CONVERSION = YES;
218 | CLANG_WARN_INFINITE_RECURSION = YES;
219 | CLANG_WARN_INT_CONVERSION = YES;
220 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
221 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
222 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
223 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
224 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
225 | CLANG_WARN_STRICT_PROTOTYPES = YES;
226 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
227 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
228 | CLANG_WARN_UNREACHABLE_CODE = YES;
229 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
230 | CODE_SIGN_IDENTITY = "Mac Developer";
231 | COPY_PHASE_STRIP = NO;
232 | DEBUG_INFORMATION_FORMAT = dwarf;
233 | ENABLE_STRICT_OBJC_MSGSEND = YES;
234 | ENABLE_TESTABILITY = YES;
235 | GCC_C_LANGUAGE_STANDARD = gnu11;
236 | GCC_DYNAMIC_NO_PIC = NO;
237 | GCC_NO_COMMON_BLOCKS = YES;
238 | GCC_OPTIMIZATION_LEVEL = 0;
239 | GCC_PREPROCESSOR_DEFINITIONS = (
240 | "DEBUG=1",
241 | "$(inherited)",
242 | );
243 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
244 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
245 | GCC_WARN_UNDECLARED_SELECTOR = YES;
246 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
247 | GCC_WARN_UNUSED_FUNCTION = YES;
248 | GCC_WARN_UNUSED_VARIABLE = YES;
249 | MACOSX_DEPLOYMENT_TARGET = 10.14;
250 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
251 | MTL_FAST_MATH = YES;
252 | ONLY_ACTIVE_ARCH = YES;
253 | SDKROOT = macosx;
254 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
255 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
256 | };
257 | name = Debug;
258 | };
259 | 6E7997ED222EEE1700850D97 /* Release */ = {
260 | isa = XCBuildConfiguration;
261 | buildSettings = {
262 | ALWAYS_SEARCH_USER_PATHS = NO;
263 | CLANG_ANALYZER_NONNULL = YES;
264 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
265 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
266 | CLANG_CXX_LIBRARY = "libc++";
267 | CLANG_ENABLE_MODULES = YES;
268 | CLANG_ENABLE_OBJC_ARC = YES;
269 | CLANG_ENABLE_OBJC_WEAK = YES;
270 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
271 | CLANG_WARN_BOOL_CONVERSION = YES;
272 | CLANG_WARN_COMMA = YES;
273 | CLANG_WARN_CONSTANT_CONVERSION = YES;
274 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
275 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
276 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
277 | CLANG_WARN_EMPTY_BODY = YES;
278 | CLANG_WARN_ENUM_CONVERSION = YES;
279 | CLANG_WARN_INFINITE_RECURSION = YES;
280 | CLANG_WARN_INT_CONVERSION = YES;
281 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
282 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
283 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
284 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
285 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
286 | CLANG_WARN_STRICT_PROTOTYPES = YES;
287 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
288 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
289 | CLANG_WARN_UNREACHABLE_CODE = YES;
290 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
291 | CODE_SIGN_IDENTITY = "Mac Developer";
292 | COPY_PHASE_STRIP = NO;
293 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
294 | ENABLE_NS_ASSERTIONS = NO;
295 | ENABLE_STRICT_OBJC_MSGSEND = YES;
296 | GCC_C_LANGUAGE_STANDARD = gnu11;
297 | GCC_NO_COMMON_BLOCKS = YES;
298 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
299 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
300 | GCC_WARN_UNDECLARED_SELECTOR = YES;
301 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
302 | GCC_WARN_UNUSED_FUNCTION = YES;
303 | GCC_WARN_UNUSED_VARIABLE = YES;
304 | MACOSX_DEPLOYMENT_TARGET = 10.14;
305 | MTL_ENABLE_DEBUG_INFO = NO;
306 | MTL_FAST_MATH = YES;
307 | SDKROOT = macosx;
308 | SWIFT_COMPILATION_MODE = wholemodule;
309 | SWIFT_OPTIMIZATION_LEVEL = "-O";
310 | };
311 | name = Release;
312 | };
313 | 6E7997EF222EEE1700850D97 /* Debug */ = {
314 | isa = XCBuildConfiguration;
315 | buildSettings = {
316 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
317 | CODE_SIGN_ENTITLEMENTS = Resizr/Resizr.entitlements;
318 | CODE_SIGN_IDENTITY = "-";
319 | CODE_SIGN_STYLE = Automatic;
320 | COMBINE_HIDPI_IMAGES = YES;
321 | CURRENT_PROJECT_VERSION = 8;
322 | DEVELOPMENT_TEAM = "";
323 | ENABLE_HARDENED_RUNTIME = YES;
324 | INFOPLIST_FILE = Resizr/Info.plist;
325 | LD_RUNPATH_SEARCH_PATHS = (
326 | "$(inherited)",
327 | "@executable_path/../Frameworks",
328 | );
329 | MACOSX_DEPLOYMENT_TARGET = 10.13;
330 | MARKETING_VERSION = 1.3.2;
331 | PRODUCT_BUNDLE_IDENTIFIER = com.onurgenes.Resizr;
332 | PRODUCT_NAME = "$(TARGET_NAME)";
333 | SWIFT_VERSION = 5.0;
334 | };
335 | name = Debug;
336 | };
337 | 6E7997F0222EEE1700850D97 /* Release */ = {
338 | isa = XCBuildConfiguration;
339 | buildSettings = {
340 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
341 | CODE_SIGN_ENTITLEMENTS = Resizr/Resizr.entitlements;
342 | CODE_SIGN_IDENTITY = "-";
343 | CODE_SIGN_STYLE = Automatic;
344 | COMBINE_HIDPI_IMAGES = YES;
345 | CURRENT_PROJECT_VERSION = 8;
346 | DEVELOPMENT_TEAM = "";
347 | ENABLE_HARDENED_RUNTIME = YES;
348 | INFOPLIST_FILE = Resizr/Info.plist;
349 | LD_RUNPATH_SEARCH_PATHS = (
350 | "$(inherited)",
351 | "@executable_path/../Frameworks",
352 | );
353 | MACOSX_DEPLOYMENT_TARGET = 10.13;
354 | MARKETING_VERSION = 1.3.2;
355 | PRODUCT_BUNDLE_IDENTIFIER = com.onurgenes.Resizr;
356 | PRODUCT_NAME = "$(TARGET_NAME)";
357 | SWIFT_VERSION = 5.0;
358 | };
359 | name = Release;
360 | };
361 | /* End XCBuildConfiguration section */
362 |
363 | /* Begin XCConfigurationList section */
364 | 6E7997D9222EEE1600850D97 /* Build configuration list for PBXProject "Resizr" */ = {
365 | isa = XCConfigurationList;
366 | buildConfigurations = (
367 | 6E7997EC222EEE1700850D97 /* Debug */,
368 | 6E7997ED222EEE1700850D97 /* Release */,
369 | );
370 | defaultConfigurationIsVisible = 0;
371 | defaultConfigurationName = Release;
372 | };
373 | 6E7997EE222EEE1700850D97 /* Build configuration list for PBXNativeTarget "Resizr" */ = {
374 | isa = XCConfigurationList;
375 | buildConfigurations = (
376 | 6E7997EF222EEE1700850D97 /* Debug */,
377 | 6E7997F0222EEE1700850D97 /* Release */,
378 | );
379 | defaultConfigurationIsVisible = 0;
380 | defaultConfigurationName = Release;
381 | };
382 | /* End XCConfigurationList section */
383 | };
384 | rootObject = 6E7997D6222EEE1600850D97 /* Project object */;
385 | }
386 |
--------------------------------------------------------------------------------
/Resizr/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
674 |
675 |
676 |
677 |
678 |
679 |
680 |
681 |
682 |
683 |
684 |
685 |
686 |
687 |
688 |
689 |
690 |
691 |
692 |
693 |
694 |
695 |
696 |
697 |
698 |
699 |
700 |
701 |
702 |
703 |
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 |
712 |
713 |
714 |
715 |
716 |
717 |
718 |
719 |
720 |
721 |
731 |
732 |
733 |
734 |
735 |
736 |
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 |
745 |
746 |
747 |
748 |
749 |
750 |
751 |
752 |
753 |
754 |
755 |
756 |
757 |
758 |
759 |
760 |
761 |
762 |
763 |
--------------------------------------------------------------------------------