Modifying gitignore to ignore xcuserdata
Minor changes to adddress comments
This commit is contained in:
Родитель
ddf05e911b
Коммит
b339e1f40e
|
@ -3,6 +3,9 @@
|
|||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
# Xcode
|
||||
xcuserdata/
|
||||
|
||||
# User-specific files
|
||||
*.rsuser
|
||||
*.suo
|
||||
|
@ -348,3 +351,4 @@ MigrationBackup/
|
|||
|
||||
# Ionide (cross platform F# VS Code tools) working folder
|
||||
.ionide/
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
[[_TOC_]]
|
||||
# iOS Image File Format
|
||||
|
||||
Image assets officially support multiple file formats including PNG, PDF and SVG. The recommended image file format for iOS images is SVG images with "Preserve Vector Data" option disabled in Xcode. There's no significant difference in size or performance between PDF and SVG images when "Preserve Vector Data" option is disabled, but SVG images are easier share across all platforms.
|
||||
Image assets officially support multiple file formats including PNG, PDF and SVG. The recommended image file format for iOS images is SVG images with "Preserve Vector Data" option disabled in Xcode. There's no significant difference in size or performance between PDF and SVG images when "Preserve Vector Data" option is disabled, but SVG images are easier to share with Android and web.
|
||||
|
||||
## Vector based image file format Overview
|
||||
When a single scale PDF or SVG image with "Preserve Vector Data" option disabled is used for an imageset, Xcode generates corresponding @1x, @2x, or @3x PNG images depending on the build target at build time. At runtime, the application loads the PNG image from the app bundle, so the runtime behavior is the same as if PNG images are provided for the imageset.
|
||||
|
@ -10,7 +10,7 @@ When a single scale PDF or SVG image with "Preserve Vector Data" option enabled
|
|||
|
||||
Stretching an image is not supported or necessary in most scenarios such as displayed within a button; however, in the rare cases when an image needs to fill a variable size such as the entire screen, streching an image is indeed necessary.
|
||||
|
||||
## Bundle Size Impact
|
||||
## App Size Impact
|
||||
When vector data is disabled, the bundle size difference between PDF and SVG graphics is very trivial. However, there is a significant application bundle size increase when "Preserve Vector Data" option is enabled; PDFs have a bigger size increase than SVGs. The following bundle sizes are collected by using the asset catalog compiling tool directly on generated PDF and SVG imagesets from [Fluent icons repo](https://github.com/microsoft/fluentui-system-icons). There are 7702 imagesets in total at the time of the size analysis.
|
||||
|
||||
| Image Type | Assets.car Size (no vector data preserved) | Assets.car Size (vector data preserved) | Delta |
|
||||
|
@ -25,8 +25,8 @@ There's no measurable runtime performance difference between "Preserve Vector Da
|
|||
|
||||
| | PDF w/o vector data preserved | SVG w/o vector data preserved | PDF with vector data preserved | SVG with vector data preserved |
|
||||
|--|--|--|--|--|
|
||||
| Intrinsic Size | 233 | 233.6 | 235.3 | 233.3 |
|
||||
| Stretched | 101.3 | 102.6 | 433.3 | 402.7 |
|
||||
| Intrinsic Size (ms) | 233 | 233.6 | 235.3 | 233.3 |
|
||||
| Stretched (ms) | 101.3 | 102.6 | 433.3 | 402.7 |
|
||||
|
||||
### Methodology
|
||||
The time profiling was done on a physical device with Xcode Instruments' Time Profiler tool measuring the time it takes for `CA::Transaction::Commit()` to complete after initiating the drawing of 1000 images.
|
||||
|
|
Двоичный файл не отображается.
Двоичный файл не отображается.
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Bucket
|
||||
uuid = "2F74C6B4-F951-4BEE-B626-B7046958F7F7"
|
||||
type = "0"
|
||||
version = "2.0">
|
||||
</Bucket>
|
Двоичный файл не отображается.
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Bucket
|
||||
uuid = "9CF5CDEF-147C-4C0B-88B7-311AD4190847"
|
||||
type = "0"
|
||||
version = "2.0">
|
||||
</Bucket>
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Bucket
|
||||
uuid = "F5892F54-7E76-45FF-B8B3-AC8397E7A00C"
|
||||
type = "1"
|
||||
version = "2.0">
|
||||
</Bucket>
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>test.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>SuppressBuildableAutocreation</key>
|
||||
<dict>
|
||||
<key>00E3682222E12EF700E37F8E</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>test.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>test.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
|
@ -1,42 +1,12 @@
|
|||
//
|
||||
// Copyright © 2021 Microsoft. All rights reserved.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||
// Override point for customization after application launch.
|
||||
return true
|
||||
}
|
||||
|
||||
func applicationWillResignActive(_ application: UIApplication) {
|
||||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
|
||||
}
|
||||
|
||||
func applicationDidEnterBackground(_ application: UIApplication) {
|
||||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
}
|
||||
|
||||
func applicationWillEnterForeground(_ application: UIApplication) {
|
||||
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
|
||||
}
|
||||
|
||||
func applicationDidBecomeActive(_ application: UIApplication) {
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ application: UIApplication) {
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
//
|
||||
// Copyright © 2021 Microsoft. All rights reserved.
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
@ -8,9 +9,6 @@ class ResettableView: UIView {
|
|||
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
|
||||
super.touchesEnded(touches, with: event)
|
||||
subviews.forEach { $0.removeFromSuperview() }
|
||||
setNeedsLayout()
|
||||
setNeedsDisplay()
|
||||
layoutIfNeeded()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,9 +17,9 @@ class ViewController: UIViewController {
|
|||
var imagesContainerView = ResettableView()
|
||||
let stretchingSwitch = UISwitch()
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
override func loadView() {
|
||||
super.loadView()
|
||||
|
||||
let pngButton = UIButton(frame: .zero)
|
||||
pngButton.setTitle("Draw PNG Images", for: .normal)
|
||||
pngButton.addTarget(self, action: #selector(pressedPngImages(_:)), for: .touchUpInside)
|
||||
|
@ -69,7 +67,8 @@ class ViewController: UIViewController {
|
|||
|
||||
@objc func pressedPngImages(_ sender: Any) {
|
||||
let collection = imageViews(shouldStretch: stretchingSwitch.isOn, imageName: "Image")
|
||||
addCollectionToViewHierarchy(collection: collection) }
|
||||
addCollectionToViewHierarchy(collection: collection)
|
||||
}
|
||||
|
||||
@objc func pressedVectorImages(_ sender: Any) {
|
||||
let collection = imageViews(shouldStretch: stretchingSwitch.isOn, imageName: "ImageVector")
|
||||
|
@ -78,7 +77,8 @@ class ViewController: UIViewController {
|
|||
|
||||
@objc func pressedSVGPngImages(_ sender: Any) {
|
||||
let collection = imageViews(shouldStretch: stretchingSwitch.isOn, imageName: "SVGImage")
|
||||
addCollectionToViewHierarchy(collection: collection) }
|
||||
addCollectionToViewHierarchy(collection: collection)
|
||||
}
|
||||
|
||||
@objc func pressedSVGVectorImages(_ sender: Any) {
|
||||
let collection = imageViews(shouldStretch: stretchingSwitch.isOn, imageName: "SVGImageVector")
|
||||
|
@ -115,10 +115,10 @@ class ViewController: UIViewController {
|
|||
rowStack.append(UIStackView(arrangedSubviews: images))
|
||||
}
|
||||
|
||||
let collection = UIStackView(arrangedSubviews: rowStack)
|
||||
collection.axis = .vertical
|
||||
let imageViews = UIStackView(arrangedSubviews: rowStack)
|
||||
imageViews.axis = .vertical
|
||||
|
||||
return collection
|
||||
return imageViews
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче