Skip to content

Instantly share code, notes, and snippets.

View cmlcrn17's full-sized avatar
🤓
Impatient

Ceren cmlcrn17

🤓
Impatient
View GitHub Profile
Image(uiImage: generateQRCode(from: "\(name)\n\(emailAddress)"))
.interpolation(.none) //netlik sağlar
.resizable()
.scaledToFit()
.frame(width: 200, height: 200)
Button(action: {
self.isShowingScanner = true
}) {
Text("Show Scanner")
}.padding()
.sheet(isPresented: $isShowingScanner) {
CodeScannerView(codeTypes: [.qr], simulatedData: "Some simulated data", completion: self.handleScan)
}
if(txt_TCNumber == ""){
self.activeAlert = .tc
self.showAlert = true
return
}
enum ActiveAlert {
case tc, parola, dogrulama, basarili
}
.alert(isPresented: $showAlert) {
switch activeAlert {
case .tc:
return Alert(title: Text("TC Kimlik"), message: Text("TC Kimlik Numaranızı girmediniz."))
case .parola:
return Alert(title: Text("Parola"), message: Text("Parola girmediniz."))
case .dogrulama:
return Alert(title: Text("Doğrulama"), message: Text("Doğrulama yapmadınız."))
case .basarili:
return Alert(title: Text("Başarılı"), message: Text("Tüm kontroller başarılıdır."))
struct ContentView: View {
@State private var showingAlert = false
var body: some View {
Button(action: {
self.showingAlert = true
}) {
Text("Show Alert")
}
.alert(isPresented: $showingAlert) {
///Bugünki adım sayısını getir methodu
func getStepCountToday(){
self.getStepsCount(forSpecificDate: Date()) { (steps) in
if steps == 0.0 {
self.stepValue_Today = Int(steps)
print("steps :: \(steps)")
}
else {
DispatchQueue.main.async {
///HealthKit İzni
func getHealthKitPermission() {
// delay(0.1) {
guard HKHealthStore.isHealthDataAvailable() else {
return
}
let stepsCount = HKObjectType.quantityType(forIdentifier: HKQuantityTypeIdentifier.stepCount)!
self.healthkitStore.requestAuthorization(toShare: [], read: [stepsCount]) { (success, error) in
.navigationBarItems(leading:
Button(action: {
UIApplication.shared.open(URL(string: "https://www.google.com")!)
}) {
Text("Google")
.font(.custom("SanFranciscoText-Light", size: 15))
.bold()
.foregroundColor(.yellow)
},