Skip to content

Commit

Permalink
ref HeroTransitions#623 - revert target settings and make sure Exampl…
Browse files Browse the repository at this point in the history
…e still works (in simulator)
  • Loading branch information
Menno Lovink authored and nick-potts committed Dec 16, 2019
1 parent 3859059 commit 5b51fee
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
5 changes: 4 additions & 1 deletion Examples/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,14 @@ class MainViewController: UIViewController {
let dataSource = ArrayDataSource<SourceData>(data: [
(BuiltInTransitionExampleViewController1.self, "Built In Animations"),
(MatchExampleViewController1.self, "Match Animation"),
(SwiftUIMatchExampleViewController.self, "Match SwiftUI"),
(MatchInCollectionExampleViewController1.self, "Match Cell in Collection"),
(AppStoreViewController1.self, "App Store Transition"),
])

if #available(iOS 13.0, *) {
dataSource.data.insert((SwiftUIMatchExampleViewController.self, "Match SwiftUI"), at: 2)
}

let viewSource = ClosureViewSource { (label: UILabel, data: SourceData, index) in
label.text = "\(index + 1). \(data.1)"
label.textAlignment = .center
Expand Down
11 changes: 7 additions & 4 deletions Examples/SwiftUIMatchExample.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import UIKit
import SwiftUI


@available(iOS 13.0, *)
class SwiftUIMatchExampleViewController: UIHostingController<ImagesTableView> {

override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
Expand Down Expand Up @@ -30,6 +32,7 @@ struct ImageInfo: Identifiable {
let name: String
}

@available(iOS 13.0, *)
struct ImagesTableView: View {

var onTapRow: ((ImageInfo)->())?
Expand All @@ -50,9 +53,7 @@ struct ImagesTableView: View {
}
}

#if DEBUG
#endif

@available(iOS 13.0, *)
struct ImageViewWrapper: View, UIViewRepresentable {

let name: String
Expand All @@ -68,16 +69,18 @@ struct ImageViewWrapper: View, UIViewRepresentable {
}
}

//MARK: - Previews
//MARK: - Previews (Will only work when target of HeroExamples is set to iOS 13 +)

#if DEBUG

@available(iOS 13.0, *)
struct ImagesTableView_Previews: PreviewProvider {
static var previews: some View {
ImagesTableView(onTapRow: nil)
}
}

@available(iOS 13.0, *)
struct ImageViewWrapper_Previews: PreviewProvider {
static var previews: some View {
ImageViewWrapper(name: "Unsplash0", heroID: nil)
Expand Down
4 changes: 2 additions & 2 deletions Hero.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "$(SRCROOT)/Examples/Resources/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.5.0;
PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.HeroExamples;
Expand All @@ -1453,7 +1453,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
DEVELOPMENT_TEAM = "";
INFOPLIST_FILE = "$(SRCROOT)/Examples/Resources/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 1.5.0;
PRODUCT_BUNDLE_IDENTIFIER = com.lkzhao.HeroExamples;
Expand Down

0 comments on commit 5b51fee

Please sign in to comment.