Ask Sawal

Discussion Forum
Notification Icon1
Write Answer Icon
Add Question Icon

Slavko Fatu




Posted Questions



Wait...

Posted Answers



Answer


For example, let’s say that an app that we’re working on contains a ContactListViewController that requires a ContactList model object to function. Ideally, we wouldn’t want to be able to create an instance of that view controller without its required model, and to make that happen, we might implement a custom initializer that looks like this:

However, if we now try to compile our app after making the above change, we’ll get a build error — saying that subclasses of UIViewController always need to provide an implementation of the init(coder:) initializer.

That’s because UIKit uses NSCoder to decode objects like views and view controllers when storyboards are used, and although Xcode will at this point suggest that we simply add that required initializer with a fatalError as its body — there are often other approaches that we can take, especially if we still want those objects to remain storyboard-compatible.

One way that can be used if the dependencies that we’re looking to inject can be retrieved statically (such as when using the singleton pattern) is to turn init(coder:) into a convenience initializer, and then have it call our custom one using those static instances as arguments — like this:

Another option that also lets our ContactListViewController remain compatible with storyboards is to use another flavor of dependency injection, rather than a custom initializer. For example, here we’re using property-based dependency injection to have our view controller use ContactList.shared by default, while also enabling that dependency to be overridden by assigning a new value to its property (optionally only within debug builds):

If storyboard compatibility is not an issue, we could of course go with what Xcode originally suggested, and implement the required NSCoder-based initializer with a call to fatalError — but if we end up doing that, let’s also mark that initializer as unavailable to make it impossible for us to accidentally call it within our own code. Here we’re doing just that within a view controller that requires a Product model to be passed into its initializer:

In iOS 13 and above, there are also a few other options that we could explore that both enable us to keep using storyboards, while also making it possible for our view controllers to use custom initializers.

One such option is the instantiateViewController method that’s available on UIStoryboard (the runtime API for Xcode’s storyboards). Using that API, we can programmatically create any view controller that our storyboard contains, which in turn enables us to take complete control over its initialization.

To make it possible to use that API, let’s first tweak our ProductDetailsViewController from before to also accept an NSCoder instance as part of its custom initializer, and to then delegate that initializer to super.init(coder:), rather than its nibName equivalent:

Note how we’ve also added a renamed: parameter to our above @available declaration, to again make our intentions crystal clear, both to any other developers that we might be working with, and to our future selves.

Then, here’s how we could use the above new implementation to create an instance of ProductDetailsViewController, for example within another view controller that displays a list of products:

Note that we’re retrieving the storyboard reference for our ProductDetailsViewController using its identifier, which can be assigned using the Storyboard ID text field within the Identity Inspector when a view controller was selected in Xcode’s storyboard editor.

Another option that enables us to use storyboard segues, instead of creating our view controllers manually, is to use the @IBSegueAction function attribute. Marking any function that accepts a single NSCoder argument with that attribute lets us delegate the creation of a given segue’s destination view controller to that function — for example like this:

To connect a custom @IBSegueAction function to a storyboard segue, select the segue within Xcode’s storyboard editor, open the Connections Inspector, and drag the instantiation action to the method that you’d like to connect it to.


Answer is posted for the following question.

What is nibname in swift?

Answer


Meeting someone new that you're able to click with easily is so refreshing. The conversation just flows, everything feels easy, and before you know it, hours have passed by.

Then, of course, there's the flip side of that where as much as you want to warm up to someone and vice versa, every chat with them feels terribly stiff. And sometimes those interactions are unavoidable. (Think: Your very hard-to-impress mother-in-law.) Luckily, there are a few expert-approved tricks that'll help you get on your conversation A-game.

Starting with the "breadth questions" are a great entry point to take any convo from awkward small talk to comfortable real talk, according to Terri Orbuch, PhD, a relationship expert, therapist, and author of 5 Simple Steps to Take Your Marriage from Good to Great. This can include questions about their family, career, et cetera.

Additionally, you want to avoid any "yes" or "no" questions and aim for the open-ended ones instead, says Tamekis Williams, LCSW, the founder of Mission Dorothy Female Empowerment Services. "Topics that get at the other person's inner world—their thoughts, goals, and dreams—will strengthen and increase bonding between two people," Orbuch notes. "Sharing personal information strengthens any relationship, and deeper questions focus on that personal self-disclosure."

And that goes for both parties, adds Williams. "When initially meeting someone, it's important to be inviting and warm so that the other person can initially feel comfortable talking with you."

Still, you want to be mindful of your approach and choose questions that don't feel critical or like an invasion of privacy, says Williams. Depending on the person, for example, it might feel safer to avoid questions about political and religious beliefs. Remember, you're just trying to get to know them, so you can save all those heavy hitters for another time (maybe).

To get someone else to open up, it can also be an effective strategy to take the lead in getting a little vulnerable. "You can get the answers by sometimes answering those questions yourself while sharing about you," says Williams. "An example would look like: 'I just moved to Georgia last year and found a beautiful community that I fell in love with and purchased a home. What about you, do you love where you live?'"

Meet the experts: Terri Orbuch, PhD, is a relationship expert, therapist, and author of 5 Simple Steps to Take Your Marriage from Good to Great. Tamekis Williams, LCSW, is the founder of Mission Dorothy Female Empowerment Services.Rebecca Hendrix, LMFT, is a New York-based licensed marriage and family therapist.

Not sure where to start? Here are 255 not-boring questions to use anytime you want to get to know someone better:

"Asking someone about their preferences helps you to understand who they are as a person," says Rebecca Hendrix, LMFT, a therapist in New York. The important thing here is to go deeper by asking follow-up questions. For example, "If you find out they like dogs, take it a bit deeper by asking them what they like most about their dog or their favorite breed," Hendrix explains.

"Commonalities often open the door for further conversation and, once that door is open, you can start a dialogue that allows the other person to elaborate and not give close-ended answers," Williams adds.

Some other ideas:

1. What’s your favorite way to spend a day off?

2. What type of music are you into?

3. What was the best vacation you ever took and why?

4. Where’s the next place on your travel bucket list and why?

5. What are your hobbies, and how did you get into them?

6. What was your favorite age growing up?

7. What was the last thing you read?

8. Would you say you’re more of an extrovert or an introvert?

10. What was the last TV show you binge-watched?

11. Are you into podcasts or do you only listen to music?

12. Do you have a favorite holiday? Why or why not?

13. If you could only eat one food for the rest of your life, what would it be?

14. Do you like going to the movies or prefer watching at home?

15. What’s your go-to guilty pleasure?

16. How old were you when you had your first celebrity crush, and who was it?

17. What's one thing that can instantly make your day better?

18. Do you have any pet peeves?

19. Which meal is your favorite: breakfast, lunch, or dinner?

20. What song always gets you out on the dance floor?

21. What activity instantly calms you?

22. Ideally, how would you spend your birthday?

23. What do you do on your commute to/from work?

24. What's your favorite season and why?

25. What's the phone app you use most?

26. Would you rather cook or order in?

27. What's your favorite board game?

28. How do you take your coffee?

29 What's your most prized possession and why?

30. What would be the first thing you'd do if you won the lottery?

31. How do you enjoy spending your alone time?

32. What’s the best concert you’ve ever been to?

33. Do you have a favorite type of exercise?

34. What causes are you passionate about?

35. What’s your favorite content genre (horror, sci-fi, rom-com, etc.)?

36. What’s an essential part of your daily routine?

37. What’s the worst gift you’ve ever received, and what did you do about it?

38. Who or what never fails to make you laugh?

39. Do you like group activities, or prefer doing things solo?

40. What's your ideal first date?

41. What would your perfect day look like?

42. Do you collect anything?

43. What's the best gift you've ever received, and why?

44. What would your perfect meal look like?

45. What's your favorite podcast?

No matter how a person feels about their job, the fact is, tons of people spend a lot of time and energy at work. To help you get to know someone better, "facilitate a conversation where you are left knowing how they feel about their career," Hendrix says.

Just prepare yourself to return that openness when they ask the same of you and your work life. "Initial conversations set the tone for if the person wants to continue to get to know you, so be ready to answer some questions as well," Williams says.

Try out these convo-starters:

46. Is there one job you’d never ever do?

47. What’s the first thing you do after getting home from work?

48. Who or what inspires you in your career?

49. How do you approach taking time off from work?

50. What’s something an outsider wouldn’t know about your industry?

51. Do you have a morning routine at work? If so, what it’s like?

52. Are you able to work from home, and if so, do you enjoy it?

53. Do you get along with all your coworkers?

54. What’s your favorite thing about your current job?

55. What annoys you the most about your job?

56. What’s the career highlight you’re most proud of?

57. What type of role do you want to take on after this one?

58. Are you more of a "work to live" or a "live to work" type of person?

59. Does your job make you feel happy and fulfilled? Why or why not?

60. How would your 10-year-old self react to what you do now?

61. What do you remember most about your first job?

62. How old were you when you started working?

63. What’s the worst job you’ve ever had?

64. What originally got you interested in your current field of work?

66. Have you ever had a side hustle or considered having one?

67. What’s the best career decision you’ve ever made?

68. What’s the worst career decision you’ve ever made?

69. Do you consider yourself good at networking?

70. What career advice would you give to your younger self?

71. Do you believe in having a "five-year plan"?

72. When will you know you've "made it"?

73. Are you looking forward to retiring, or do you plan to work as long as possible?

74. Have you ever had imposter syndrome?

75. What qualities do you look for in a boss?

76. Do you have a professional mentor? If not, do you want one?

77. What energizes you about your career?

78. Are you into after-work happy hours?

79. How do you motivate yourself in your career?

80. When you started your current job, what most surprised you?

81. How do you pick yourself back up after making a mistake at work?

82. How do you deal with work stress?

83. What's one work-related thing you want to accomplish in the next year?

84. Who has had the biggest impact on your career choice?

85. What does your family think of your career?

86. If you could do it all over again, would you pursue the same career? Why or why not?

87. Does your work routine vary, or does it look the same every day/week?

88. What do you typically wear to work?

89. Have you ever had to relocate for work?

90. Would you ever relocate for work, if you were asked to?

91. Have you ever been on a cool business trip?

92. How do you handle career setbacks?

A great way to get to know someone on a more personal level? Learn about the people they love. "Asking questions about close relationships can lead to stories, and sharing stories leads to connection and an experience of being seen by one another," Hendrix explains. Try:

93. How much time do you spend with your family?

94. Who do you most like spending time with and why?

95. Which family member makes the best food?

96. How has your opinion of your family changed over the years?

97. If you’re close with your family, what’s the hardest part about spending time away from them?

98. Do you wish you had a bigger family, or are you happy with its current size?

99. Which family member has had the greatest impact on you?

100. What’s your favorite story about your grandparents?

101. Have you ever mapped out your family tree?

102. Were you close with your family growing up?

103. Who in your family makes you feel the safest?

104. Do you want a family of your own?

105. If you could change your relationship with a family member, would you? If so, with whom?

106. What was it like growing up as the youngest/oldest/middle/only child?

107. What’s your favorite family memory?

108. Do you ever wish you were raised differently?

109. What’s the best piece of advice a family member has given you?

110. Do you wish you had more siblings? If so, why?

111. Did you ever hide anything from or lie to your parents?

112. What's your favorite way to spend time with your family?

113. How do you show your family you love them?

114. What’s your favorite family tradition?

115. What's the most important holiday you spend with your family and why?

116. What's something your family would be surprised to learn about you?

117. Which family member do you confide in most?

118. How do you deal with arguments between family members?

119. If you have children, how do you want to raise them?

120. What's more important: family or friends?

121. Do you have any friends you would consider family?

122. What physical traits do you share with your relatives?

123. What stories did your family members tell you growing up?

124. How did your parents (and/or grandparents) meet?

125. What makes you proud of your family?

126. What can always bring your family together?

127. Do you share a name with anyone in your family?

128. What activities do you like to do with your family today?

129. What activities did you love to do with your family growing up?

130. If you're married, are you close with your in-laws?

131. If you're adopted, have you met any of your biological relatives?

132. Would you rather go back in time to meet your ancestors, or travel into the future to meet your descendants?

"In learning about someone’s values, you are learning about their owner’s manual," Hendrix explains. Even seemingly mundane questions can get at a person’s values—like what’s motivating them to do well on a presentation or what they look for in an S.O.

"By learning about someone’s life philosophy, you're able to get at their true essence, how they live their life, and what drives their actions," Orbuch adds.

That said, you can't just ask, "What are your values?". What you can ask:

133. What do you think makes someone a “good person”?

134. Do you believe in love at first sight?

135. How do you show kindness to others?

136. Do you believe in soulmates? Why or why not?

137. What do you look for in a friendship?

138. Do you believe time you enjoy wasting is not wasted time?

139. What life lessons have you had to learn the hard way?

140. Do you believe what is meant for you will never miss you?

141. Have you ever experienced true love, and how did you know?

142. What’s a relationship deal breaker for you?

143. If you had only one sense (hearing, touch, sight, etc.), which would you want?

144. What makes you feel at peace?

145. What makes you feel most accomplished?

146. Would you rather make more money doing a job you hate or less doing one you love?

147. Which of your personality traits are you most proud of?

148. What’s the first thing you look for in a partner and/or friend?

149. Do you live by any piece of advice or motto?

150. How can someone earn your trust?

151. How can someone lose your trust?

152. Would you rather someone be honest and hurt your feelings or lie to protect them?

153. If you could snap your fingers and instantly make the world better, what would you do?

154. Do you believe in astrology? Why or why not?

155. Have you ever lost a friend? If so, what happened?

156. If you could only teach one thing to your (future) child, what would it be?

157. What’s the scariest thing you’ve ever done, and why did you do it?

158. Do you believe in second chances?

159. Where do you get your news?

160. What is your biggest irrational fear?

161. Are you active on social media, or do you prefer to be more private?

162. What is your definition of success?

163. Are you an organ donor, and how did you come to that decision?

164. Do you believe you should do one thing a day that scares you?

165. What, if anything, do you think happens after death?

166. What line should someone never cross with you?

167. How do you define beauty?

168. Do you believe in life on other planets?

169. How do you interact with someone who disagrees with you?

170. What does self-care look like for you?

171. What's your love language?

172. What's one thing you can't live without, and why?

173. How would you describe your work ethic?

174. Are you an optimist or a pessimist?

175. Are you an introvert, extrovert, or ambivert?

"These questions get at what the person is motivated by," says Orbuch. "What gives them the strength to wake up every day and get going? What do they dream and think about in their day?" When you learn about someone’s dreams, you share something more intimate. Jumpstart a deep conversation by asking this:

176. Do you think our dreams have hidden meanings?

177. When you want to give up, what keeps you going?

178. Do you live by any words of wisdom?

179. How do you turn a “no” into a “yes”?

180. Is it easy for you to accept help in achieving your dreams?

181. If you could do anything, besides what you're doing now, what would you do?

182. What do you regret not doing in the last year?

183. What’s on your bucket list?

184. If you had unlimited money to start your own business, what would it be?

185. If you found out today was your last day on Earth, what would you do?

186. If you could live anywhere in the world, where would it be?

187. If you could relive one moment in your life, which would it be?

188. If you had the opportunity to be immortal, would you take it?

189. Which famous person in history would you want to spend the day with?

190. If you could time travel, when and where would you go?

191. Do you think you'll likely accomplish all your dreams?

192. If you could magically become famous, would you want to?

193. A genie gives you three wishes—what are they?

194. What's your highest priority in life?

195. Is there anything holding you back from living your ideal life?

196. What steps, if any, are you taking towards your dreams?

197. What dreams did you have as a little kid?

198. What's one thing you would do if you knew you couldn't fail?

199. How have your dreams changed over time?

Sometimes the oddball questions allow you to learn the most interesting things about a person. "Unusual questions allow you to see the varied, unique, and special qualities of a person—their answers give you personal information about what makes them tick," Orbuch says. "These questions also typically get the other person to think outside box and really ponder something."

But you still want to keep things PG, says Williams. "Be careful with asking questions of a sexual nature too early," she advises. Same goes for the unconventional-for-a-reason q's, a.k.a. anything related to another person's finances, but especially questions about child support, debt, and credit score.

Ask these ~unconventional~ questions, and you'll definitely get some interesting (in a good way!) answers:

200. Do you believe in ghosts—why or why not? (Bonus question: If so, are you afraid of ghosts?)

201. Do you have any special skills?

202. What’s your game plan in a zombie apocalypse?

203. Can you write in cursive?

204. If you could live in a movie, which one would it be and why?

205. What’s your “dance like nobody’s watching” song?

206. Do you sing in the shower?

207. What's your go-to karaoke song?

208. How many hours do you get to the airport before a flight?

209. If you could have a super power, what would it be?

210. If you came back in your next life as an animal, what animal would you be?

211. What would be the title of your memoir?

212. What’s the first thing you do in the morning?

213. What’s the last thing you do at night?

214. Do you believe in any conspiracy theories (no judgement)?

215. What’s your idea of a perfect date (yes, of the calendar year)?

216. At a party, where can someone find you?

217. Do you wash your legs in the shower?

218. Who would play you in the movie of your life?

219. Do you have any allergies?

220. Do you trust your own memory? Why or why not?

221. Which fictional character do you relate to most?

222. What, if anything, would make you walk out in the middle of a movie?

223. When was the last time you cried and why?

224. What's your most controversial opinion about something mundane?

225. Do you "stan" any celebrities?

226. What's your go-to midnight snack?

227. What's the weirdest thing you do when you're alone?

228. Do you have any recurring dreams?

229. What's the worst argument you've ever been in?

230. What's your opinion on modern art?

231. What's the most ridiculous outfit you've ever worn?

232. Would you rather have your dishes or clothes be magically clean?

233. What's your favorite story about yourself?

234. If you could change anything about yourself, would you? If so, what and why?

235. Are you superstitious about anything?

236. What does your fridge typically look like?

237. Do you like to make plans ahead of time, or do things more spontaneously?

238. If you could go on a shopping spree anywhere, where would it be?

239. If you had to wear just one color for the rest of your life, what would it be?

240. What's your prized possession?

241. What's the weirdest encounter you've had with a celebrity?

242. What's the worst haircut you've ever had?

243. What's your favorite smell?

244. Would you rather be a superhero or a villain?

245. What's your superhero or villain origin story?

246. Who's your celebrity lookalike?

247. If you could instantly become an expert in something, what would it be and why?

248. What's your least favorite chore to do around the house?

249. Who's your emergency contact?

250. Can you drive? If so, what kind of driver are you?

251. What's the title of your most niche Spotify playlist?

252. What's the worst date you've ever been on?

253. If you won the lottery, what would you do with all the money?

254. If you could have anything right now, what would it be?

255. If you could be anywhere right now, where would it be?

"Anytime you reveal personal information to someone else, it increases intimacy between you and the other person," says Orbuch. So let down your guard, and don't be afraid to ask (and answer!) these deep questions.


Answer is posted for the following question.

Know which of you?

Answer


How To Tie A Nigerian Gele Head Wrap Bino and Fino - African Culture For Children · The Gele is a tall elegant head piece worn by women from Nigeria · More


Answer is posted for the following question.

How to tie a nigerian head scarf?

Answer


Elements Bar and Grill Darlinghurst

Address: 248 Palmer St, Darlinghurst NSW 2010, Australia


Answer is posted for the following question.

Where would I find best music bars in Sydney, Australia?


Wait...