Skip to content

Commit

Permalink
lower deployment target to iOS 11 by replacing UIImage(named:) instead
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisnyw committed Apr 7, 2022
1 parent f34a7a9 commit 69a227b
Show file tree
Hide file tree
Showing 43 changed files with 297 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Example/CNTimelineCellDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down Expand Up @@ -501,7 +501,7 @@
INFOPLIST_KEY_UIMainStoryboardFile = Main;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
2 changes: 2 additions & 0 deletions Example/CNTimelineCellDemo/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

// MARK: UISceneSession Lifecycle

@available(iOS 13.0, *)
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Called when a new scene session is being created.
// Use this method to select a configuration to create the new scene with.
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}

@available(iOS 13.0, *)
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
// Called when the user discards a scene session.
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@
"scale" : "2x",
"size" : "40x40"
},
{
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"idiom" : "ipad",
"scale" : "2x",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"images" : [
{
"filename" : "baseline_auto_awesome_black_24pt_1x.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "baseline_auto_awesome_black_24pt_2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "baseline_auto_awesome_black_24pt_3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"images": [
{
"filename": "baseline_bed_black_24pt_1x.png",
"idiom": "universal",
"scale": "1x",
"size": "24x24"
},
{
"filename": "baseline_bed_black_24pt_2x.png",
"idiom": "universal",
"scale": "2x",
"size": "24x24"
},
{
"filename": "baseline_bed_black_24pt_3x.png",
"idiom": "universal",
"scale": "3x",
"size": "24x24"
}
],
"info": {
"author": "xcode",
"template-rendering-intent": "template",
"version": 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"images": [
{
"filename": "baseline_light_mode_black_24pt_1x.png",
"idiom": "universal",
"scale": "1x",
"size": "24x24"
},
{
"filename": "baseline_light_mode_black_24pt_2x.png",
"idiom": "universal",
"scale": "2x",
"size": "24x24"
},
{
"filename": "baseline_light_mode_black_24pt_3x.png",
"idiom": "universal",
"scale": "3x",
"size": "24x24"
}
],
"info": {
"author": "xcode",
"template-rendering-intent": "template",
"version": 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"images": [
{
"filename": "baseline_mode_night_black_24pt_1x.png",
"idiom": "universal",
"scale": "1x",
"size": "24x24"
},
{
"filename": "baseline_mode_night_black_24pt_2x.png",
"idiom": "universal",
"scale": "2x",
"size": "24x24"
},
{
"filename": "baseline_mode_night_black_24pt_3x.png",
"idiom": "universal",
"scale": "3x",
"size": "24x24"
}
],
"info": {
"author": "xcode",
"template-rendering-intent": "template",
"version": 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"images": [
{
"filename": "baseline_restaurant_black_24pt_1x.png",
"idiom": "universal",
"scale": "1x",
"size": "24x24"
},
{
"filename": "baseline_restaurant_black_24pt_2x.png",
"idiom": "universal",
"scale": "2x",
"size": "24x24"
},
{
"filename": "baseline_restaurant_black_24pt_3x.png",
"idiom": "universal",
"scale": "3x",
"size": "24x24"
}
],
"info": {
"author": "xcode",
"template-rendering-intent": "template",
"version": 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"images": [
{
"filename": "baseline_school_black_24pt_1x.png",
"idiom": "universal",
"scale": "1x",
"size": "24x24"
},
{
"filename": "baseline_school_black_24pt_2x.png",
"idiom": "universal",
"scale": "2x",
"size": "24x24"
},
{
"filename": "baseline_school_black_24pt_3x.png",
"idiom": "universal",
"scale": "3x",
"size": "24x24"
}
],
"info": {
"author": "xcode",
"template-rendering-intent": "template",
"version": 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"images": [
{
"filename": "baseline_single_bed_black_24pt_1x.png",
"idiom": "universal",
"scale": "1x",
"size": "24x24"
},
{
"filename": "baseline_single_bed_black_24pt_2x.png",
"idiom": "universal",
"scale": "2x",
"size": "24x24"
},
{
"filename": "baseline_single_bed_black_24pt_3x.png",
"idiom": "universal",
"scale": "3x",
"size": "24x24"
}
],
"info": {
"author": "xcode",
"template-rendering-intent": "template",
"version": 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"images": [
{
"filename": "baseline_sports_basketball_black_24pt_1x.png",
"idiom": "universal",
"scale": "1x",
"size": "24x24"
},
{
"filename": "baseline_sports_basketball_black_24pt_2x.png",
"idiom": "universal",
"scale": "2x",
"size": "24x24"
},
{
"filename": "baseline_sports_basketball_black_24pt_3x.png",
"idiom": "universal",
"scale": "3x",
"size": "24x24"
}
],
"info": {
"author": "xcode",
"template-rendering-intent": "template",
"version": 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"images": [
{
"filename": "baseline_star_black_24pt_1x.png",
"idiom": "universal",
"scale": "1x",
"size": "24x24"
},
{
"filename": "baseline_star_black_24pt_2x.png",
"idiom": "universal",
"scale": "2x",
"size": "24x24"
},
{
"filename": "baseline_star_black_24pt_3x.png",
"idiom": "universal",
"scale": "3x",
"size": "24x24"
}
],
"info": {
"author": "xcode",
"template-rendering-intent": "template",
"version": 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Example/CNTimelineCellDemo/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import UIKit

@available(iOS 13.0, *)
class SceneDelegate: UIResponder, UIWindowSceneDelegate {

var window: UIWindow?
Expand Down
36 changes: 24 additions & 12 deletions Example/CNTimelineCellDemo/TimelineTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import CNTimelineCell
class TimelineTableViewController: UITableViewController {

var timelineStyle: TimelineStyle = TimelineStyle()
let dataItem: [TimelineItem] = [TimelineItem(title: "Good morning", content: "Today is sunny day!", image: UIImage(systemName: "sun.min")),
TimelineItem(title: "08:00 am", content: "Tom wakes up", image: UIImage(systemName: "star.fill"), leftType: .start),
let dataItem: [TimelineItem] = [TimelineItem(title: "Good morning", content: "Today is sunny day!", image: UIImage(named: "light")),
TimelineItem(title: "08:00 am", content: "Tom wakes up", image: UIImage(named: "star"), leftType: .start),
TimelineItem(title: "08:05 am", content: "Breakfast time", leftType: .spot),
TimelineItem(title: "08:30 am", content: "Mary wakes up", image: UIImage(systemName: "star.fill"), leftType: .line, rightType: .start),
TimelineItem(title: "09:00 am", content: "School time", image: UIImage(systemName: "studentdesk"), leftType: .spot, rightType: .spot),
TimelineItem(title: "08:30 am", content: "Mary wakes up", image: UIImage(named: "star"), leftType: .line, rightType: .start),
TimelineItem(title: "09:00 am", content: "School time", image: UIImage(named: "school"), leftType: .spot, rightType: .spot),
TimelineItem(title: "09:00 am - 12:00pm", content: "Many lessons\nMath\nEnglish\netc...", leftType: .line, rightType: .line),
TimelineItem(title: "12:05 pm", content: "Lunch together", image: UIImage(systemName: "fork.knife"), leftType: .spot, rightType: .spot),
TimelineItem(title: "01:00 pm", content: "Outdoor activities, play games in sports court.", image: UIImage(systemName: "sportscourt"), leftType: .spot, rightType: .spot),
TimelineItem(title: "12:05 pm", content: "Lunch together", image: UIImage(named: "restaurant"), leftType: .spot, rightType: .spot),
TimelineItem(title: "01:00 pm", content: "Outdoor activities, play games in sports court.", image: UIImage(named: "sports_basketball"), leftType: .spot, rightType: .spot),

TimelineItem(title: "until 03:00 pm", content: "Afternoon lesson", leftType: .line, rightType: .line),
TimelineItem(title: "03:00 pm", content: "Free time", leftType: .spot, rightType: .spot),
Expand All @@ -27,11 +27,11 @@ class TimelineTableViewController: UITableViewController {
TimelineItem(title: "04:00 pm", content: "Play in playground", leftType: .none, rightType: .spot),
TimelineItem(title: "04:15 pm", content: "Wake up from nap", leftType: .start, rightType: .line),
TimelineItem(title: "05:00 pm", content: "Play TV games", leftType: .spot, rightType: .line),
TimelineItem(title: "07:00 pm", content: "Dinner", image: UIImage(systemName: "fork.knife"), leftType: .line, rightType: .spot),
TimelineItem(title: "08:00 pm", content: "Dinner", image: UIImage(systemName: "fork.knife"), leftType: .spot, rightType: .line),
TimelineItem(title: "10:00 pm", content: "Goto sleep", image: UIImage(systemName: "bed.double"), leftType: .line, rightType: .end),
TimelineItem(title: "10:30 pm", content: "Goto sleep", image: UIImage(systemName: "bed.double.fill"), leftType: .end, rightType: .none),
TimelineItem(title: "Awesome", content: "That's all for the day", image: UIImage(systemName: "sparkles")),]
TimelineItem(title: "07:00 pm", content: "Dinner", image: UIImage(named: "restaurant"), leftType: .line, rightType: .spot),
TimelineItem(title: "08:00 pm", content: "Dinner", image: UIImage(named: "restaurant"), leftType: .spot, rightType: .line),
TimelineItem(title: "10:00 pm", content: "Goto sleep", image: UIImage(named: "bed"), leftType: .line, rightType: .end),
TimelineItem(title: "10:30 pm", content: "Goto sleep", image: UIImage(named: "single_bed"), leftType: .end, rightType: .none),
TimelineItem(title: "Awesome", content: "That's all for the day", image: UIImage(named: "auto_awesome")),]

override func viewDidLoad() {
super.viewDidLoad()
Expand All @@ -41,6 +41,18 @@ class TimelineTableViewController: UITableViewController {

let timelineRight = LineStyle(lineColor: .red)
timelineStyle = TimelineStyle(rightLineStyle: timelineRight)

let container = UIView()
let rect = UIView()

container.addSubview(rect)
container.frame = CGRect(x: 0, y: 0, width: 500, height: 500)
rect.frame = CGRect(x: 0, y: 0, width: 50, height: 50)
print(rect.frame)
print(rect.bounds)
rect.transform = CGAffineTransform(scaleX: 2, y: 2)
print(rect.frame)
print(rect.bounds)
}

// MARK: - Table view data source
Expand Down Expand Up @@ -78,7 +90,7 @@ class TimelineTableViewController: UITableViewController {
}

cell.setCell(item: timelineItem, style: timelineStyle)

return cell
}

Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ let excludedFiles = [
let package = Package(
name: packageName,
platforms: [
.iOS(.v13)
.iOS(.v11)
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
Expand Down

0 comments on commit 69a227b

Please sign in to comment.