App Themes - Part 11 - Itinerary App (iOS, Xcode 9, Swift 4)
ฝัง
- เผยแพร่เมื่อ 8 ก.ย. 2024
- 🌐 www.bigmountai...
In this video you will learn how to create and use and app theme class to hold your app's theme. You will also learn how to add a custom font file to your project and how to assign a custom font to your labels through the theme class that you create.
Video on Theme Switching: • Theme Switching (iOS, ...
👉 Find out the Ugly Truth of SwiftUI: www.bigmountai...
Subscribe for more! 👉 bit.ly/bigmtnst...
FREE SwiftUI BOOKS:
📙 SwiftUI Views: www.bigmountai...
📗 SwiftUI Animations: www.bigmountai...
COURSES
🎦 Visual Swift Memory Mastery: www.bigmountainstudio.com/swift-memory
🎦 Getting Started With CollectionViews: www.pluralsigh...
HELP SUPPORT ME
✴️ Patreon - Access over 70 Projects: / bigmountainstudio
SOCIAL
🔵 Facebook: / bigmountainstudio
🔷 Twitter: / bigmtnstudio
🟣 Github: github.com/big...
#markmoeykens #bigmountainstudio #swift
Definitely interested in theme colour modes..!
Alright, Kishan, thanks for letting me know.
Kishan Vaghela
The same 👍🏻 I hope he’ll do it
the SAME!!!!
Great job Mark! Very thought out, quality content. Would love to see a video on theme switching.
Noted. Thank for let me know!
Thanks Mark! More Theme stuff please! Extremely useful for a designer working with developers to know.
You're welcome! There's this video too: th-cam.com/video/NQ-jfB1LAdg/w-d-xo.html
Not sure if you've already seen it or not.
Nice way of creating themes. I have used a similar approach, but only for colors. I have grouped color palettes into a struct. It's easy to tweak the colors if needed.
Oh yeah, good idea!
Thank you Mark!
interested to know more advanced theme switching options. Please make a video on this topic.
You are in luck because I did make a video on this here: th-cam.com/video/NQ-jfB1LAdg/w-d-xo.html
Great video! I'd be very interested to see this grow into a full theme, with the option to switch themes. Great way to add custom colors to an app, like you did in this video! Never seen it done that way anywhere else! Keep up the these amazing videos!
Sure thing! I did end up creating a video for theme switching: th-cam.com/video/NQ-jfB1LAdg/w-d-xo.html
Great Video. Few small notes.
1. I will prefer to have 2 structure inside Theme class
class Theme {
struct Colors{ ... }
struct Fonts{ ... }
}
2. Keep UIFont in Fonts structure instead of font name.
Yeah, I can see the benefit here, especially with a lot things in your theme. It's a good way of organizing!
As always!! Great content Mark!! Would also love to see the Theme switching!!
Ok, thanks for letting me know!
I would love to learn about the theme file ...wait! you did that already :-) Thanks for these videos!
Well, you're in luck because I did create a video for this!
th-cam.com/video/NQ-jfB1LAdg/w-d-xo.html
(Sorry for the delay. Just saw this unanswered comment!)
Simple and Beautiful, Thanks Mark.
You are welcome, Siva. Thanks for watching!
Hi, 15:57 view.backgroundColor line may work for you. But I need to use tableView.backgroundColor for it to work. Just to let you konw :D
Hey Mark! i just want to say thank you once again.
Thanks for writing to let me know, Jul. I always appreciate the comments. 😀
Really helpful ! Thank you Mark
You're welcome, Suhrab. Glad you liked the video. 😀
thank you for making this tutorial
You're welcome! 😃
You should do the dark mode theme switching. Would Like it.
OK, thanks for letting me know.
Awesome.. !!! ... you are great man...
Well thank you, Puspendu! 👍
Great work ❤️👏🏻👏🏻👍🏻
Thank you sir! ✊🏼
Thanks Mark! How can we disable color of the line between UITableView's cells?
Hi Ika, we're going to cover that later but I can just tell you here. That line is called the "Separator". If you want to get rid of the Separator between all cells then you can select the UITableView and in the Attributes Inspector set the Separator to "None". If you want to do it in code you can use this:
tableView.separatorStyle = UITableViewCellSeparatorStyle.none
Now if you want to get remove the Separator from ONLY the empty cells below your populated cells then it is kind of an odd solution. I drop a UIView right on the UITableView. Then I make the UIView's background color clear. Make the UIView any size you want. But that gets rid of the extra lines. This UIView is considered a "footer" now and will always appear after the last populated cell. But if it has a clear background color then no one will ever know it's there.
Can you explain how create UI from sketch to storyboard
12:56 for some reason in Xcode 10.2 I don't see this color option :( they may be removed. I needed to go to Edit -> Format -> Show Colors, then drag colors from there to the big square. They found a way to make our lives a bit harder, good for them.
Yeah, they totally removed it and I submitted a feature request to have them add it back. Looks like they still don't care. 😞
By the way, I really like the solution you came up with. 👍
Mark thanks), make theme changing within the app)
OK, noted!
can you provide sources code for reference purposes plz? send me link if possible...
Hi mark can you please provide link for theme switching video?
Hey Mark,
Thanks for this awesome video. I've been wanting to crate a theme and coming from the web world of .css files, this is great.
One question though; my font isn't changing to the non-default font. Any ideas why this might be the case even though I have followed your instructions?
check where did you out the file name in which info.plist it must be the plist of the main target not the tests
simpler and easier than using UIAppearance. I wonder if it makes any difference tho
Yeah, using UIAppearance has it's benefits too. You can change the style of a control on a global scale (throughout your whole app) without having to use extensions or a custom class. So if you want to change all controls everywhere, then use UIAppearance. But if you only want to change some controls, use any of the methods I mentioned in the video.
Mark Moeykens thank you!!
Hello I like to know how to use the test target In Xcode can you help me ?
I don’t know what I’m doing wrong but when I put anything into trips tableviewcell I keep getting error thread 1 fatal error unexpectedly found nil while unwrapping an optional value
friend Definitely interested in theme color changing mode
Well, you're in luck because I did create a video for this!
th-cam.com/video/NQ-jfB1LAdg/w-d-xo.html
How did you evaluate or choose your colors?
4:42 You are creating a lot of classes, and I understand why when you map them to MVC, but for Theme as pr this example could this be struct Theme?
The Theme could totally be a struct too. I'm trying to remember why I made it a class but you know what, I honestly can't remember why!
I ended up creating another video where I built this out more to accommodate theme switching if you want to check it out: th-cam.com/video/NQ-jfB1LAdg/w-d-xo.html
Hey @markmoeykens in xcode 10 i am not able select color from eye drop because there is no option to select the color for color set.
Yeah, that's one of downsides to Xcode 10! I hate that we can't use that anymore. I had submitted a feature request for them to add it back. Maybe we'll see it again in Xcode 11. 🤞
well thanks @@bigmtnstudio . i subscribed yo and love to see such videos from your end. I always wanted to learn to create a application with proper data modeling and architecture. thanks for your videos.
@@veereshkumbar6780, you're welcome! Just remember though, what you see here is how I would do it. There are many ways it can be done and through trying different things you might come up with your own way. So feel free to experiment! 👍🏼
Ya interested for theme switching video
Well, my friend, you are in luck! Because I did create it: th-cam.com/video/NQ-jfB1LAdg/w-d-xo.html
i need card view constraint
Colors from assets, are only supported after iOS 11+
Yes, that's correct.
This is how I use Theme to work with App_Colors and App_Fonts.
extension UIColor {
static var themePink: UIColor {
return UIColor(hexString: "#ff8f66”)
}
}
extension UIFont {
static func customFont(size: CGFloat) -> UIFont {
return UIFont(name: “CustomFontName”, size: size)!
}
}
Usage:
myView.backgroundColor = UIColor.themePink
myLabel.font = UIFont.customFont(size: 15)
Pretty simple.
Thanks for the awesome video and clear explanation :D
I just have one question if I may. Is the following doable. Can I get the asset folder that contains a theme from an API and use it in the application, like download it and save it in the files directory. Then load it in the app each time the applications runs at start time. I've already made something similar but it was a JSON file that I parse and manually get values from a dictionary. Will I be able to change to assets folder instead of the JSON file?
Oh man, I never thought of that before. To be honest I'm not even sure if you can or not! Might be a good question to post on stack overflow.
I will try to implement it and see what kind of limitation I might face and will get back to you with the result. Anyway keep up the awesome work (Y) :D
Mark, big thank for your works from Ukraine :-)
You're welcome again, Andrey! ✊🏼
Rolls Royce quality Mark.
I'm glad you enjoyed it! 👍🏼