Post

Replies

Boosts

Views

Activity

Reply to Launch argument "-AppleLocale en_US" doesn't change measurement system(units) to "US" on MacOs
This link comes on top when searching for AppleMetricUnits https://opensource.apple.com/source/CF/CF-855.17/CFLocale.c.auto.html CFTypeRef pref = CFDictionaryGetValue(locale-_prefs, CFSTR("AppleMetricUnits")); if (pref) { us = (kCFBooleanFalse == pref); done = true; } else { pref = CFDictionaryGetValue(locale-_prefs, CFSTR("AppleMeasurementUnits")); if (pref) { us = CFEqual(pref, CFSTR("Inches")); done = true; } } and it seems the code is expecting boolean value for AppleMetricUnits key. How is false/ which seems XML becomes a boolean? What is the correct way to pass booleans as launch arguments?
May ’21
Reply to ScrollView shrink to fit
we are using solution proposed here: https://github.com/onmyway133/blog/issues/769#issue-802788982 import SwiftUI struct HSearchBar: View { @State private var scrollViewContentSize: CGSize = .zero var body: some View { HStack { searchButton ScrollView(.horizontal, showsIndicators: false) { HStack(spacing: 12) { ForEach(store.collections) { collection in collectionCell(collection) } } .background( GeometryReader { geo -> Color in DispatchQueue.main.async { scrollViewContentSize = geo.size } return Color.clear } ) } .frame( maxWidth: scrollViewContentSize.width ) } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’21
Reply to Launch argument "-AppleLocale en_US" doesn't change measurement system(units) to "US" on MacOs
This link comes on top when searching for AppleMetricUnits https://opensource.apple.com/source/CF/CF-855.17/CFLocale.c.auto.html CFTypeRef pref = CFDictionaryGetValue(locale-_prefs, CFSTR("AppleMetricUnits")); if (pref) { us = (kCFBooleanFalse == pref); done = true; } else { pref = CFDictionaryGetValue(locale-_prefs, CFSTR("AppleMeasurementUnits")); if (pref) { us = CFEqual(pref, CFSTR("Inches")); done = true; } } and it seems the code is expecting boolean value for AppleMetricUnits key. How is false/ which seems XML becomes a boolean? What is the correct way to pass booleans as launch arguments?
Replies
Boosts
Views
Activity
May ’21
Reply to Launch argument "-AppleLocale en_US" doesn't change measurement system(units) to "US" on MacOs
This is very useful for testing: -AppleLocale en_US -AppleMetricUnits false/ -AppleMeasurementUnits Inches @eskimo, where we can find documentation about this and other useful flags and launch arguments?
Replies
Boosts
Views
Activity
May ’21
Reply to ScrollView shrink to fit
we are using solution proposed here: https://github.com/onmyway133/blog/issues/769#issue-802788982 import SwiftUI struct HSearchBar: View { @State private var scrollViewContentSize: CGSize = .zero var body: some View { HStack { searchButton ScrollView(.horizontal, showsIndicators: false) { HStack(spacing: 12) { ForEach(store.collections) { collection in collectionCell(collection) } } .background( GeometryReader { geo -> Color in DispatchQueue.main.async { scrollViewContentSize = geo.size } return Color.clear } ) } .frame( maxWidth: scrollViewContentSize.width ) } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’21