Skip to content

Commit 562874f

Browse files
committed
Minor fixes
1 parent f04147b commit 562874f

File tree

77 files changed

+1695
-167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1695
-167
lines changed

.DS_Store

0 Bytes
Binary file not shown.

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<p align="center"><img src="https://user-images.githubusercontent.com/13581484/62501612-9e0d1100-b7b9-11e9-9c3e-7529a5c141d9.jpeg" /></p>
2+
<h2 align="center">A cross-platform Reddit client created in SwiftUI.</h2>
3+
4+
> *Note:* This project is far from complete. It still lacks many features of your typical Reddit client and has bugs (partly due to SwiftUI, but I'll take credit for some of them)
5+
6+
To show off SwiftUI's strength in cross-platform development, I did **not** use Mac Catalyst for this project. Instead, common UI code is shared between iOS, macOS, and watchOS.
7+
8+
## Project Structure
9+
* `Shared` - Models, helpers, API, and any shared Views.
10+
* `Reddit-[PLATFORM]` - Each target folder contains a `Views` and `Representable` folder. `Views` holds platform-specific views, and `Representable` contains `UIViewRepresentables` or `NSViewRepresentables`.
11+
12+
## macOS Specific Features
13+
I've added several things to make the macOS app stand out:
14+
1. Double click - You can double click on a post to open a new window for the detail view.
15+
2. `NSToolbar` - This is implemented entirely in the `AppDelegate`, and uses standard Cocoa code which interfaces with the SwiftUI views.
16+
3. `TouchBar` - TODO
17+
18+
## SF Symbols
19+
Because macOS doesn't support SF Symbols, I have created the following extension to make sure shared code works. I would like to replace this with custom icons for macOS that it loads from `XCAssets` eventually:
20+
```swift
21+
/// `SwiftUI` compatibility
22+
#if os(macOS)
23+
extension Image {
24+
init(systemName: String) {
25+
self.init(nsImage: NSImage())
26+
}
27+
}
28+
#endif
29+
```
File renamed without changes.

Reddit/Assets.xcassets/AppIcon.appiconset/Contents.json renamed to Reddit-iOS/Assets.xcassets/AppIcon.appiconset/Contents.json

Lines changed: 41 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,117 @@
11
{
22
"images" : [
33
{
4-
"idiom" : "iphone",
54
"size" : "20x20",
5+
"idiom" : "iphone",
6+
"filename" : "Icon-App-20x20@2x.png",
67
"scale" : "2x"
78
},
89
{
9-
"idiom" : "iphone",
1010
"size" : "20x20",
11+
"idiom" : "iphone",
12+
"filename" : "Icon-App-20x20@3x.png",
1113
"scale" : "3x"
1214
},
1315
{
16+
"size" : "29x29",
1417
"idiom" : "iphone",
18+
"filename" : "Icon-App-29x29@1x.png",
19+
"scale" : "1x"
20+
},
21+
{
1522
"size" : "29x29",
23+
"idiom" : "iphone",
24+
"filename" : "Icon-App-29x29@2x.png",
1625
"scale" : "2x"
1726
},
1827
{
19-
"idiom" : "iphone",
2028
"size" : "29x29",
29+
"idiom" : "iphone",
30+
"filename" : "Icon-App-29x29@3x.png",
2131
"scale" : "3x"
2232
},
2333
{
24-
"idiom" : "iphone",
2534
"size" : "40x40",
35+
"idiom" : "iphone",
36+
"filename" : "Icon-App-40x40@2x.png",
2637
"scale" : "2x"
2738
},
2839
{
29-
"idiom" : "iphone",
3040
"size" : "40x40",
41+
"idiom" : "iphone",
42+
"filename" : "Icon-App-40x40@3x.png",
3143
"scale" : "3x"
3244
},
3345
{
34-
"idiom" : "iphone",
3546
"size" : "60x60",
47+
"idiom" : "iphone",
48+
"filename" : "Icon-App-60x60@2x.png",
3649
"scale" : "2x"
3750
},
3851
{
39-
"idiom" : "iphone",
4052
"size" : "60x60",
53+
"idiom" : "iphone",
54+
"filename" : "Icon-App-60x60@3x.png",
4155
"scale" : "3x"
4256
},
4357
{
44-
"idiom" : "ipad",
4558
"size" : "20x20",
59+
"idiom" : "ipad",
60+
"filename" : "Icon-App-20x20@1x.png",
4661
"scale" : "1x"
4762
},
4863
{
49-
"idiom" : "ipad",
5064
"size" : "20x20",
65+
"idiom" : "ipad",
66+
"filename" : "Icon-App-20x20@2x.png",
5167
"scale" : "2x"
5268
},
5369
{
54-
"idiom" : "ipad",
5570
"size" : "29x29",
71+
"idiom" : "ipad",
72+
"filename" : "Icon-App-29x29@1x.png",
5673
"scale" : "1x"
5774
},
5875
{
59-
"idiom" : "ipad",
6076
"size" : "29x29",
77+
"idiom" : "ipad",
78+
"filename" : "Icon-App-29x29@2x.png",
6179
"scale" : "2x"
6280
},
6381
{
64-
"idiom" : "ipad",
6582
"size" : "40x40",
83+
"idiom" : "ipad",
84+
"filename" : "Icon-App-40x40@1x.png",
6685
"scale" : "1x"
6786
},
6887
{
69-
"idiom" : "ipad",
7088
"size" : "40x40",
89+
"idiom" : "ipad",
90+
"filename" : "Icon-App-40x40@2x.png",
7191
"scale" : "2x"
7292
},
7393
{
74-
"idiom" : "ipad",
7594
"size" : "76x76",
95+
"idiom" : "ipad",
96+
"filename" : "Icon-App-76x76@1x.png",
7697
"scale" : "1x"
7798
},
7899
{
79-
"idiom" : "ipad",
80100
"size" : "76x76",
101+
"idiom" : "ipad",
102+
"filename" : "Icon-App-76x76@2x.png",
81103
"scale" : "2x"
82104
},
83105
{
84-
"idiom" : "ipad",
85106
"size" : "83.5x83.5",
107+
"idiom" : "ipad",
108+
"filename" : "Icon-App-83.5x83.5@2x.png",
86109
"scale" : "2x"
87110
},
88111
{
89-
"idiom" : "ios-marketing",
90112
"size" : "1024x1024",
113+
"idiom" : "ios-marketing",
114+
"filename" : "ItunesArtwork@2x.png",
91115
"scale" : "1x"
92116
}
93117
],
825 Bytes
Loading
1.86 KB
Loading
3.17 KB
Loading
1.23 KB
Loading
3 KB
Loading

0 commit comments

Comments
 (0)