I read the vague guidance in the HIG (https://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/custom-icons/) on making a "glyph". I've tried Pixelmator, Graphic, and Sketch to make all grayscale on transparent PNGs, SVGs, and PDFs. I still cannot make an asset that is tintable when I use it in a TabView tabItem Image.
If I use an SF Symbols image (systemName) then I get a tintable icon. The technical guidance in the HIG is too vague. What is "monochomatic" here? 1-bit color? Grayscale? "Uses a mask to define its shape" is also vague. Do they mean an alpha channel? An alpha mask?
I don't have Photoshop or Illustrator, so if someone can give me some clear technical guidance relevant to one of the tools I do have that'd be appreciated.
Post
Replies
Boosts
Views
Activity
I have a master-detail app with a Picker control in the detail for editing a field. After picking the form cell for the picker is gray. This only happens when I use StackNavigationViewStyle: remove that and the cell reverts to normal white.
Is is a bug or my mistake? I am using Xcode 12.1, targeting iOS 14.0, building on macOS 10.15.7.
Here's some sample code.
ContentView is:
@State private var boys = ["Arthur", "Cedric"]
var body: some View {
NavigationView {
List {
ForEach(boys, id: \.self) { boy in
NavigationLink(
destination: EditBoyView(boy: boy),
label: {
Text(boy)
})
}
}
.navigationBarTitle("Boys")
}
.navigationViewStyle(StackNavigationViewStyle())
}
}
and the EditBoyView is:
public var boy: String
@State private var name: String = ""
static var boyNames = ["Arthur", "Bill", "Cedric", "Dean"]
var body: some View {
Form {
Picker("Name", selection: $name) {
ForEach(Self.boyNames, id: \.self) { choice in
Text(choice)
}
}
}
.navigationBarTitle(boy, displayMode: .inline)
.onAppear {
if name == "" { name = boy }
}
}
}
If you comment out line 15 of the ContentView then the picker cell is white.
If a file is moved to the Trash then a class implementing FilePresenter will have presentedSubitem(at:didMoveTo:) called. The didMoveTo string seems to follow this pattern:
file:///Users/<USER>/.Trash/<FILENAME>
Of course I can examine the path and look for a component .Trash, but this feels unreliable. Is there a better way?
I've got Yet Another Protocol Question. Sorry, folks.The Swift 5.1 manual describes creating a `Collection` where the `Element` is a simple protocol, but doesn't explain how to make a Collection where the Element is a protocol with an associatedtype. In my case it's a protocol `Playable` that requires conformance to `Identifiable`.I am fine with requiring the `Identifiable.ID` type to be `Int` for all types which adopt `Playable`, but I don't know how to express that qualification/requirement. The bits hit the fan when I try to declare something to be `[Playable]`.My playground code might make my question clear.protocol Playable: Identifiable
// DOESN'T WORK where ID: Int
{
// DOESN'T HELP associatedtype ID = Int
// DOESN'T HELP var id: Int { get }
func play()
}
struct Music: Playable {
var id: Int
func play() { print("playing music #\(id)") }
}
(Music(id: 1)).play() // displays: "playing music #1\n"
class Game: Playable {
var id: Int
init(id: Int) {
self.id = id
}
func play() { print("playing game #\(id)") }
}
(Game(id: 2)).play() // displays: "playing game #2\n"
enum Lottery: Int, Playable {
case state = 100
case church
case charity
var id: Int {
return self.rawValue
}
func play() { print("playing lottery \(self) #\(self.rawValue)") }
}
Lottery.church.play() // displays: "playing lottery church #101\n"
var stuff: [Playable] = [] // error: Protocol 'Playable' can only be used as a generic constraint because it has Self or associated type requirements
stuff.append(Music(id: 10))
stuff.append(Game(id: 24))
stuff.append(Lottery.charity)
stuff.map { $0.id }My goal is to have different structs and classes conforming to Playable (and hence to Identifiable) able to live inside a Collection.
in iOS 12, the default behaviour of Core Data is to create a sqlite database in Library/Application Support. The iOS Data Storage Guidelines tell us which direcotories are saved when a device is backed up or synced to iTunes, but it is silient about the Library and Library/Application Support folders.https://developer.apple.com/icloud/documentation/data-storage/index.html"1. Only documents and other data that is user-generated, or that cannot otherwise be recreated by your application, should be stored in the <Application_Home>/Documents directory and will be automatically backed up by iCloud."I'm storing user-generated content using Core Data and the default persistent store, SQLite. Do I need to do something to ensure the database is automatically backed up by iCloud? I hope that includes iTunes syncing/backup by wire too.
When developing a CloudKit application, the standard recommendation is to create an iCloud account for testing. That makes a lot of sense as I’d like to keep developing code far from my personal iCloud account. But the CloudKit Dashboard won’t let me view the private database for that account. What do other people do to check their work?* clarification: I mean on the development server, not the production server.