Skip to content

Commit 744fb25

Browse files
committedMar 22, 2023
change file structure, update ring ups
1 parent c4b5ef7 commit 744fb25

22 files changed

+209
-196
lines changed
 

‎README.md

+48-9
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,70 @@ A collection of Swift, SwiftUI and iOS goodies.
44

55
## What we have hare!
66

7-
### Custom Font
7+
### Jailbroken checker
88

9-
Add fonts to the [project](https://github.com/ImaginativeShohag/Why-Not-SwiftUI/tree/main/Why%20Not%20SwiftUI/Resources/Fonts), add the fonts name to the [plist](https://github.com/ImaginativeShohag/Why-Not-SwiftUI/blob/main/Why-Not-SwiftUI-Info.plist) file. Finally, use [`fontStyle(size:weight:)`](https://github.com/ImaginativeShohag/Why-Not-SwiftUI/blob/main/Why%20Not%20SwiftUI/Utils/Typography.swift) to set fonts.
10-
11-
<img src="images/typography.png" height=450>
9+
Check for device is jail-broken status.
1210

13-
### MetricKit crash report example
11+
<img src="images/jailbroken-checker.png" width=250/>
1412

1513
### Notification
1614

15+
Example for showing local notifications.
16+
17+
<img src="images/sample-notification.png" width=250>
18+
19+
### Accessibility Example
20+
21+
Example of common accessibility modifiers.
22+
23+
### Bottom Nav vs Side Bar
24+
25+
A simple example to demonstrate separate views for iPhone and iPad. Users will see the bottom nav on iPhone and Sidebar on iPad.
26+
27+
| <img src="images/bottom-nav.png" width=165/> | <img src="images/side-bar.png" width=250/> |
28+
| :--: | :--: |
29+
30+
### Component: `CoolProgress`
31+
32+
<img src="images/cool-progress.gif" width=250>
33+
1734
### Component: `CoolToast`
1835

19-
An cool Android Toast like implementation for SwiftUI.
36+
A cool "Android Toast" like implementation for SwiftUI.
37+
38+
<img src="images/cool-toast.gif" width=250>
39+
40+
### `ImageViewCapturer` Example
41+
42+
43+
44+
### Component: `LabelToggle`
45+
46+
A custom Toggle like component with inside label support.
47+
48+
<img src="images/label-toggle.gif" width=250/>
49+
50+
### MetricKit crash report example
51+
52+
On going...
2053

2154
### Component: `NativeAlert`
2255

2356
SwiftUI modifier for `UIAlertController`. This is created to be able to change the Alert button colors.
2457

58+
<img src="images/native-alert.gif" width=250>
59+
60+
### `RingChart`
61+
62+
2563
### `TextField` validation
2664

27-
### Accessibility Example
65+
### Typography: Custom Font
2866

29-
### Component: `LabelToggle`
67+
Add fonts to the [project](https://github.com/ImaginativeShohag/Why-Not-SwiftUI/tree/main/Why%20Not%20SwiftUI/Resources/Fonts), add the fonts name to the [plist](https://github.com/ImaginativeShohag/Why-Not-SwiftUI/blob/main/Why-Not-SwiftUI-Info.plist) file. Finally, use [`fontStyle(size:weight:)`](https://github.com/ImaginativeShohag/Why-Not-SwiftUI/blob/main/Why%20Not%20SwiftUI/Utils/Typography.swift) to set fonts.
68+
69+
<img src="images/typography.png" width=250/>
3070

31-
A custom Toggle like component with inside label support.
3271

3372
## TODO
3473

‎Why Not SwiftUI.xcodeproj/project.pbxproj

+30-46
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@
4646
459837D628EB4B7100AB5433 /* Fruit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 459837D528EB4B7100AB5433 /* Fruit.swift */; };
4747
459837D928EB5C1400AB5433 /* ImageVideoCapturerExampleScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 459837D828EB5C1400AB5433 /* ImageVideoCapturerExampleScreen.swift */; };
4848
459837DB28EB5C3D00AB5433 /* ImageVideoCapturer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 459837DA28EB5C3D00AB5433 /* ImageVideoCapturer.swift */; };
49-
459CA62728E702D400FC6F42 /* FitnessRingCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 459CA62628E702D400FC6F42 /* FitnessRingCardView.swift */; };
49+
459CA62728E702D400FC6F42 /* FitnessRingCardScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 459CA62628E702D400FC6F42 /* FitnessRingCardScreen.swift */; };
5050
459CA62B28E70E2B00FC6F42 /* Typography.swift in Sources */ = {isa = PBXBuildFile; fileRef = 459CA62A28E70E2B00FC6F42 /* Typography.swift */; };
51-
459CA63028E70F2700FC6F42 /* OverviewRingCardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 459CA62F28E70F2700FC6F42 /* OverviewRingCardView.swift */; };
51+
459CA63028E70F2700FC6F42 /* OverviewRingCardScreen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 459CA62F28E70F2700FC6F42 /* OverviewRingCardScreen.swift */; };
5252
459CA63328E70F5600FC6F42 /* RingChart.swift in Sources */ = {isa = PBXBuildFile; fileRef = 459CA63228E70F5600FC6F42 /* RingChart.swift */; };
5353
459CA63A28E76EAA00FC6F42 /* RingChartRing.swift in Sources */ = {isa = PBXBuildFile; fileRef = 459CA63928E76EAA00FC6F42 /* RingChartRing.swift */; };
5454
459EC10A2900561D0019C555 /* TrackingService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 459EC1092900561D0019C555 /* TrackingService.swift */; };
@@ -152,9 +152,9 @@
152152
459837D828EB5C1400AB5433 /* ImageVideoCapturerExampleScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageVideoCapturerExampleScreen.swift; sourceTree = "<group>"; };
153153
459837DA28EB5C3D00AB5433 /* ImageVideoCapturer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageVideoCapturer.swift; sourceTree = "<group>"; };
154154
459837DC28EB614700AB5433 /* Why-Not-SwiftUI-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "Why-Not-SwiftUI-Info.plist"; sourceTree = SOURCE_ROOT; };
155-
459CA62628E702D400FC6F42 /* FitnessRingCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FitnessRingCardView.swift; sourceTree = "<group>"; };
155+
459CA62628E702D400FC6F42 /* FitnessRingCardScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FitnessRingCardScreen.swift; sourceTree = "<group>"; };
156156
459CA62A28E70E2B00FC6F42 /* Typography.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Typography.swift; sourceTree = "<group>"; };
157-
459CA62F28E70F2700FC6F42 /* OverviewRingCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OverviewRingCardView.swift; sourceTree = "<group>"; };
157+
459CA62F28E70F2700FC6F42 /* OverviewRingCardScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OverviewRingCardScreen.swift; sourceTree = "<group>"; };
158158
459CA63228E70F5600FC6F42 /* RingChart.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RingChart.swift; sourceTree = "<group>"; };
159159
459CA63928E76EAA00FC6F42 /* RingChartRing.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RingChartRing.swift; sourceTree = "<group>"; };
160160
459EC1092900561D0019C555 /* TrackingService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrackingService.swift; sourceTree = "<group>"; };
@@ -212,19 +212,18 @@
212212
454539F0298130EE00E3D9D0 /* TextFieldValidation */ = {
213213
isa = PBXGroup;
214214
children = (
215-
45513A8E29911BFE00BF0A0D /* Components */,
216215
454539F12981310500E3D9D0 /* TextFieldValidationScreen.swift */,
217216
454539F329813F7200E3D9D0 /* TextFieldValidationViewModel.swift */,
218217
);
219218
path = TextFieldValidation;
220219
sourceTree = "<group>";
221220
};
222-
45513A8E29911BFE00BF0A0D /* Components */ = {
221+
45513A8E29911BFE00BF0A0D /* CustomTextField */ = {
223222
isa = PBXGroup;
224223
children = (
225224
45513A8F29911C1E00BF0A0D /* CustomTextFieldView.swift */,
226225
);
227-
path = Components;
226+
path = CustomTextField;
228227
sourceTree = "<group>";
229228
};
230229
45513A972998F1BD00BF0A0D /* TextPreview */ = {
@@ -246,20 +245,11 @@
246245
4557C0F029C4B05D0030530B /* LabelToggle */ = {
247246
isa = PBXGroup;
248247
children = (
249-
4557C0F129C4B0790030530B /* Components */,
250248
4557C0F529C4B0AF0030530B /* LabelToggleScreen.swift */,
251249
);
252250
path = LabelToggle;
253251
sourceTree = "<group>";
254252
};
255-
4557C0F129C4B0790030530B /* Components */ = {
256-
isa = PBXGroup;
257-
children = (
258-
4557C0F229C4B0900030530B /* LabelToggle */,
259-
);
260-
path = Components;
261-
sourceTree = "<group>";
262-
};
263253
4557C0F229C4B0900030530B /* LabelToggle */ = {
264254
isa = PBXGroup;
265255
children = (
@@ -384,21 +374,12 @@
384374
459CA62228E6FA7B00FC6F42 /* Chart */ = {
385375
isa = PBXGroup;
386376
children = (
387-
459CA62528E7028F00FC6F42 /* View */,
377+
459CA62628E702D400FC6F42 /* FitnessRingCardScreen.swift */,
378+
459CA62F28E70F2700FC6F42 /* OverviewRingCardScreen.swift */,
388379
);
389380
path = Chart;
390381
sourceTree = "<group>";
391382
};
392-
459CA62528E7028F00FC6F42 /* View */ = {
393-
isa = PBXGroup;
394-
children = (
395-
459CA63128E70F4100FC6F42 /* Components */,
396-
459CA62628E702D400FC6F42 /* FitnessRingCardView.swift */,
397-
459CA62F28E70F2700FC6F42 /* OverviewRingCardView.swift */,
398-
);
399-
path = View;
400-
sourceTree = "<group>";
401-
};
402383
459CA62828E703EC00FC6F42 /* UIs */ = {
403384
isa = PBXGroup;
404385
children = (
@@ -469,14 +450,6 @@
469450
path = Catalogs;
470451
sourceTree = "<group>";
471452
};
472-
459CA63128E70F4100FC6F42 /* Components */ = {
473-
isa = PBXGroup;
474-
children = (
475-
459CA63728E76E6A00FC6F42 /* RingChart */,
476-
);
477-
path = Components;
478-
sourceTree = "<group>";
479-
};
480453
459CA63728E76E6A00FC6F42 /* RingChart */ = {
481454
isa = PBXGroup;
482455
children = (
@@ -536,6 +509,7 @@
536509
459837D428EB4B5F00AB5433 /* Model */,
537510
459CA62C28E70E4500FC6F42 /* Resources */,
538511
459CA62928E7040700FC6F42 /* Utils */,
512+
45CD36A829CBA48B00DB24BD /* Components */,
539513
459CA62828E703EC00FC6F42 /* UIs */,
540514
45BE892328A06CEC008DF51F /* Network */,
541515
45BE891228A05F73008DF51F /* Why_Not_SwiftUIApp.swift */,
@@ -562,55 +536,65 @@
562536
path = Network;
563537
sourceTree = "<group>";
564538
};
539+
45CD36A829CBA48B00DB24BD /* Components */ = {
540+
isa = PBXGroup;
541+
children = (
542+
45F1C99F29709B8500386645 /* CoolProgress */,
543+
45F1C98D296F126900386645 /* CoolToast */,
544+
45513A8E29911BFE00BF0A0D /* CustomTextField */,
545+
4557C0F229C4B0900030530B /* LabelToggle */,
546+
45F1C99B297098E700386645 /* NativeAlert */,
547+
459CA63728E76E6A00FC6F42 /* RingChart */,
548+
);
549+
path = Components;
550+
sourceTree = "<group>";
551+
};
565552
45F1C98C296F123400386645 /* CoolToast */ = {
566553
isa = PBXGroup;
567554
children = (
568-
45F1C98D296F126900386645 /* Component */,
569555
45F1C990296F129900386645 /* CoolToastScreen.swift */,
570556
);
571557
path = CoolToast;
572558
sourceTree = "<group>";
573559
};
574-
45F1C98D296F126900386645 /* Component */ = {
560+
45F1C98D296F126900386645 /* CoolToast */ = {
575561
isa = PBXGroup;
576562
children = (
577563
45F1C98E296F128C00386645 /* CoolToast.swift */,
578564
);
579-
path = Component;
565+
path = CoolToast;
580566
sourceTree = "<group>";
581567
};
582568
45F1C998297098A700386645 /* NativeAlert */ = {
583569
isa = PBXGroup;
584570
children = (
585-
45F1C99B297098E700386645 /* Component */,
586571
45F1C99C2970991200386645 /* NativeAlertScreen.swift */,
587572
);
588573
path = NativeAlert;
589574
sourceTree = "<group>";
590575
};
591-
45F1C99B297098E700386645 /* Component */ = {
576+
45F1C99B297098E700386645 /* NativeAlert */ = {
592577
isa = PBXGroup;
593578
children = (
594579
45F1C999297098C000386645 /* NativeAlert.swift */,
595580
);
596-
path = Component;
581+
path = NativeAlert;
597582
sourceTree = "<group>";
598583
};
599584
45F1C99E29709B7600386645 /* CoolProgressView */ = {
600585
isa = PBXGroup;
601586
children = (
602-
45F1C99F29709B8500386645 /* Component */,
603587
45F1C9A229709BB200386645 /* CoolProgressScreen.swift */,
604588
);
605589
path = CoolProgressView;
606590
sourceTree = "<group>";
607591
};
608-
45F1C99F29709B8500386645 /* Component */ = {
592+
45F1C99F29709B8500386645 /* CoolProgress */ = {
609593
isa = PBXGroup;
610594
children = (
611595
45F1C9A029709B9A00386645 /* CoolProgressView.swift */,
612596
);
613-
path = Component;
597+
path = CoolProgress;
614598
sourceTree = "<group>";
615599
};
616600
/* End PBXGroup section */
@@ -753,7 +737,7 @@
753737
45F1C993296F13D000386645 /* Color+.swift in Sources */,
754738
457B0ADC28FB70730019ED01 /* MenuRow.swift in Sources */,
755739
45BE892528A06D24008DF51F /* GoRestAPI.swift in Sources */,
756-
459CA62728E702D400FC6F42 /* FitnessRingCardView.swift in Sources */,
740+
459CA62728E702D400FC6F42 /* FitnessRingCardScreen.swift in Sources */,
757741
4557C0F629C4B0AF0030530B /* LabelToggleScreen.swift in Sources */,
758742
459837D928EB5C1400AB5433 /* ImageVideoCapturerExampleScreen.swift in Sources */,
759743
45513A9229911EEA00BF0A0D /* String+.swift in Sources */,
@@ -784,7 +768,7 @@
784768
458E623C28EC6D75005A4E54 /* HomeScreen.swift in Sources */,
785769
454539F429813F7200E3D9D0 /* TextFieldValidationViewModel.swift in Sources */,
786770
459837D228EB361D00AB5433 /* #001 KeyPath class.swift in Sources */,
787-
459CA63028E70F2700FC6F42 /* OverviewRingCardView.swift in Sources */,
771+
459CA63028E70F2700FC6F42 /* OverviewRingCardScreen.swift in Sources */,
788772
457B0ADE28FB73DB0019ED01 /* ExtUIApplicatin.swift in Sources */,
789773
4568D1B228F8992C00FFDC5E /* ColorScreen.swift in Sources */,
790774
4568D1A828F8951A00FFDC5E /* SplashScreen.swift in Sources */,

‎Why Not SwiftUI/UIs/TextFieldValidation/Components/CustomTextFieldView.swift renamed to ‎Why Not SwiftUI/Components/CustomTextField/CustomTextFieldView.swift

+3-2
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,15 @@ struct CustomTextFieldView_Previews: PreviewProvider {
9494
CustomTextFieldView(
9595
value: .constant("Mahmudul Hasan Shohag"),
9696
placeHolder: "Full Name",
97-
keyboardType: .namePhonePad
97+
keyboardType: .default
9898
)
9999

100100
CustomTextFieldView(
101101
value: .constant(" "),
102102
placeHolder: "Full Name",
103-
keyboardType: .phonePad
103+
keyboardType: .default
104104
)
105105
}
106+
.padding()
106107
}
107108
}

‎Why Not SwiftUI/Model/Screen.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ struct Screen: Identifiable {
1212

1313
static let screens: [Screen] = [
1414
Screen(name: "Typography", showTitle: true, destination: AnyView(TextPreviewScreen())),
15-
Screen(name: "Overview Ring Chart", showTitle: true, destination: AnyView(OverviewRingCardView())),
16-
Screen(name: "Fitness Ring Chart", showTitle: true, destination: AnyView(FitnessRingCardView())),
15+
Screen(name: "Ring Chart: Overview", showTitle: true, destination: AnyView(OverviewRingCardScreen())),
16+
Screen(name: "Ring Chart: Fitness", showTitle: true, destination: AnyView(FitnessRingCardScreen())),
1717
Screen(name: "ImageViewCapturer Example", showTitle: true, destination: AnyView(ImageVideoCapturerExampleScreen())),
1818
Screen(name: "BottomNav vs SideBar", showTitle: false, destination: AnyView(BottomNavVsSideBarScreen())),
1919
Screen(name: "MetricKit", showTitle: true, destination: AnyView(MetricKitScreen())),

‎Why Not SwiftUI/UIs/BottomNavVsSideBar/BottomNavVsSideBarScreen.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ struct BottomNavVsSideBarScreen_Previews: PreviewProvider {
3232
.previewDevice("iPhone 14 Pro Max")
3333

3434
BottomNavVsSideBarScreen()
35-
.previewDevice("iPad Pro (11-inch) (3rd generation)")
35+
.previewDevice("iPad Pro (11-inch) (4th generation)")
3636
}
3737
}

0 commit comments

Comments
 (0)