24 Xcode Tips in 15 Minutes

  Рет қаралды 72,694

Paul Hudson

Paul Hudson

Күн бұрын

In this video I walk through 24 quick Xcode tips to help you write code faster, build better tests, and navigate around large projects more efficiently - there’s something for everyone! Let me know your favorite Xcode tips in the comments below, or tweet me @twostraws 🙌
Sponsored by Instabug, who have an SDK to help you minimize debugging time by providing you with complete device details, network logs, and reproduction steps. Find out more at www.instabug.com
00:00 Introduction
00:28 Generating class initializers
01:00 Environment overrides
01:52 Selecting blocks of code
02:10 Checking our spelling
02:59 Fixing all issues
03:20 Deleting search results
03:44 Resuming the SwiftUI canvas
04:18 Tiling the simulator
04:44 Expanding autocomplete
05:11 Quickly toggling breakpoints
05:37 Randomizing test order
06:14 Filtering the jump bar
07:03 Generating an interface file
07:45 Adding comments quickly
08:15 Finding files faster
08:42 Seeing source changes inline
09:29 Finding code in the minimap
09:59 Re-run your last test
10:30 Remapping unhelpful keys
11:41 Upgrading your searches
12:14 Reindenting code
12:37 Testing in-app purchases
13:37 Exploring build options
14:08 Pinning previews
15:06 Wrap up

Пікірлер: 148
@AlanW
@AlanW 3 жыл бұрын
"Which is useful for the NEVER times you want to print out your source" 🤣
@techguy0711
@techguy0711 3 жыл бұрын
I like the triple slash comment that provides a description for a function or class when using autocomplete
@robertmartens7839
@robertmartens7839 3 жыл бұрын
My tip is to always check your explanation first when I want learn something new with Swift.
@yuriiohiria5559
@yuriiohiria5559 3 жыл бұрын
Awesome! Learned many new useful things! Thank you, Paul!
@clith
@clith 3 жыл бұрын
Loved the pinned previews tip! Very useful.
@Aotearoas09
@Aotearoas09 3 жыл бұрын
Thanks. Something to learn and remember for the weekend.
@AlanW
@AlanW 3 жыл бұрын
0:28 was just something I was bemoaning about classes yesterday! Thanks!
@DavidBobSmith
@DavidBobSmith 2 жыл бұрын
I don’ t really have a favorite tip that you’ve gave they’re all good one. Thank you!
@mohammadabuqubu7079
@mohammadabuqubu7079 3 жыл бұрын
Filtering the jump bar was life savior
@acjazz01
@acjazz01 3 жыл бұрын
I loved that tip about generate initializers!
@remyblas
@remyblas 3 жыл бұрын
I'm about 2/3 into the 100 Days of Swift course and this is gold! First, because it will help me navigate and follow the projects quick and easily, and second, because I came here just curious, expecting not to understand most of it, but I do understand almost all of it, and that makes me feel like I really progressed in my understanding of iOS programming.
@pieterbikkel
@pieterbikkel 3 жыл бұрын
Great tips, the auto spelling and grammar is my favorite
@govind20246
@govind20246 3 жыл бұрын
Initializer method is awesome 👍, thanks for sharing this!
@thegoodshit1970
@thegoodshit1970 2 жыл бұрын
That was so extremely useful, thank you very much Paul. Those were some pretty advanced pro tips there!
@gakkieNL
@gakkieNL 3 жыл бұрын
Great tips, some new ones here! Thanks 🙏
@emilytomsUA
@emilytomsUA 3 жыл бұрын
Thank you for sharing, Paul!
@gabrielc3303
@gabrielc3303 3 жыл бұрын
This is gold!!! Thank you so much Paul 🙏🏻🙏🏻🙏🏻
@MrShumylo
@MrShumylo 2 жыл бұрын
Fantastic! So many useful tips. Cheers for this!
@vladimirmoor
@vladimirmoor 3 жыл бұрын
BIG thanks for this huge amount of tips!
@SmokeyMcMarF
@SmokeyMcMarF 3 жыл бұрын
The spelling check and the extended mini map navigation will be a game changer in my daily developer routine. Thanks for the excellent video. You are an awesome guy.
@craigdotfinance
@craigdotfinance 3 жыл бұрын
Fantastic video! Great tips in here.
@chrispy104k
@chrispy104k 3 жыл бұрын
Absolutely excellent Paul. My favourites: 1. In storyboard, Hold the Option key and then select the Source code file which makes sure that assistant editor is opened with the right file to make your connections 2. To go back to the file list no matter where the navigator panel is currently - Command + 1 3. Shift + Command + K to clean the build folder. Apparently Shift + Option + Command + K is supposed to perform a deeper clean. No idea if this is fact or fiction. 4. Command + R to run, Command + B to build 5. Mulit-position editing. Select the first location then hold Shift + Control then select the other locations to edit. Massive time saver. That should do for the moment.
@tharindudarshana6480
@tharindudarshana6480 3 жыл бұрын
Very useful one 👏🏻. Thank you
@mostafaelshazly6734
@mostafaelshazly6734 3 жыл бұрын
Thanks Paul, Love the tips! Specially the one with testing in-app purchases, I used to waste so much time on those non-consumables
@lennyedwards62
@lennyedwards62 3 жыл бұрын
Awesome video. Thank you
@magedmohamed4622
@magedmohamed4622 2 жыл бұрын
Thank you for your helpful explanation
@adam-user
@adam-user 2 жыл бұрын
Great video, thanks!
@mattlarsen
@mattlarsen 3 жыл бұрын
Favorite additional tips: CMD-Shift-Y to show/hide the debug area and Option-click on view controller when in the storyboard to display on screen and drag button actions over. Great series!
@CraigSchubert
@CraigSchubert 3 жыл бұрын
Fantastic tips - thanks Paul! :-)
@JonJudelson
@JonJudelson 3 жыл бұрын
Multiline Editing in Xcode is one of the most mind blowing features I have ever seen.
@volimpia
@volimpia 3 жыл бұрын
My favorite Xcode shortcut is selecting part of code and choosing refactor extract it to method. Makes code so clearer.
@imamad
@imamad 2 жыл бұрын
The interface maker shortcut was the best one for me! It's super helpful for code review and refactoring.
@DigitalHole
@DigitalHole 3 жыл бұрын
Thanks for sharing this.. Really cool tips & tricks.
@naturereporter2719
@naturereporter2719 3 жыл бұрын
IAP testing in Xcode. Awesome! Ty for this vid.
@theDaveBaxter
@theDaveBaxter 3 жыл бұрын
Dbl click the brace is defo gonna help. Am forever scrolling up and down trying to find matching braces.
@rednettle
@rednettle 3 жыл бұрын
Paul you are a legend, thanks for sharing these, 10 years doing Xcode development and didnt know half of these - My current fave is "Run without building" when you just want to restart the app without re compiling "ctrl+cmd+r"
@thephantom1237
@thephantom1237 3 жыл бұрын
Thanks Paul. these will save a-lot of my time.
@squarefrog
@squarefrog 3 жыл бұрын
So many good tips! I love the Structure > Move Selection Up or Down feature with cmd+opt+[ or cmd+opt+]. Works for both a single line of text, or many! Even more useful when writing SwiftUI
@adlsfreund
@adlsfreund 3 жыл бұрын
When was this added?
@squarefrog
@squarefrog 3 жыл бұрын
@@adlsfreund the feature has been there for a long time. The shortcut appeared in 2014 I believe.
@kaideumers6102
@kaideumers6102 3 жыл бұрын
These are really helpful!
@danuff
@danuff 3 жыл бұрын
Thanks for these tips!
@awakeFromNib
@awakeFromNib 3 жыл бұрын
Very useful, thanks!
@asigivati1382
@asigivati1382 3 жыл бұрын
wow impressive tips! i''m using xCode something like 6 years and i learned lot of good stuff here! thanks!
@casperes0912
@casperes0912 3 жыл бұрын
Haven't watched alll the vid yet, so don't know If it comes up, but here's the best thing I ever did for myself in Xcode. I bound the Refactor->Rename option to F13. Now I just place the cursor over a variable or function name, F13, write new name, enter. Boom, renamed everywhere
@_sabot
@_sabot 3 жыл бұрын
Sounda pretty cool, unfortunately my Mac doesn't have F13 😢
@AndreeMarkefors
@AndreeMarkefors 3 жыл бұрын
@@_sabot The Magic Keyboard with NumPad goes up to F19. X-Mas comes around sooner or later.
@goalsandapps7847
@goalsandapps7847 2 жыл бұрын
You got my thumbs up already after the very first tip.
@Nilely
@Nilely 3 жыл бұрын
Thanks. All tips are usefull. Tiling the simulator is most useful tip for me from all the new tips I learn.
@thesalazar78
@thesalazar78 3 жыл бұрын
Thank you for all the tips
@BTFranklin
@BTFranklin 3 жыл бұрын
These were so, so great.
@smrkdr0
@smrkdr0 2 жыл бұрын
Nice tips!
@davidagyakwa288
@davidagyakwa288 3 жыл бұрын
the best Swift and swift ui tutor there is 🔥
@AngleIron426
@AngleIron426 3 жыл бұрын
Excellent. Thank you.
@mrvfino
@mrvfino 3 жыл бұрын
Thanks! I always suggest your website and content to newer iOS developers that i meet. It's a go to resource. Succinct yet still very informative.
@onecarwood
@onecarwood 3 жыл бұрын
Very good tips!
@prachibile2798
@prachibile2798 2 жыл бұрын
Amazing tips
@h3sperian
@h3sperian 3 жыл бұрын
Thanks for the tips, I learned 2-3 new life-savers ❤️ I like to move things, and so do I like to move code in my source file. Mostly when dragging around some piece of useful code ⌥ + CMD + [ -> move line up ⌥ + CMD+ ] -> move line down
@luyokai
@luyokai 3 жыл бұрын
Never thought I knew so little about Xcode until I watched this video.
@satysin630
@satysin630 3 жыл бұрын
I don't even use Xcode yet I just watched the whole video. Some super handy tips here, kinda makes me want to use Xcode 🙃
@AndreyTorlopov
@AndreyTorlopov 2 жыл бұрын
Very useful. 🤘
@MrRLO8
@MrRLO8 3 жыл бұрын
Thanks Paul!
3 жыл бұрын
My tip: the disabled breakpoints also leaves a blue line on the right scrollbar. Just click twice in front of your actually important lines and work with a quick visible reference on the scrollbar. You can remove them after work done, from the Breakpoint Navigator.
@romanpurishy
@romanpurishy 3 жыл бұрын
Thanks, really helpful
@abirhasanzoha1291
@abirhasanzoha1291 3 жыл бұрын
Thanks for the tips. I really liked the spell checker as I do typo a lot. 😬
@pkc456
@pkc456 3 жыл бұрын
Great tips 👍
@judy8821
@judy8821 3 жыл бұрын
Great tips! Knew some of them. One tip for SwiftUI that I am careful to follow, is to not type too much code before building because the error messages don’t make sense so you can’t pinpoint which line of code is wrong until you start deleting all the lines you entered until you find the one.
@josuecruz0921
@josuecruz0921 2 жыл бұрын
These are great 🔑
@cruiseqe2
@cruiseqe2 3 жыл бұрын
Brilliant - thanks
@trendz4422
@trendz4422 3 жыл бұрын
Thanks Paul
@umairali7784
@umairali7784 3 жыл бұрын
Documenting a method shortcut is a great tip for me, hopefully I'll be doing it more often now on :)
@AX100G
@AX100G 3 жыл бұрын
The tip about adding init to classes is also useful for structs. the member wise init provided by the compiler is always “internal”. If you want a public one you can: Change your object from struct to class, use the Xcode refactoring tool to generate the init, change it back to a struct... and then make the generated init public.
@AnthonyMarchenko
@AnthonyMarchenko 3 жыл бұрын
⇧⌘J - select the visible file in project navigation, was a real discovery for our team. Really help to navigation throw complicated architecture try it! Cheers
@Star-rq3jd
@Star-rq3jd 3 жыл бұрын
Like all of it ✨
@fernandomontes5087
@fernandomontes5087 3 жыл бұрын
That indent shortcut is going to save me a lot of time.
@robertmartens7839
@robertmartens7839 3 жыл бұрын
too bad you didn't guess it was there.
@elbot441
@elbot441 3 жыл бұрын
Its good but got a bad thing when using with swiftlint, If you have an empty space (between two line for readability ) it will add space and create a warning for swift lint
@PaulPeelen
@PaulPeelen 3 жыл бұрын
Even better, there is an option in Xcode which will automatically re-indent on paste. You can find it in File > Preferences > Text editing > Indentation > Check "Re-indent on paste"
@anotherguycalledsmith
@anotherguycalledsmith 3 жыл бұрын
Thank you very much for #21 ;-)
@sergiobost4891
@sergiobost4891 3 жыл бұрын
My favorite was 'Generating an interface file' - Awesome
@trendz4422
@trendz4422 3 жыл бұрын
How its useful? IDK how to use it.
@sergiobost4891
@sergiobost4891 3 жыл бұрын
@@trendz4422 it’s only really useful when browsing through others code, it’s gives you a birds eye view of what’s going on. Otherwise you would have to figure out what each component does and individually
@noamif
@noamif 3 жыл бұрын
i've learnt so much from this man it's not even funny anymore
@vamsi3877
@vamsi3877 3 жыл бұрын
Thanks paul 👏
@ivanlyuhtikov3871
@ivanlyuhtikov3871 3 жыл бұрын
Cmd shift o - nice shortcut
@danielwatson6529
@danielwatson6529 3 жыл бұрын
Code snippets library is my fave, i save all sorts in there
@_sabot
@_sabot 3 жыл бұрын
My tip for you guys is something some may know from the JetBrains IDEs. They have this little target icon above the file tree and if you press it, it will show you where the currently in the editor opened file is located in the file tree. This is very useful in large projects after you navigated in your editor by clicking on method names for example. I missed it so long in Xcode until I found out it has it too, but it's little bit more hidden. You have to right click in the editor, then -> Navigate -> Reveal in Project Navigator
@ShinnyxAKAvincent
@ShinnyxAKAvincent 3 жыл бұрын
Try CMD+Shift+J :)
@_sabot
@_sabot 3 жыл бұрын
@@ShinnyxAKAvincent 😲
@volimpia
@volimpia 3 жыл бұрын
Number 1 is lifesaver, thank you for this video. I will be using it and number 8. Some i didn't know about, some did. Can anyone recommend some videos about testing?
@MarvelousLXVII
@MarvelousLXVII 3 жыл бұрын
Nice video.
@mirkaram548
@mirkaram548 3 жыл бұрын
No. 5 was that I was don't know before, that's really helpful. But what for i was hoping was "DUPLICATE CURRENT LINE", its really handy shortcut when when needed declaration of same type and modifier variable.
@reachtorich
@reachtorich 3 жыл бұрын
Thanks for your amazing tips. BTW, could you please show me how to customize the Xcode appearance like yours?
@dheerjdhiman4983
@dheerjdhiman4983 3 жыл бұрын
Amazing
@Cdswjp
@Cdswjp 2 жыл бұрын
Great!
@leaf_from_tree
@leaf_from_tree 3 жыл бұрын
Thank you 👍❤️Спасибо
@muntius8680
@muntius8680 Жыл бұрын
Thanks.
@leifashley
@leifashley 2 жыл бұрын
Probably the best Xcode tips list I've ever seen. I knew like only 2 of these, so the rest were pure gold :)
@30guarino
@30guarino 3 жыл бұрын
Thank you! ..... Now we need one of your subscribers to have a print out for us lol
@cyberrage8658
@cyberrage8658 3 жыл бұрын
Hey paul, how do you add the preview or simulator that when you change code it changed the app live like in swiftui
@snakehound7678
@snakehound7678 3 жыл бұрын
love it
@guitaripod
@guitaripod 3 жыл бұрын
I knew all of them 😎
@casadogaspar
@casadogaspar 3 жыл бұрын
For the 8º I'm using Amethyst to tile the windows, so it's even easier. I know it's not part of Xcode but it's worth.
@VinothKumar-zl2ht
@VinothKumar-zl2ht 3 жыл бұрын
TIP 3: Double Click i searched lot. Thanks Paul..!!!
@williamsquires3070
@williamsquires3070 3 жыл бұрын
Okay, but how can I force Xcode’s code editor to ALWAYS insert 2 spaces (or however many I want in the preferences) whenever I hit the key? This is super aggravating when I want to tab over an opening ‘{‘ and nothing happens. 😫 Even better, is there some way to have it put the open curly brace on the next line after a “func” declaration, and indented one level?
@danielwatson6529
@danielwatson6529 3 жыл бұрын
oh yes!!
@Sokrates8
@Sokrates8 3 жыл бұрын
I love auto-indent --> ctrl-I ;-)
@sirkastic
@sirkastic 3 жыл бұрын
My favourite is the 'Quicken' feature to help speed up builds. If you are finding build projects slow (especially Unity builds for me) press CMD + Q whilst XCode is buiilding the project and it will allocate more system resources to that task
@wilmercb
@wilmercb 3 жыл бұрын
Please make a video on Swift UI MVVM programing 🙏🏼
@dodilodi1278
@dodilodi1278 3 жыл бұрын
for tip No1, I find it more easy not to use the Editor, you can simply do right click on the class name -> refactor > generate membervise initializer
@lucaseve
@lucaseve 3 жыл бұрын
Any tip for showing and hiding line numbers without to open the preferences?
5 Steps to Better SwiftUI Views
31:19
Paul Hudson
Рет қаралды 54 М.
Super sport🤯
00:15
Lexa_Merin
Рет қаралды 20 МЛН
it takes two to tango 💃🏻🕺🏻
00:18
Zach King
Рет қаралды 31 МЛН
The invisible ransomware virus epidemic
22:17
Positive Events Eng
Рет қаралды 169
Apple Debugging L9 - Instruments Time Profiler
26:54
AppleProgramming
Рет қаралды 14 М.
31 Xcode Tips & Tricks - 2023
17:45
Sean Allen
Рет қаралды 37 М.
8 Common SwiftUI Mistakes - and how to fix them!
28:05
Paul Hudson
Рет қаралды 49 М.
Learn the Essentials of Swift in one hour
58:14
Paul Hudson
Рет қаралды 169 М.
How to become an iOS developer in 2021
53:33
Paul Hudson
Рет қаралды 162 М.
Flutter for iOS developers
13:43
Flutter
Рет қаралды 99 М.
Custom Hooks in React (Design Patterns)
12:56
Cosden Solutions
Рет қаралды 31 М.
Rust's Alien Data Types 👽 Box, Rc, Arc
11:54
Code to the Moon
Рет қаралды 132 М.
Write Better Code with Swift Algorithms
34:34
Paul Hudson
Рет қаралды 31 М.
МОЖНО ЛИ заряжать AirPods в чехле 🧐😱🧐 #airpods #applewatch #dyson
0:22
Apple_calls РЕПЛИКА №1 В РФ
Рет қаралды 21 М.
How To Unlock Your iphone With Your Voice
0:34
요루퐁 yorupong
Рет қаралды 16 МЛН
Latest Nokia Mobile Phone
0:42
Tech Official
Рет қаралды 491 М.