Skip to content

Commit

Permalink
Merge pull request #5 from insightmind/work/update-for-iOS-14
Browse files Browse the repository at this point in the history
Use LazyVGrid instead of List to remove Separators
  • Loading branch information
insightmind authored Jun 25, 2020
2 parents 51cee55 + 9fcc03f commit 76dc5ac
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 102 deletions.
44 changes: 16 additions & 28 deletions AppleBeta/AppleBeta.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
F70E8927249BCFB900BB240C /* FeedCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70E8926249BCFB900BB240C /* FeedCellView.swift */; };
F75724B7249BC75F00F181AF /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75724B6249BC75F00F181AF /* AppDelegate.swift */; };
F75724B9249BC75F00F181AF /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75724B8249BC75F00F181AF /* SceneDelegate.swift */; };
F70E8927249BCFB900BB240C /* FeedCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F70E8926249BCFB900BB240C /* FeedCell.swift */; };
F75724BB249BC75F00F181AF /* EntryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75724BA249BC75F00F181AF /* EntryView.swift */; };
F75724C0249BC76000F181AF /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F75724BF249BC76000F181AF /* Preview Assets.xcassets */; };
F75724C3249BC76000F181AF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F75724C1249BC76000F181AF /* LaunchScreen.storyboard */; };
Expand All @@ -20,24 +18,24 @@
F75724DA249BCA1700F181AF /* FeedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75724D9249BCA1600F181AF /* FeedView.swift */; };
F75724DD249BCC0D00F181AF /* FeedItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75724DC249BCC0D00F181AF /* FeedItem.swift */; };
F75724DF249BCC3F00F181AF /* Source.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75724DE249BCC3F00F181AF /* Source.swift */; };
F75CC38924A54516000FD33E /* AppleBetaApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75CC38824A54516000FD33E /* AppleBetaApp.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
F70E8926249BCFB900BB240C /* FeedCellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedCellView.swift; sourceTree = "<group>"; };
F70E8926249BCFB900BB240C /* FeedCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedCell.swift; sourceTree = "<group>"; };
F75724B3249BC75F00F181AF /* AppleBeta.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AppleBeta.app; sourceTree = BUILT_PRODUCTS_DIR; };
F75724B6249BC75F00F181AF /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
F75724B8249BC75F00F181AF /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
F75724BA249BC75F00F181AF /* EntryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EntryView.swift; sourceTree = "<group>"; };
F75724BF249BC76000F181AF /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
F75724C2249BC76000F181AF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
F75724C4249BC76000F181AF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
F75724CD249BC7CD00F181AF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
F75724CF249BC7EB00F181AF /* AppleBeta.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = AppleBeta.entitlements; sourceTree = "<group>"; };
F75724D0249BC84300F181AF /* Requester.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Requester.swift; sourceTree = "<group>"; };
F75724D2249BC84800F181AF /* FeedType.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedType.swift; sourceTree = "<group>"; };
F75724D9249BCA1600F181AF /* FeedView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedView.swift; sourceTree = "<group>"; };
F75724DC249BCC0D00F181AF /* FeedItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeedItem.swift; sourceTree = "<group>"; };
F75724DE249BCC3F00F181AF /* Source.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Source.swift; sourceTree = "<group>"; };
F75CC38824A54516000FD33E /* AppleBetaApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleBetaApp.swift; sourceTree = "<group>"; };
F75CC38A24A54655000FD33E /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -56,7 +54,7 @@
isa = PBXGroup;
children = (
F75724D9249BCA1600F181AF /* FeedView.swift */,
F70E8926249BCFB900BB240C /* FeedCellView.swift */,
F70E8926249BCFB900BB240C /* FeedCell.swift */,
);
path = Feed;
sourceTree = "<group>";
Expand All @@ -80,7 +78,7 @@
F75724B5249BC75F00F181AF /* AppleBeta */ = {
isa = PBXGroup;
children = (
F75724D4249BC85500F181AF /* Global */,
F75CC38824A54516000FD33E /* AppleBetaApp.swift */,
F75724DB249BCBF700F181AF /* Models */,
F75724D8249BC8B700F181AF /* Networking */,
F75724BE249BC76000F181AF /* Preview Content */,
Expand All @@ -99,15 +97,6 @@
path = "Preview Content";
sourceTree = "<group>";
};
F75724D4249BC85500F181AF /* Global */ = {
isa = PBXGroup;
children = (
F75724B6249BC75F00F181AF /* AppDelegate.swift */,
F75724B8249BC75F00F181AF /* SceneDelegate.swift */,
);
path = Global;
sourceTree = "<group>";
};
F75724D5249BC88900F181AF /* Resources */ = {
isa = PBXGroup;
children = (
Expand All @@ -120,7 +109,7 @@
F75724D6249BC89F00F181AF /* Supporting */ = {
isa = PBXGroup;
children = (
F75724C4249BC76000F181AF /* Info.plist */,
F75CC38A24A54655000FD33E /* Info.plist */,
F75724CF249BC7EB00F181AF /* AppleBeta.entitlements */,
);
path = Supporting;
Expand Down Expand Up @@ -231,12 +220,11 @@
buildActionMask = 2147483647;
files = (
F75724DF249BCC3F00F181AF /* Source.swift in Sources */,
F75724B7249BC75F00F181AF /* AppDelegate.swift in Sources */,
F75724B9249BC75F00F181AF /* SceneDelegate.swift in Sources */,
F75724D1249BC84300F181AF /* Requester.swift in Sources */,
F75724BB249BC75F00F181AF /* EntryView.swift in Sources */,
F75724DA249BCA1700F181AF /* FeedView.swift in Sources */,
F70E8927249BCFB900BB240C /* FeedCellView.swift in Sources */,
F75CC38924A54516000FD33E /* AppleBetaApp.swift in Sources */,
F70E8927249BCFB900BB240C /* FeedCell.swift in Sources */,
F75724DD249BCC0D00F181AF /* FeedItem.swift in Sources */,
F75724D3249BC84800F181AF /* FeedType.swift in Sources */,
);
Expand Down Expand Up @@ -306,7 +294,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.6;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -360,7 +348,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.6;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
Expand All @@ -380,7 +368,7 @@
DEVELOPMENT_TEAM = V6KWUV4A4U;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = AppleBeta/Supporting/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -390,7 +378,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,6";
};
name = Debug;
};
Expand All @@ -404,7 +392,7 @@
DEVELOPMENT_TEAM = V6KWUV4A4U;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = AppleBeta/Supporting/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -414,7 +402,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TARGETED_DEVICE_FAMILY = "1,2,6";
};
name = Release;
};
Expand Down
18 changes: 18 additions & 0 deletions AppleBeta/AppleBeta/AppleBetaApp.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// AppleBetaApp.swift
// AppleBeta
//
// Created by Niklas Bülow on 25.06.20.
// Copyright © 2020 Niklas Buelow. All rights reserved.
//

import SwiftUI

@main
struct AppleBetaApp: App {
var body: some Scene {
WindowGroup {
EntryView()
}
}
}
17 changes: 0 additions & 17 deletions AppleBeta/AppleBeta/Global/AppDelegate.swift

This file was deleted.

31 changes: 0 additions & 31 deletions AppleBeta/AppleBeta/Global/SceneDelegate.swift

This file was deleted.

6 changes: 3 additions & 3 deletions AppleBeta/AppleBeta/Resources/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
23 changes: 8 additions & 15 deletions AppleBeta/AppleBeta/Supporting/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,15 @@
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
</dict>
</array>
</dict>
<true/>
</dict>
<key>UILaunchScreen</key>
<dict>
<key>UINavigationBar</key>
<dict/>
<key>UITabBar</key>
<dict/>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import SwiftUI

struct FeedCellView: View {
struct FeedCell: View {
@State var feedItem: FeedItem

var body: some View {
Expand All @@ -32,11 +32,14 @@ struct FeedCellView: View {
}
}
.frame(minWidth: 0, maxWidth: .infinity, idealHeight: 60, alignment: .leading)
.onAppear {
UITableView.appearance().separatorColor = nil
}
}
}

struct FeedCellView_Previews: PreviewProvider {
static var previews: some View {
FeedCellView(feedItem: FeedItem(type: .iOS, title: "Xcode 11.6 beta (11N700h)", date: Date()))
FeedCell(feedItem: FeedItem(type: .iOS, title: "Xcode 11.6 beta (11N700h)", date: Date()))
}
}
14 changes: 8 additions & 6 deletions AppleBeta/AppleBeta/View/Feed/FeedView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,18 @@ struct FeedView: View {

var body: some View {
NavigationView {
List(feed, rowContent: FeedCellView.init)
.id(UUID())
.onAppear(perform: loadFeed)
.navigationBarTitle(title)
ScrollView {
LazyVGrid(columns: [GridItem()]) {
ForEach(feed, content: FeedCell.init)
.padding([.leading, .trailing])
}
}
.onAppear(perform: loadFeed)
.navigationBarTitle(title)
}
}

private func loadFeed() {
guard feed.isEmpty else { return }

Requester().loadFeed(for: source) { feed in
self.feed = feed
}
Expand Down

0 comments on commit 76dc5ac

Please sign in to comment.