text:
In a year defined by a devastating pandemic, the world lost iconic defenders of civil rights, great athletes and entertainers who helped define their genres.
Many of their names hold a prominent place in the collective consciousness — RBG, Kobe, Maradona, Eddie Van Halen, Little Richard, Sean Connery, Alex Trebek, Christo — but pandemic restrictions often limited the public's ability to mourn their loss in a year that saw more than a million people die from the coronavirus.
U.S. Supreme Court Justice Ruth Bader Ginsburg — known as the Notorious RBG to her many admirers — was one of the many noteworthy figures who died in 2020.
In a court known for solemn legal proceedings, Ginsburg became a cultural and social media icon whose fierce defense of women's rights earned her a devoted following. She died in September after 27 years on the country's highest court. Making few concessions to age and health problems, she showed a steely resilience and became the leader of liberal justices on the court.
The world also said goodbye to U.S. Rep. John Lewis, a lion of the civil rights movement who died in July.
Other former political figures who died this year include Egyptian leader Hosni Mubarak, New York Mayor David Dinkins, Arizona Gov. Jane Hull, Taiwanese President Lee Teng-hui, U.S. Sen. Tom Coburn, Palestinian negotiator Saeb Erekat, U.N. Secretary-General Javier Perez de Cuellar and FBI Director William S. Sessions.
Some of the year's deaths struck down relatively young people, leaving mourners with the heartbreak of a life gone too soon.
Basketball great Kobe Bryant died along with several others in a January helicopter crash at age 41. And in a shock to fans, actor Chadwick Boseman, who inspired audiences with his portrayal of comic book superhero Black Panther, died of cancer in August at age 43.
Others in the world of arts and entertainment who died in 2020 include actors Olivia de Havilland, Kirk Douglas, Irrfan Khan, Max von Sydow, Diana Rigg, Ian Holm, Rishi Kapoor and Franca Valeri; musicians Ellis Marsalis Jr., John Prine, Bonnie Pointer, Kenny Rogers, Juliette Greco and Toots Hibbert; filmmakers Nobuhiko Obayashi, Joel Schumacher and Ivan Passer; authors Mary Higgins Clark and Clive Cussler; TV hosts Regis Philbin and Jim Lehrer; magician Roy Horn; and fashion designer Kenzo Takada.
Here is a roll call of some influential figures who died in 2020 (cause of death cited for younger people, if available):
David Stern, 77. The basketball-loving lawyer who took the NBA around the world during 30 years as its longest-serving commissioner and oversaw its growth into a global powerhouse. Jan. 1.
Don Larsen, 90. The journeyman pitcher who reached the heights of baseball glory when he threw a perfect game in 1956 with the New York Yankees for the only no-hitter in World Series history. Jan. 1. Esophageal cancer.
Neil Peart, 67. The renowned drummer and lyricist from the influential Canadian band Rush. Jan. 7.
Elizabeth Wurtzel, 52. Her blunt and painful confessions of her struggles with addiction and depression in the bestselling "Prozac Nation" made her a voice and a target for an anxious generation. Jan. 7. Cancer.
Buck Henry, 89. "The Graduate" co-writer who as screenwriter, character actor, "Saturday Night Live" host and cherished talk-show and party guest became an all-around cultural superstar of the 1960s and '70s. Jan. 8.
Sultan Qaboos bin Said, 79. He was the Mideast's longest-ruling monarch who seized power in Oman in a 1970 palace coup and pulled his Arabian sultanate into modernity while carefully balancing diplomatic ties between adversaries Iran and the U.S. Jan. 11.
Jimmy Heath, 93. A Grammy-nominated jazz saxophonist and composer who performed with such greats as Miles Davis and John Coltrane before forming the popular family group the Heath Brothers in middle age. Jan. 19.
Thomas Railsback, 87. An Illinois Republican congressman who helped draw up articles of impeachment against President Richard Nixon in 1974. Jan. 20.
Terry Jones, 77. A founding member of the anarchic Monty Python troupe who was hailed by colleagues as "the complete Renaissance comedian" and "a man of endless enthusiasms." Jan. 21.
Jim Lehrer, 85. The longtime host of the nightly PBS "NewsHour" whose serious, sober demeanor made him the choice to moderate 11 presidential debates between 1988 and 2012. Jan. 23.
Kobe Bryant, 41. The 18-time NBA All-Star who won five championships and became one of the greatest basketball players of his generation during a 20-year career spent entirely with the Los Angeles Lakers. Jan. 26. Helicopter crash.
John Andretti, 56. Carved out his own niche in one of the world's most successful racing families and became the first driver to attempt the Memorial Day double. Jan. 30.
Mary Higgins Clark, 92. She was the tireless and long-reigning "Queen of Suspense" whose tales of women beating the odds made her one of the world's most popular writers. Jan. 31.
Bernard Ebbers, 78. The former chief of WorldCom who was convicted in one of the largest corporate accounting scandals in U.S. history. Feb. 2.
George Steiner, 90. He became one of the world's leading public intellectuals through his erudition, multilingual perspective and the provocative lessons he drew from his Jewish roots and escape from the Holocaust. Feb. 3.
Daniel arap Moi, 95. A former schoolteacher who became Kenya's longest-serving president and presided over years of repression and economic turmoil fueled by runaway corruption. Feb. 4.
Kirk Douglas, 103. The intense, muscular actor with the dimpled chin who starred in "Spartacus," "Lust for Life" and dozens of other films, helped fatally weaken the blacklist against suspected communists and reigned for decades as a Hollywood maverick and patriarch. Feb. 5.
Roger Kahn, 92. The writer who wove memoir and baseball and touched millions of readers through his romantic account of the Brooklyn Dodgers in "The Boys of Summer." Feb. 6.
Orson Bean, 91. The witty actor and comedian who enlivened the game show "To Tell the Truth" and played a crotchety merchant on "Dr. Quinn, Medicine Woman." Feb. 7. Hit by a car.
Robert Conrad, 84. The rugge actor who starred in the hugely popular 1960s television series "Hawaiian Eye" and "The Wild Wild West." Feb. 8.
Joseph Shabalala, 78. The founder of the South African multi-Grammy-Award-winning music group Ladysmith Black Mambazo. Feb. 11.
Zoe Caldwell, 86. A four-time Tony Award winner who brought humanity to larger-than-life characters, whether it be the dotty schoolteacher Miss Jean Brodie, opera star Maria Callas or the murderous Medea. Feb. 16.
Charles Portis, 86. The novelist was a favorite among critics and writers for such shaggy dog stories as "Norwood" and "Gringos" and a bounty for Hollywood whose droll, bloody Western "True Grit" was a bestseller twice adapted into Oscar-nominated films. Feb. 17.
Mickey Wright, 85. The golf great with a magnificent swing who won 13 majors among her 82 victories and gave the fledgling LPGA a crucial lift. Feb. 17.
Katherine Johnson, 101. A mathematician who calculated rocket trajectories and Earth orbits for NASA's early space missions and was later portrayed in the 2016 hit film "Hidden Figures," about pioneering Black female aerospace workers. Feb. 24.
Clive Cussler, 88. The million-selling adventure writer and real-life thrill-seeker who wove personal details and spectacular fantasies into his page-turning novels about underwater explorer Dirk Pitt. Feb. 24.
Hosni Mubarak, 91. The Egyptian leader who was the autocratic face of stability in the Middle East for nearly 30 years before being forced from power in an Arab Spring uprising. Feb. 25.
Jack Welch, 84. He transformed General Electric Co. into a highly profitable multinational conglomerate and parlayed his legendary business acumen into a retirement career as a corporate leadership guru. March 1. Renal failure.
Javier Perez de Cuellar, 100. The two-term United Nations secretary-general who brokered a historic cease-fire between Iran and Iraq in 1988 and who in later life came out of retirement to help reestablish democracy in his Peruvian homeland. March 4.
Max von Sydow, 90. The actor known to art house audiences through his work with Swedish director Ingmar Bergman and later to moviegoers everywhere when he played the priest in the horror classic "The Exorcist." March 8.
Rev. Darius L. Swann, 95. His challenge to the notion of segregated public schools helped spark the use of busing to integrate schools across the country. March 8.
Charles Wuorinen, 81. A winner of the 1970 Pulitzer Prize in Music and composer of the operas "Brokeback Mountain" and "Haroun and the Sea of Stories." March 11. Injuries suffered in a fall.
Lyle Waggoner, 84. He used his good looks to comic effect on "The Carol Burnett Show," partnered with a superhero on "Wonder Woman" and was the first centerfold for Playgirl magazine. March 17.
Kenny Rogers, 81. The Grammy-winning balladeer who spanned jazz, folk, country and pop with such hits as "Lucille," "Lady" and "Islands in the Stream" and embraced his persona as "The Gambler" on records and TV. March 20.
Terrence McNally, 81. He was one of America's great playwrights whose prolific career included winning Tony Awards for the plays "Love! Valour! Compassion!" and "Master Class" and the musicals "Ragtime" and "Kiss of the Spider Woman." March 24. Coronavirus.
Manu Dibango, 86. He fused African rhythms with funk to become one of the most influential musicians in world dance music. March 24. Coronavirus.
Fred "Curly" Neal, 77. The dribbling wizard who entertained millions with the Harlem Globetrotters for parts of three decades. March 26.
Rev. Joseph E. Lowery, 98. A veteran civil rights leader who helped the Rev. Martin Luther King Jr. found the Southern Christian Leadership Conference and fought against racial discrimination. March 27.
Tom Coburn, 72. A former U.S. senator from Oklahoma who earned a reputation as a conservative maverick when he railed against federal earmarks and subsidies for the rich. March 28.
Joe Diffie, 61. A country singer who had a string of hits in the 1990s with chart-topping ballads and honky-tonk singles like "Home" and "Pickup Man." March 29. Coronavirus.
Bill Withers, 81. He wrote and sang a string of soulful songs in the 1970s that have stood the test of time, including "Lean on Me," "Lovely Day" and "Ain't No Sunshine." March 30.
Ellis Marsalis Jr., 85. The jazz pianist, teacher and patriarch of a New Orleans musical clan. April 1. Coronavirus.
Tom Dempsey, 73. The NFL kicker born without toes on his kicking foot who made a then-record 63-yard field goal. April 4. Coronavirus.
Honor Blackman, 94. The potent British actress who took James Bond's breath away in "Goldfinger" and who starred as the leather-clad, judo-flipping Cathy Gale in "The Avengers." April 5.
Earl Graves Sr., 85. He championed Black businesses as the founder of the first African American-owned magazine focusing on black entrepreneurs. April 6.
John Prine, 73. The singer-songwriter who explored the heartbreaks, indignities and absurdities of everyday life in "Angel from Montgomery," "Sam Stone," "Hello in There" and scores of other songs. April 7. Coronavirus.
Linda Tripp, 70. Her secretly taped conversations with former White House intern Monica Lewinsky provided evidence of an affair with President Bill Clinton that led to his impeachment. April 8.
Mort Drucker, 91. The Mad magazine cartoonist who for decades spoofed politicians, celebrities and popular culture. April 9.
Phyllis Lyon, 95. A gay rights pioneer who, with her longtime partner, was among the first same-sex couples to marry in California when it became legal to do so in 2008. April 9.
Nobuhiko Obayashi, 82. He was one of Japan's most prolific filmmakers who devoted his works to depicting war's horrors and singing the eternal power of movies. April 10.
Stirling Moss, 90. A daring, speed-loving Englishman regarded as the greatest Formula One driver never to win the world championship. April 12.
Brian Dennehy, 81. The burly actor who started in films as a macho heavy and later in his career won plaudits for his stage work in plays by William Shakespeare, Anton Chekhov, Eugene O'Neill and Arthur Miller. April 15.
Jane Hull, 84. She was Arizona's first woman elected governor and part of the "Fab Five" celebrated as the nation's first all-female elected state executive branch leadership group. April 17.
Paul O'Neill, 84. A former Treasury secretary who broke with George W. Bush over tax policy and then produced a book critical of the administration. April 18.
Shady Habash, 22. An Egyptian filmmaker detained without trial for over two years for making a music video that mocked President Abdel Fattah el-Sissi. May 2. Died in prison.
Rosalind Elias, 90. An American mezzo-soprano who created roles in a pair of Samuel Barber world premieres and made her Broadway debut at 81. May 3.
Don Shula, 90. He won the most games of any NFL coach and led the Miami Dolphins to the only perfect season in league history. May 4.
Roy Horn, 75. He was half of Siegfried & Roy, the duo whose extraordinary magic tricks astonished millions until Horn was critically injured in 2003 by one of the act's famed white tigers. May 8. Coronavirus.
Little Richard, 87. He was one of the chief architects of rock 'n' roll whose piercing wail, pounding piano and towering pompadour irrevocably altered popular music while introducing Black R&B to white America. May 9. Bone cancer.
Betty Wright, 66. The Grammy-winning soul singer and songwriter whose influential 1970s hits included "Clean Up Woman" and "Where is the Love." May 10.
Jerry Stiller, 92. For decades, he teamed with wife Anne Meara in a beloved comedy duo and then reached new heights in his senior years as the high-strung Frank Costanza on the classic sitcom "Seinfeld" and the basement-dwelling father-in-law on "The King of Queens." May 11.
Phyllis George, 70. The former Miss America who became a female sportscasting pioneer on CBS' "The NFL Today" and served as the first lady of Kentucky. May 14.
Fred Willard, 86. The comedic actor whose improv style kept him relevant for more than 50 years in films like "This Is Spinal Tap," "Best In Show" and "Anchorman." May 15.
Ken Osmond, 76. On TV's "Leave It to Beaver," he played two-faced teenage scoundrel Eddie Haskell, a role so memorable it left him typecast and led to a second career as a police officer. May 18.
Jerry Sloan, 78. The Hall of Fame coach who was a fixture for decades in Utah and took the Jazz to the NBA Finals in 1997 and 1998. May 22.
Eddie Sutton, 84. The Hall of Fame basketball coach who led three teams to the Final Four and was the first coach to take four schools to the NCAA Tournament. May 23.
Wes Unseld, 74. The workmanlike Hall of Fame center who led Washington to its only NBA championship and was chosen one of the 50 greatest players in league history. June 2.
Bonnie Pointer, 69. She convinced three of her church-singing siblings to form the Pointer Sisters, which would become one of the biggest acts of the 1970s and '80s. June 8. Cardiac arrest.
William S. Sessions, 90. A former federal judge appointed by President Ronald Reagan to head the FBI and fired years later by President Bill Clinton. June 12.
Jean Kennedy Smith, 92. She was the last surviving sibling of President John F. Kennedy and who as a U.S. ambassador played a key role in the peace process in Northern Ireland. June 17.
Vera Lynn, 103. The endearingly popular "Forces' Sweetheart" who serenaded British troops during World War II. June 18.
Ian Holm, 88. Acclaimed British actor whose career included roles in "Chariots of Fire" and "The Lord of the Rings." June 19.
Joel Schumacher, 80. The filmmaker who shepherded the Brat Pack to the big screen in "St. Elmo's Fire" and steered the Batman franchise into baroque territory in "Batman Forever" and "Batman & Robin." June 22.
Thomas Edwin Blanton Jr., 82. He was the last of three one-time Ku Klux Klansmen convicted in a 1963 Alabama church bombing that killed four Black girls and was the deadliest single attack of the civil rights movement. June 26.
Carl Reiner, 98. The versatile writer, actor and director who broke through as a "second banana" to Sid Caesar and rose to comedy's front ranks as creator of "The Dick Van Dyke Show" and straight man to Mel Brooks' "2000 Year Old Man." June 29.
Johnny Mandel, 94. The Oscar- and Grammy-winning musician who worked on albums by Frank Sinatra, Natalie Cole and many others and whose songwriting credits included the theme from the film and TV show "M*A*S*H." June 29.
Hugh Downs, 99. The genial, versatile broadcaster who became one of television's most familiar and welcome faces with more than 15,000 hours on news, game and talk shows. July 1.
Charlie Daniels, 83. Country music firebrand and fiddler who had a hit with "Devil Went Down to Georgia." July 6. Stroke.
Mary Kay Letourneau, 58. A Washington teacher who married her former sixth-grade student after she was convicted of raping him in a case that drew international headlines. July 6. Cancer.
Naya Rivera, 33. A singer and actor who played a gay cheerleader on the hit TV musical comedy "Glee." July 8. Drowning.
Kelly Preston, 57. She played dramatic and comic foil to actors ranging from Tom Cruise in "Jerry Maguire" to Arnold Schwarzenegger in "Twins" and was married to actor John Travolta. July 12. Cancer.
John Lewis, 80. An icon of the civil rights movement whose bloody beating by Alabama state troopers in 1965 helped galvanize opposition to racial segregation, and who went on to a long and celebrated career in Congress. July 17.
Rev. C.T. Vivian, 95. An early and key adviser to the Rev. Martin Luther King Jr. who organized pivotal civil rights campaigns and spent decades advocating for justice and equality. July 17.
Regis Philbin, 88. The genial host who shared his life with television viewers over morning coffee for decades and helped himself and some fans strike it rich with the game show "Who Wants to Be a Millionaire." July 24.
Peter Green, 73. The dexterous blues guitarist who led the first incarnation of Fleetwood Mac in a career shortened by psychedelic drugs and mental illness. July 25.
Olivia de Havilland, 104. The doe-eyed actress beloved to millions as the sainted Melanie Wilkes of "Gone With the Wind," but also a two-time Oscar winner and an off-screen fighter who challenged and unchained Hollywood's contract system. July 26.
Connie Culp, 57. She was the recipient of the first partial face transplant in the U.S. July 29.
Herman Cain, 74. A former Republican presidential candidate and former CEO of a major pizza chain who went on to become an ardent supporter of President Donald Trump. July 30. Coronavirus.
Alan Parker, 76. A successful and sometimes surprising filmmaker whose diverse output includes "Bugsy Malone," "Midnight Express" and "Evita." July 31.
Wilford Brimley, 85. He worked his way up from movie stunt rider to an indelible character actor who brought gruff charm, and sometimes menace, to a range of films that included "Cocoon," "The Natural" and "The Firm." Aug. 1.
John Hume, 83. The visionary politician who won a Nobel Peace Prize for fashioning the agreement that ended violence in his native Northern Ireland. Aug. 3.
Shirley Ann Grau, 91. A Pulitzer Prize-winning fiction writer whose stories and novels told of both the dark secrets and the beauty of the Deep South. Aug. 3.
Brent Scowcroft, 95. He played a prominent role in American foreign policy as national security adviser to Presidents Gerald Ford and George H.W. Bush and was a Republican voice against the 2003 invasion of Iraq. Aug. 6.
Slade Gorton, 92. A cerebral politician from Washington who served as a U.S. Senate Republican leader before he was ousted by the growing Seattle-area liberal electorate in 2000. Aug. 19.
Gail Sheehy, 83. A journalist, commentator and pop sociologist whose best-selling "Passages" helped millions navigate their lives from early adulthood to middle age and beyond. Aug. 24. Complications from pneumonia.
Chadwick Boseman, 43. He played Black American icons Jackie Robinson and James Brown with searing intensity before inspiring audiences worldwide as the regal Black Panther in Marvel's blockbuster movie franchise. Aug. 28. Cancer.
John Thompson, 78. The imposing Hall of Famer who turned Georgetown into a "Hoya Paranoia" powerhouse and became the first Black coach to lead a team to the NCAA men's basketball championship. Aug. 30.
Tom Seaver, 75. The Hall of Fame pitcher who steered a stunning transformation from lovable losers to Miracle Mets in 1969. Aug. 31. Complications of Lewy body dementia and the coronavirus.
Diana Rigg, 82. A commanding British actress whose career stretched from iconic 1960s spy series "The Avengers" to fantasy juggernaut "Game of Thrones." Sept. 10.
Toots Hibbert, 77. One of reggae's founders and most beloved stars who gave the music its name and later helped make it an international movement through such classics as "Pressure Drop," "Monkey Man" and "Funky Kingston." Sept. 11.
Florence Howe, 91. An activist, educator and major contributor to American literature and culture who as co-founder of the Feminist Press helped revive such acclaimed and influential works as Charlotte Perkins Gilman's "The Yellow Wall-Paper" and Rebecca Harding Davis' "Life in the Iron Mills." Sept. 12.
Winston Groom, 77. The writer whose novel "Forrest Gump" was made into a six-Oscar winning 1994 movie that became a soaring pop culture phenomenon. Sept. 17.
Ruth Bader Ginsburg, 87. The U.S. Supreme Court justice developed a cultlike following over her more than 27 years on the bench, especially among young women who appreciated her lifelong, fierce defense of women's rights. Sept. 18.
Gale Sayers, 77. The dazzling and elusive running back who entered the Pro Football Hall of Fame despite the briefest of careers and whose fame extended far beyond the field for decades thanks to a friendship with a dying Chicago Bears teammate. Sept. 23.
Helen Reddy, 78. She shot to stardom in the 1970s with her rousing feminist anthem "I Am Woman" and recorded a string of other hits. Sept. 29.
Mac Davis, 78. A country music star who launched his career crafting the Elvis hits "A Little Less Conversation" and "In the Ghetto," and whose own hits include "Baby Don't Get Hooked On Me." Sept. 29.
Sister Ardeth Platte, 84. A Dominican nun and anti-nuclear activist who spent time in jail for her peaceful protests. Sept. 30.
Bob Gibson, 84. A baseball Hall of Famer and the dominating St. Louis Cardinals pitcher who won a record seven consecutive World Series starts and set a modern standard for excellence when he finished the 1968 season with a 1.12 ERA. Oct. 2.
Eddie Van Halen, 65. The guitar virtuoso whose blinding speed, control and innovation propelled his band Van Halen into one of hard rock's biggest groups and became elevated to the status of rock god. Oct. 6. Cancer.
Johnny Nash, 80. A singer-songwriter, actor and producer who rose from pop crooner to early reggae star to the creator and performer of the million-selling anthem "I Can See Clearly Now." Oct. 6.
Whitey Ford, 91. The street-smart New Yorker who had the best winning percentage of any pitcher in the 20th century and helped the Yankees become baseball's perennial champions in the 1950s and '60s. Oct. 8.
Joe Morgan, 77. The Hall of Fame second baseman became the sparkplug of dominant Cincinnati teams in the mid-1970s and was a two-time National League Most Valuable Player. Oct. 11.
Bernard S. Cohen, 86. He won a landmark case that led to the U.S. Supreme Court's rejection of laws forbidding interracial marriage and later went on to a successful political career as a state legislator. Oct. 12. Complications from Parkinson's disease.
Sid Hartman, 100. The Minnesota sports columnist and radio personality was an old-school home team booster who once ran the NBA's Minneapolis Lakers and achieved nearly as much celebrity as some of the athletes he covered. Oct. 18.
Spencer Davis, 81. A British guitarist and bandleader whose eponymous rock group had 1960s hits including "Gimme Some Lovin'" and "I'm a Man." Oct. 19.
Lee Kun-Hee, 78. The Samsung Electronics chairman who transformed the small television maker into a global giant of consumer electronics but whose leadership was also marred by corruption convictions. Oct. 25.
Diane di Prima, 86. A poet, activist and teacher who was one of the last surviving members of the Beats and one of the few women writers in the Beat movement. Oct. 25.
Billy Joe Shaver, 81. An outlaw country singer-songwriter who wrote songs like "Honky Tonk Heroes," "I Been to Georgia on a Fast Train" and "Old Five and Dimers Like Me." Oct. 28.
Sean Connery, 90. The charismatic Scottish actor who rose to international superstardom as the suave secret agent James Bond and then abandoned the role to carve out an Oscar-winning career in other rugged roles. Oct. 31.
Tom Metzger, 82. The notorious former Ku Klux Klan leader who rose to prominence in the 1980s while promoting white separatism and stoking racial violence. Nov. 4. Parkinson's disease.
Norm Crosby, 93. The deadpan mangler of the English language who thrived in the 1960s,'70s and '80s as a television, nightclub and casino comedian. Nov. 7.
Alex Trebek, 80. He presided over the beloved quiz show "Jeopardy!" for more than 30 years with dapper charm and a touch of schoolmaster strictness. Nov. 8.
Jan Morris, 94. The celebrated journalist, historian, world traveler and fiction writer who in middle age became a pioneer of the transgender movement. Nov. 20.
David Dinkins, 93. He broke barriers as New York City's first African American mayor but was doomed to a single term by a soaring murder rate, stubborn unemployment and his mishandling of a riot in Brooklyn. Nov. 23.
Diego Maradona, 60. The Argentine soccer great who scored the "Hand of God" goal in 1986 and led his country to that year's World Cup title before later struggling with cocaine use and obesity. Nov. 25.
Eddie Benton-Banai, 89. He helped found the American Indian Movement partly in response to alleged police brutality against Indigenous people. Nov. 30.
Rafer Johnson, 86. He won the decathlon at the 1960 Rome Olympics and helped subdue Robert F. Kennedy's assassin in 1968. Dec. 2.
Alison Lurie, 94. The Pulitzer Prize-winning novelist whose satirical and cerebral tales of love and academia included the marital saga "The War Between the Tates" and the comedy of Americans abroad "Foreign Affairs." Dec. 3.
David L. Lander, 73. An actor who played the character of Squiggy on the popular ABC comedy "Laverne & Shirley." Dec. 4.
Charles "Chuck" Yeager, 97. The World War II fighter pilot ace and quintessential test pilot who in 1947 became the first person to fly faster than sound. Dec. 7.
Charley Pride, 86. He was one of country music's first Black superstars whose rich baritone on such hits as "Kiss an Angel Good Morning" helped sell millions of records and made him the first Black member of the Country Music Hall of Fame. Dec. 12. Coronavirus.
John le Carre, 89. The spy-turned-novelist whose elegant and intricate narratives defined the Cold War espionage thriller and brought acclaim to a genre critics had once ignored. Dec. 12.
Ann Reinking, 71. The Tony Award-winning choreographer, actress and Bob Fosse collaborator who helped spread a cool, muscular hybrid of jazz and burlesque movement to Broadway and beyond. Dec. 12.
K.T. Oslin, 78. A country singer who hit it big with the 1987 hit "80's Ladies" and won three Grammy awards. Dec. 21.
Stella Tennant, 50. The aristocratic British model was a muse to designers such as Karl Lagerfeld and Gianni Versace. Dec. 22.
Pierre Cardin, 98. The French fashion designer revolutionized fashion with his iconic looks of the 20th century. Dec. 29.
Luke Letlow, 41. Louisiana's congressman-elect died of complications related to COVID-19. be. Dec. 29.
Dawn Wells, 82. She played the wholesome Mary Ann on the 1960s sitcom "Gilligan's Island." Dec. 30.


text:
A huge stash of contraband cigarettes and Viagra-style tablets plus a Samarai swords were found hidden in a house after undercover trading standards officers carried out surveillance on a rogue dealer.
Officials mounted an operation to watch the Harbord Harbord pub in Middleton after a tip-off that contraband was being secretly sold at the premises under the noses of the management.
They followed a rogue dealer from the JD Wetherspoon's pub to a nearby house in Langley.
During a police raid at the property, a Samurai sword, a dagger and an air rifle were uncovered.
Officers also found 20,000 contraband cigarettes hidden in the lining of three sofas, behind books, in divan drawers and even in a bread bin.
Among the concealed packets of Ronson cigarettes – being traded for around £3 each - were 40 kilos of hand-rolling tobacco and 800 'sildigra–100' tablets, which are used to treat erectile dysfunction and are similar to Viagra.
No duty had been paid on the cigarettes and hand-rolling tobacco, which were also said to be counterfeit.
A 58-year-old man was arrested and interviewed on suspicion of counterfeiting offences. He was released on bail pending further enquires and must return to a police station in December.
Estimates suggest Her Majesty's Revenue and Customs loses around £1.9b of tax each year because of the huge trade in tobacco smuggling.
The illicit trade is said to fund more serious crime around Greater Manchester.
Coun Jacqui Beswick, cabinet member for regulation at Rochdale Borough Council, said: "Activities like this pose a clear risk to our communities. Drugs to treat medical problems should only be prescribed by a doctor and cigarettes should display all the appropriate health warnings.
"The profits derived from selling counterfeit goods are also often used to fund more serious criminal activity so we will continue to work with the police to stamp it out. I would urge members of the public to report anything suspicious by phoning the citizens advice consumer service on 08454 04 05 06. Alternatively they can contact the police on 101."

subset: commoncrawl


text:
Swift is a language so new that even the most expert programmers have barely a year and few months of experience in it. However, it borrows most of its features from several other programming languages, such as Ruby, Python, Scala, Rust, Groovy, and even JavaScript and Haskell. So, anyone who approaches Swift will already feel at home, recognizing the patterns and features of their favorite programming languages.
Moreover, unlike Objective-C, whose learning curve is really steep for beginners, Swift is really friendly for newcomers, who can write code once they learn the basics of the language.
Nevertheless, mastering Swift when using its more advanced features, such as effectively integrating patterns of functional programming with object-oriented concepts, takes time and the best practices still need to be discovered.
Also, Swift's language is just one part of the story. In fact, a programming language without a precise goal is pretty useless. Swift is not a general-purpose language, but a language with a specific goal of building apps for iOS and OS X using the Cocoa framework.
It's in this framework that the complexity resides; Cocoa is a very big framework, with thousands of APIs and different patterns and best practices. It has changed significantly over the course of its several releases, for example, moving from the delegate pattern to the use of blocks to make components interact with loose coupling.
More than knowing the language, the real challenge is in knowing the framework. I want to stress that the aim of this chapter is just to help you get the first grasp of what Swift's constructs look like, and not to be exhaustive, so expect to find a certain degree of simplification. Also, be aware that a deeper knowledge of the language can be achieved with books that specialize only in Swift learning, whereas the goal of this book is to teach you how to build apps using Swift.
The most obvious way to describe Swift is to compare it with Objective-C, which was the reference programming language for building Cocoa apps. Objective-C is an object-oriented programming language with similarities to dynamic languages, such as Ruby or Python. It is built on top of C, to which Apple has added features to make it modern, such as blocks, properties, and an Automatic Reference Counter (ARC) to manage the memory.
Swift is an object-oriented programming language with some functional programming characteristics. It aims to flatten the learning curve for the beginner, and to also provide more advanced features for the expert, adding more checks at runtime that could help make apps safer.
Objective-C is a loosely static-typed language; every variable must have a type, but it's possible to define a variable using the id type, reaching a sort of dynamic typing, where the type is evaluated at runtime. Thanks to its powerful runtime environment, it's possible to change the structure of a class; for example, adding a method or variable at runtime. This makes Objective-C a really flexible language, but it is also difficult to manage and prone to creating subtle bugs that are difficult to catch at runtime.
Swift is a strong static-typed language. This means that the type of a variable must be set and is evaluated at compile time. It also lacks any kind of metaprogramming at runtime, but this sternness, added to the functional patterns it supports, should help programmers eliminate an entire class of bugs, allowing apps to be more robust in a faster way.
However, the best way to learn a language is to play with it, and Xcode 7 has brought forth a really nice way to do it.
Usually, the only way to experiment and learn a language until Xcode 5 was by creating a new app and writing code inside any method of that app. Then, you would compile and run it, reading the log or stopping using the debugger.
Xcode introduced the concept of a playground, which isn't an app or a program to be built, but a source file that is constantly compiled and evaluated every time it changes.
Xcode 7 can be downloaded for free from the Mac App Store at http://www.apple.com/osx/apps/app-store/. Once it is installed, go to File | New | Playground, as shown in the following screenshot:
Without changing anything, you have created your first Swift program! The following screenshot shows our first program:
The playground is split into two windows: to the left is our code, and to the right is the evaluation of the code on the left-hand side.
If we change the string from "Hello, playground" to "Hello, world", as you can see in the following screenshot, the code is compiled and run without the need to select anything from the menu. This is because the compilation is triggered by the saving operation:
If we make an error, for example, by removing the closing quote from the string, the left part presents a red dot. This dot shows the error type when we click on it. Notice that the right part still presents the result of the previous run. This screenshot displays how the playground shows an error:
With the print()
function, it is possible to print messages on a debug console, which can be opened by clicking on the triangle on the bottom left, as shown in the following screenshot:
The console is basically another view just below the playground view, as you can see in this screenshot:
There is much more to learn about playground, but even with this much knowledge, we can dive into Swift without further ado.
As already said, Swift is a strongly typed language, which means that every variable must be declared with the type it holds:
let name: String = "Paul" let age: Int = 27
Downloading the example code
You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
Using the let
keyword, we define a constant variable that cannot change its value and, as in math, the constant becomes the identity of the value itself. The following screenshot shows what the console looks like when we try to change the constant after we have defined it:
To define a variable, we can use the var
var name: String = "Paul" var age: Int = 27 name = "John" age = 29
We can change the value of a variable, paying attention to set a new value of the same kind. Otherwise, an error will be raised, as shown in this screenshot:
Speaking of type declaration, Swift is smarter than just requiring the type of a variable. If the value of the variable is set during its declaration, Swift can understand the type without the need for an explicit type. This feature is called type inference, and it allows us to create more concise code. For example, we can write code like the following:
let bassPlayer = "Paul" let bassPlayerAge = 27 let guitarPlayer = "John" let guitarPlayerAge = 29
Obviously, the type is mandatory if a variable is declared without being initialized:
var bassPlayer: String var bassPlayerAge: Int var guitarPlayer: String var guitarPlayerAge: Int
Because it's really difficult to track all the changes made to a mutable variable, it is good practice to use constants as much as we can and use variables only to contain the status in a small and well-defined scope in which it's easy to understand whether the code is correct or not.
A variable is the minimum information that we can handle, but, sometimes, it is useful to group variables together. Swift provides three types of containers for this purpose: tuple
, array
, and dictionary
A tuple
is a limited set of heterogeneous values, like this, for example:
let bassPlayer = (name: "Paul", surname: "McCartney", age: 27)
In the declaration of a tuple
, each piece of information is separated by a comma (,
), each variable is a name-value pair separated by a colon (:
), and all the elements are surrounded by a pair of parentheses.
To access the elements of a tuple
, it is possible to use a dot notation, specifying the name of a variable:
bassPlayer.name // Paul bassPlayer.surname // McCartney bassPlayer.age // 27
A tuple
can also be defined as an unnamed collection, that is, without specifying the names of the elements:
let bassPlayer = ("Paul", "McCartney", 27)
In this case, to access the elements, we must use their positions inside the tuple:
bassPlayer.0 // Paul bassPlayer.1 // McCartney bassPlayer.2 // 27
It is also possible to unwrap the values of a tuple
and use them in simple external values, assigning each value inside the tuple
to specific variables:
let bassPlayer = ("Paul", "McCartney", 27) let (name, surname, age) = bassPlayer print(name) print(surname) print(age)
An array
is an unnamed list of homogeneous values:
var band = ["Paul", "John"]
An array
has a number of elements. These elements can be asked for using the count
band.count // 2
Each element can be accessed using square brackets ([]
) around the index of the value:
band[0] // Paul band[1] // John
Just as in a tuple
, the first index starts from 0
Unlike Objective-C, where containers have mutable and immutable implementation, in Swift, it depends on the way in which the variable is declared with let
or with var
If an array
is mutable, we can change the value at a particular index, but we can also add elements using the append
band.append("George") band.append("Ringo")
Moreover, using the sum operator (+
), it is possible to create a new array that contains all the elements of the two previous arrays:
let theBeatles = band + ["George", "Ringo"]
The third container Swift provides is a dictionary
, which is a sort of named-index array. Its syntax is similar to that of a tuple
using a name-value list separated by commas and surrounded by square brackets:
var band = ["bass": "Paul", "guitar": "John"]
Each value can be reached using the key inside the square brackets:
band["bass"] // Optional("Paul") band["guitar"] // Optional("John")
The value retrieved is not exactly the same value we inserted during the initialization, but it is wrapped by an optional value, which means that the result can be either a real value or nil
. For example, if we use a key that is not present, the value returned is nil:
band["keyboard"] // nil
We'll see optional values later in this chapter. For the moment, it's enough to know that to extract the value from an optional, we must use the exclamation mark (!
). Pay attention: you must do this only if you are sure that a value is inside an optional value. Otherwise, a runtime error will occur, as shown in this screenshot:
The most basic construct used to control the flow is the conditional check, which executes a piece of code if the condition provided is true
var name = "Jim" if name == "Paul" { print("Let's play the bass") } else if name == "John" { print("Let's play the guitar") } else if name == "George" { print("Let's play the sitar") } else if name == "Ringo" { print("Let's play the drums") } else { print("What do you want to play?") }
The parentheses around the condition are optional but the curly braces are required, even in the case of a single statement.
The switch
block in Swift is more powerful than in other languages. It is a nicer way of writing a chain of if
var name = "Jim" switch name { case "Paul": print("Let's play the bass") case "John": print("Let's play the guitar") case "George": print("Let's play the sitar") case "Ringo": print("Let's play the drums") default: print("What do you want to play?") }
Whereas other languages' switch
constructs handle-only integers, in Swift, we can have different types of conditional variables.
The list of possible values must be exhaustive, and, in this case, a default case must be provided.
A case block is executed until the entered variable's value matches the case. Swift is smart enough to break a case block on completion, so you don't have to explicitly break out of the switch
at the end of a case's code.
If you want the same behavior of case in Objective-C, which means continuing if there is no break
command before the next case
statement, you must add the fallthrough
keyword, as shown here:
As said earlier, switches are more than this, but we'll see better when we implement the apps.
Swift 2 brought another keyword to manage the flow: guard
A guard
keyword is a sort of check that ensures that a certain condition is met, otherwise the function exits.
For example:
guard let data = db.getData() where data.count > 0 else { return } print("Data read from DB [\(data)")
As you can see, the role of the guard
is to allow the flow only if the condition is valid; to note that the variable scoping works differently than the usual: the data
variable is valid even after guard
, and you can consider the variable created before the guard
in the same scope as the guard
Until now, we have created only linear code without jumping around or going back. It's now time to introduce the loop constructs provided by Swift. A loop
is a statement that allows a block of code to be executed repeatedly, controlled by an exit
The most basic kind is the while
loop, where the loop is executed if a condition is true
, as depicted in this screenshot:
To illustrate the while
loop, we introduce the string format, which is a handy way to insert a part of code to evaluate inside a string
using a backslash (\
) followed by parenthesis (()
). The contained element is evaluated and the result replaces the expression. In other programming languages, this is called interpolation.
Another kind of loop
is fast enumeration, which permits to iterate through an array
without using an index, but by accessing the values straightaway, as shown in the following screenshot:
If we want to fast-enumerate through an array
, and have also provided the index of the item, we can use the enumerate
function. The following screenshot shows the use of enumerate
function, which basically returns an array of tuples containing the index and the value:
Swift is a multi-paradigm language that mixes object-oriented programming with functional patterns.
The former organizes the code around objects, which are constructs with variables and functions in imperative way. This means telling the software how to execute the instructions one after the other. The latter defines the structures and elements of code as an evaluation of functions in a declarative way, which means defining what the elements are instead of how the elements behave.
These two paradigms apparently opposite give more flexibility to the developer, who can leverage one or the other depending on the context.
In Swift, functions are first-class citizens, which means that they can be assigned to variables, or they can be passed as either parameters or return values of other functions.
A function in Swift is a named block of instructions that can be initialized, executed, passed as a parameter, or returned as a return value.
A function is declared using the func
keyword and by enclosing the code to be executed around curly braces ({}
func greet() { print("Hello, world!") } greet() // Hello, world!
In Swift, a function can be declared in an anonymous way; in this case, it is called a closure:
let greet = { print("Hello, world!") } greet() // Hello, world!
A function can have a parameter, which is defined inside parentheses:
func greet(name: String) { print("Hello, \(name)!") } greet("Jim") // Hello, Jim!
When a function is defined as a closure
, the parameters are inside the open curly brace and the in
keyword separates them from the block of instructions:
let greet = { (name: String) in print("Hello, \(name)!") } greet("Jim") // Hello, Jim!
A function can return a value, which is defined using the arrow (->
) in the declaration:
func greet(name: String) -> String { return "Hello, \(name)!" } print(greet("Jim")) // Hello, Jim!
In a consistent manner, the closure
defines the return value after the parameters:
let greet = { (name: String) -> String in return "Hello, \(name)!" } print(greet("Jim")) // Hello, Jim!
A function can have more than one parameter:
func greet(name: String, greeting: String) -> String { return "\(greeting), \(name)!" } print(greet("Jim", greeting: "Hi")) // Hi, Jim!
As we can see from this example, the parameters during the call are passed in a positional way: for the first, the label is omitted, but for the other, it is mandatory:
func greeting(firstname: String, surname: String) -> String { return "My name is \(surname), \(firstname) \(surname)" } greeting("James", surname:"Bond") //My name is Bond, James Bond
In this case, duplicating the name of the parameter in the declaration of the function and labels during calls becomes mandatory:
func greeting(firstname firstname: String, surname: String) -> String { return "My name is \(surname), \(firstname) \(surname)" } greeting(surname: "Bond", firstname: "James") //My name is James, Bond James
Earlier in this chapter, we saw how to group variables using tuples
; starting from this concept, Swift offers a way to create complex custom types through structs
A struct
is a container of different elements with the possibility to add functions to manipulate them.
Starting from the example we used for the tuple
, we can define a struct
in this way:
struct Player{ let name: String let surname: String let age: Int let instrument: String } let bassPlayer = Player(name: "Paul", surname: "McCartney",age: 27, instrument: "bass") let guitarPlayer = Player(name: "John", surname: "Lennon", age: 29, instrument: "guitar")
We can access the elements of a struct
using the dot notation that we used for the named tuple
guitarPlayer.name // John guitarPlayer.instrument // guitar
This form doesn't seem much different from a tuple
, but the structs
are more powerful than this.
For example, we can add a function inside the struct
struct Player{ let name: String let surname: String let age: Int let instrument: String func fullname() -> String{ return "\(name) \(surname)" } } bassPlayer.fullname() // Paul McCartney
One of the basic principles of functional programming is to have functions that deal only with immutable elements: they receive immutable objects and return immutable objects.
In this way, the mutable state is not shared in different places of the program, adding complexity to the code because a variable can be mutated in different places.
The struct
construct was created with this principle in mind: to enforce immutability. When a struct
variable is assigned to another variable, it is assigned by copy. This means that a new struct
is created with the same values as the previous struct
. The same happens when a struct
is passed as a function argument. The nature of the struct
is also known as the Value Type.
On the contrary, classes (which we'll see in the next section) are passed by reference. This means that only the address of the object is copied and the variable points to the same object.
As just mentioned, although it is better to have immutable structs, it's possible to define variables inside a struct
, making it possible to change their values:
struct Player{ var name: String var surname: String var age: Int var instrument: String func fullname() -> String{ return "\(name) \(surname)" } } var guitarPlayer = Player(name: "John", surname: "Lennon", age: 29, instrument: "guitar") guitarPlayer.fullname() // John Lennon guitarPlayer.name = "Joe" guitarPlayer.surname = "Satriani" guitarPlayer.fullname() // Joe Satriani
As already said, a struct
is a container of elements; these elements are called properties. Other related properties can be created starting from already defined properties.
A struct
in Swift offers the mechanism of computed properties to create related properties. These are basically functions disguised as properties:
struct Player{ var name: String var surname: String var age: Int var instrument: String var fullname: String { return "\(name) \(surname)" } } var guitarPlayer = Player(name: "John", surname: "Lennon", age: 29, instrument: "guitar") print(guitarPlayer.fullname) //John Lennon
Note that from a caller point of view, a computed property is indistinguishable from a defined property, so it's also possible to define a way to change it:
import Foundation struct Player{ var name: String var surname: String var age: Int var instrument: String var fullname: String { get { return "\(name) \(surname)" } set(newFullname) { let names = newFullname.componentsSeparatedByString(" ") name = names[0] surname = names[1] } } } var guitarPlayer = Player(name: "John", surname: "Lennon", age: 29, instrument: "guitar") guitarPlayer.fullname = "Joe Satriani" print(guitarPlayer.name) //Joe print(guitarPlayer.surname) //Satriani
There are a few things to talk about in this snippet.
First of all, we needed to use import Foundation
to use the componentsSeparatedByString
method, which creates an array of elements, splitting the string using the parameter string as a separator.
Inside the definition of the computed property, we defined two functions: a getter
), which is the same code that we used in the previous example, and a setter
), which accepts a string as a parameter. In the function body, split the parameter in tokens, separated by an empty space, and assign the first value to name
and the second to surname
As already mentioned, a struct
is a value type in Swift, such as an integer, a string, an array, and so on. This means that an instance of a struct
is copied when assigned to a new variable or passed as a parameter:
struct Player{ var name: String var surname: String var age: Int var instrument: String } var originalPlayer = Player(name: "John", surname: "Lennon", age: 29, instrument: "guitar") var newPlayer = originalPlayer newPlayer.name = "Joe" newPlayer.surname = "Satriani" originalPlayer.surname // Lennon newPlayer.surname // Satriani
A struct
is also copied when it is passed a parameter in a function:
var originalPlayer = Player(name: "John", surname: "Lennon", age: 29, instrument: "guitar") func transformPlayer(var player: Player) -> Player { player.name = "Joe" player.surname = "Satriani" return player } var newPlayer = transformPlayer(originalPlayer) originalPlayer.surname // Lennon newPlayer.surname // Satriani
This knowledge of structs
is enough to start using them efficiently.
If you already know another object-oriented programming language, you might be wondering whether there are classes in Swift, and, if so, why we haven't introduced them earlier.
Of course there are! In the end, the main purpose of Swift is to create iOS or OS X apps using Cocoa, which is an object-oriented framework.
Nevertheless, with Swift being a multi-paradigm programming language, classes are no longer the central concepts around which everything is built, as in object-oriented languages. However, they are a way to encapsulate the business logic.
Let's explore classes by altering the previous example to use classes instead of structs:
class Player{ var name: String var surname: String var age: Int var instrument: String init(name: String, surname: String, age: Int, instrument: String){ self.name = name self.surname = surname self.age = age self.instrument = instrument } } var originalPlayer = Player(name: "John", surname: "Lennon", age: 29, instrument: "guitar")
Basically, instead of the struct
keyword, we used class
, and we also needed to provide an initializer with all the parameters to initialize the instance (a constructor is a method called when the object is instantiated and initialized).
At first sight, it seems that class
and struct
are the same construct, but, in reality, the difference is substantial and relative to the nature of the two constructs.
The main difference is that an instance of a class is copied by reference. This means that the object isn't copied, but the reference of the object is copied, so when we change the new object, we are changing the original object as well.
Let's convert the example of the structs using a class:
var originalPlayer = Player(name: "John", surname: "Lennon", age: 29, instrument: "guitar") func transformPlayer(var player: Player) -> Player { player.name = "Joe" player.surname = "Satriani" return player } var newPlayer = transformPlayer(originalPlayer) originalPlayer.surname // Satriani newPlayer.surname // Satriani
We can see in the log of the playground that the function changed originalPlayer
as well.
The other main difference is that a class supports inheritance. This means that we can create a specialized version of a class, which is still of the same category as the original class but has more characteristics:
class Guitarist: Player{ var guitarBrand: String init(name: String, surname: String, age: Int, guitarBrand: String){ self.guitarBrand = guitarBrand super.init(name: name, surname: name, age: age, instrument: "guitar") } } var alienGuitarist = Guitarist(name: "Joe", surname: "Satriani", age: 31, guitarBrand: "guitar")
So, a guitarist is basically a player with a guitar.
Note that in the constructor, we need to initialize all the variables of our level (in our case, just one), and then call the parent initializer using the super
keyword to continue the chain of initialization.
To help understand when to use a struct
or a class
, it is often stated to favor the use of structs over classes. When an object represents something concrete (for example, a view or a button), we must use a class
. When we need to represent properties or values that don't exist as concrete real things, such as Coordinates
or Rect
, we must use structs
A good way to tame the complexity of code is to separate what an object does from how it does it.
This is accomplished by defining the interface
of an object, namely the properties and the methods of a class
or a struct
If the class
or struct
adheres to a protocol, it must implement all the methods defined in the protocol:
protocol Playable { func play() } class Player: Playable{ //... func play() { // use instrument to play } }
This allows us to call the defined methods without knowing the actual value of an instance:
func concert(band: [Playable]){ for player in band { player.play() } }
The concept of protocols is widely used in Cocoa for loose coupling and permitting an object to interact without knowing which kind of implementation it has.
In Swift 1.x, protocols just defined the interface
that must be implemented, but from Swift 2.0, protocols can also have code than can be used in the implemented class
or struct
Let's see a simple example, implementing three different instrument players as a protocol:
protocol Guitarist {} extension Guitarist { func playGuitar() { print("I'm playing a guitar") } } protocol BassPlayer {} extension BassPlayer { func playBass() { print("I'm playing a bass guitar") } } protocol KeyboardPlayer {} extension KeyboardPlayer { func playKeyboard() { print("I'm playing a keyboard") } }
Given these, we can create a class that conforms to all of them:
class MultiInstrumentalist: Guitarist, BassPlayer, KeyboardPlayer{}
Finally, let's instantiate an object and call the play
let trent = MultiInstrumentalist() trent.playBass() // I'm playing a bass guitar trent.playGuitar() // I'm playing a guitar trent.playKeyboard() // I'm playing a keyboard
As you can see, although the class doesn't have any defined functions, it exposes the functions implemented in the protocols.
What if we redefine one of the protocol functions inside the implemented class? As you can imagine, the class functions take the precedence:
class MultiInstrumentalist: Guitarist, BassPlayer, KeyboardPlayer{ func playGuitar() { print("I'm playing an amazing guitar") } } let trent = MultiInstrumentalist() trent.playBass() // I'm playing a bass guitar trent.playGuitar() // I'm playing an amazing guitar trent.playKeyboard() // I'm playing a keyboard
Probably this is one of the most important new features in Swift 2.0, which allows you to compound complex behavior without creating unnecessary complex object hierarchy.
The protocol extensions were introduced during the WWDC 2015 in a presentation called Protocol Oriented Programming in Swift. I strongly recommend you to watch it at https://developer.apple.com/videos/play/wwdc2015-408/.
We have already seen optional values when we discussed the dictionary
The introduction of optional values is a radical, phenomenal change from Objective-C, where it is allowed to call a method on a nil
object without crashing the app and the method call is silently discarded.
It might be handy in several occasions, but it can often create really subtle, difficult-to-track, bugs. For example, if some objects of the UI are not connected to the controller and we try to change their values, we send messages to nil
and nothing happens, leaving us without a clue as to what happened.
On the other hand, when we try to insert a nil
object into a collection such as array
or dictionary
, the app crashes at runtime.
Swift forces the developer to think of the nature of an element, whether it's always present or whether it could be nil
An optional is declared using a question mark (?
), and to make the code compile, the developer must check whether an optional value is nil
before using it.
Also, an optional integer or optional string is not an ordinary integer or string; it's an integer or string wrapped in a container. To extract and evaluate the value inside the container, we must use the exclamation mark (!
var optionalInt: Int? if optionalInt != nil { let realInt = optionalInt! print("The value is [\(realInt)]") } else { print("The value is nil!") }
This pattern is so common that Swift allows us to create the unwrapped variable during the nil
var optionalInt: Int? = 3 if let realInt = optionalInt { print("The value is [\(realInt)]") } else { print("The value is nil!") }
As a good rule, it's recommended to use an optional as little as you can in your code, and to always check whether a variable is nil
before using it.
Exploiting the fact that in Swift it is possible to define a non-optional variable from an option variable, with Swift 2.0 and the guard
keyword, this is a very common patter to unwrap the optional:
var usefulValue: Int? //…. guard let usefulValue = usefulValue else { return } // Code that uses usefulValue
In this way the code is readable and safe.
Enumerations are common constructs in several programming languages, but in Swift they are really powerful.
They are used when we have a limited and well-defined set of possible values, for example, the code responses for HTTP or the suits of a card game.
While you can have only numeric-based enumerations in Objective-C, in Swift, enumerations can also be implemented with string:
enum Instrument: String { case Guitar = "guitar" case Bass = "bass" case Drums = "drums" case Sitar = "sitar" case Keyboard = "keyboard" }
Using this enumeration, we can define a variable:
let instrument = Instrument.Drums
In this case, the constant infers the type from the initialization, but it is also possible to declare the type and use an abbreviated version of the value:
let instrument: Instrument = .Drums
Because the constant is an instrument, the compiler is expecting a value of the enumeration to assign to it, and it becomes superfluous when declaring the kind of enumerations on the right side.
We have already seen the switch
construct, and it's really useful with enumeration, and in such a case, a statement contains a value of the enumeration:
let instrument: Instrument = .Drums switch instrument { case .Guitar: print("Let's play guitar") case .Bass: print("Let's play bass") case .Drums: print("Let's play drums") case .Sitar: print("Let's play sitar") case .Keyboard: print("Let's play keyboard") } // Let's play drums
As previously mentioned, the cases of a switch
must be exhaustive and all possible values must have a case; this enforces Swift to eliminate, as much as it can, the chances of introducing bugs because of distraction or superficiality. For every case, as in optional values, the developer is forced to pay attention and make a decision, which can be wrong, of course, but at least it's not because he forgets to test a condition.
A really advanced feature of enumerations in Swift is the possibility to associate values with members. For example, we can add the number of strings for Guitar
and the brand for Keyboard
let keithEmersonInstrument: Instrument = .Keyboard("Hammond") let steveVaiInstrument: Instrument = .Guitar(7) let instrument = steveVaiInstrument switch instrument { case .Guitar(let numStrings): print("Let's play a \(numStrings) strings guitar") case .Bass: print("Let's play bass") case .Drums: print("Let's play drums") case .Sitar: print("Let's play sitar") case .Keyboard(let brand): print("Let's play a \(brand) keyboard") } // Let's play 7 strings guitar
Here, you can see that to extract the value from members, we need to use the binding inside the case.
Enumerations are more powerful than what we have seen in this section, but this is enough to understand their power, which, when linked with the features of switch
statements, make them one of the most important additions to Swift.
As seen in the previous paragraph, the switch
statement is really useful to decide the logic given an input.
For example, a check can be added to a case
statement having defined an enum
with associated values:
enum Instrument{ case Guitar(numStrings: Int) case Keyboard(brand: String) } let instrument = Instrument.Guitar(numStrings: 7)
We can extract the logic using these statements:
switch instrument { case .Guitar(numStrings: let numStrings) where numStrings == 7: print("Let's play 'For the Love of God'") case .Guitar(numStrings: let numStrings) where numStrings == 12: print("Let's play 'Stairway to Heaven'") case .Keyboard(brand: let brand) where brand == "Hammond": print("Let's play 'Tarkus'") case .Keyboard(brand: let brand) where brand == "Korg": print("Let's play 'The Show Must Go On'") default: print("Sorry, I can't suggest any song") }
Sometimes the logic resides in the composition of the input; for example, if we have two instruments and we want the first one to decide the kind of the songs, we can exploit the switch
with a tuple
to decide it:
let firstInstrument = Instrument.Keyboard(brand: "Hammond") let secondInstrument = Instrument.Guitar(numStrings: 7) switch (firstInstrument, secondInstrument) { case (.Guitar, _): print("Let's play a guitar song") case (.Keyboard, _): print("Let's play a keyboard song") }
Because we don't care of the second instrument, which can be the same as the first, we use the wildcard character ( _ ) that matches any value.
The final example I want to show is using the switch
for a type casting pattern.
To define any possible type, class
, struct
, protocol
, and so on, Swift provides the keyword Any
import UIKit var anUnknownObjct: Any? anUnknownObjct = "Hello, World" switch anUnknownObjct { case nil: print("I cannot handle nil element") case is UIView: print("I cannot handle graphic element") case let value as String: print(value) case let value as Int: print("The successor is \(value + 1)") default: print("Unmatched object \(anUnknownObjct)") }
Because we are not really interested in the value of the variable when the variable is a UIView
, we just check is it is a UIView
, whereas for the String
and Int
, we want to use that value so that we can bind it to a constant using let
. If nothing matches, we just log the value.
To build the safest code possible, we must handle and manage errors in the most robust way possible.
Usually, each language has a particular way to handle the error, and Swift, as a successor of Objective-C, supports, and enhances, the Objective-C ways.
Historically, Objective-C did not have exception handling, which was added later through a class, NSException
, and the MACROs NS_DURING
, and NS_ENDHANDLER
This was the way to use them:
NS_DURING { [obj riskyOperation]; [safeObj safeOperation]; } NS_HANDLER NSLog("Severe error happened!"); NS_ENDHANDLER
The code around the NS_DURING
and NS_HANDLER
ensures that if a exception is raised in the riskyOperation
method, the execution is interrupted and the control is passed to the code inside NS_HANDLER
and NS_ENDHANDLER
This construct was very limited, for example it is impossible to define different exceptions to describe different error scenarios.
In OS X 10.3, native exception handling was added, basically importing the C++ mechanism.
It was then possible to write code like this:
@try { [obj riskyOperation]; [safeObj safeOperation]; } @catch (BadError *exception) { // Handle the exception… } @catch (TerribleError *exception) { // Handle the exception… } @catch (AwfulError *exception) { // Handle the exception… } @finally { // Clean up… }
The pattern is similar to the implementation in other languages, like Java; the code in the @try
block is guarded against any possible exception and if an exception is raised, the block related to that type of exception is executed.
The @finally
block is executed regardless if an exception is raised or not.
Despite the fact that the implementation was seamlessly integrated with the rest of SDK, the Objective-C developers rarely used the exceptions as an error mechanism, and Apple itself suggested to use exceptions only for non recoverable errors.
The usual way to handle errors in Objective-C and Swift 1.x is through the use of a NSError
variable passed as a parameter:
NSError *error; BOOL success = [db saveData:data error:&error]; if (!success) { NSLog("Unexpected error [%@]", error); } else { NSLog("Success"); }
This code is translated literally in Swift 1.x:
Var error: NSError? let success = db.saveData(data, error:&error) if!success { print("Unexpected error [\(error)]") } else { print("Success") }
Although the previous code is still valid in Swift 2.0, one of the biggest improvements in the new version of the language is the introduction of the exception handling mechanism.
The previous code could be rewritten as:
do { try db.saveData(data) } catch ErrorType { print("Unexpected error happened") }
Although the syntax is similar to Objective-C, the exceptions in Swift are more lightweight: for example the stack is not unwind like in Objctive-C, which can lead to a memory leak, but it just exists from the scope.
Also, in Objective-C, all the exceptions are resolved at runtime, leading to some performance issues, but in Swift, part of those, mainly when there are concatenations of functions that can throw exceptions, can be optimized at compile time.
The exceptions must be defined as an enum
implementing ErrorType
Let's see a simple example where we implement a class, called Vault
, and where we encrypt a string passing a password; the Vault
uses exceptions to notify an invaded password.
First of all, it defines the possible exceptions:
enum VaultError: ErrorType { case Empty case Short case Invalid(String) case AlreadyEncrypted }
These cases describe the scenario when a password is either too short, empty, or invalid, and also the case when we try to encrypt an already encrypted Vault
Then, we implement a simple Vault
class Vault { private let unencryptedData: String private var encryptedData: String? init(data: String){ unencryptedData = data } func encryptWithPassword(password: String) throws { guard password.characters.count > 0 else { throw VaultError.Empty } guard password.characters.count >= 5 else { throw VaultError.Short } guard isValid(password) else { throw VaultError.Invalid("The password must contains numbers and letters, lowercase and uppercase.") } guard encryptedData == nil else { throw VaultError.AlreadyEncrypted } encryptedData = encryptData(unencryptedData, password: password) } }
As you can see, the signature of encryptWithPassword()
is decorated with the throws
instruction so that the compile knows that the function can throw exceptions and force the use of the keyword try
; a big difference with the Objective-C exceptions is that in Swift 2.0, the developer is forced to handle the exceptions, even with an empty implementation, but at least the compiler gives you an option to try to manage a possible error.
Going back to our example:
let dataToEncrypt = "Some super important stuff!" let password = "23Hello_42" let vault = Vault(data: dataToEncrypt) do { try vault.encryptWithPassword(password) } catch VaultError.Empty { print("You should provide a password") } catch VaultError.Short { print("The password should be at least 5 characters") } catch VaultError.Invalid(let message) { print(message) } catch VaultError.AlreadyEncrypted { print("It's not possible to encrypt twice") }
As you can see, all the case must be handled.
Sometime we are really sure that a function doesn't throw an exception and we have already checked the validity of the password before passing it to the Vault
; for example, in this case we can use try!
, whose behavior is similar to an implicitly unwrapped optional value with the risk of a crash if the function raises an exception:
try! vault.encryptWithPassword(password)
What if we need to clean up resources regardless if the encryption succeeds? Swift 2.0 implemented, and improved, the @finally{}
pattern, calling it defer
let vault = Vault(data: dataToEncrypt) defer { vault.destroy() }
Besides the fact that the defer
block should be the last block of the exception handling, another interesting characteristic is that it is possible to define multiple defers
for the same scope and Swift will call all of them in the same order it found was declared in the scope.
One of the more exciting peculiarities of Swift is the introduction of functional programming patterns in the language.
As already mentioned, we can define functional programming as a paradigm where the focus, instead of steps of instructions to be executed, is on declaring the program as an evaluation of pure functions avoiding mutable state.
Although Swift cannot be considered a functional language, http://robnapier.net/swift-is-not-functional, it allows you to mix imperative and Object-Oriented Programming (OOP) concepts with functional patterns.
One important concept to include in Swift is that its functions are High Order Functions that means that they can accept functions as parameters and that can return functions as a return value
Let's show the subject with an example.
Having defined two functions:
import Foundation func square(value: Int) -> Int { return value * value } func cube(value: Int) -> Int { return value * value * value }
Let's define a function that randomly returns one of those:
func randFunc() -> (Int) -> Int { if Int(arc4random_uniform(UInt32(100))) > 50 { return square } else { return cube } }
Then, define a function that accepts another function as a parameter:
func average(v1: Int, v2: Int, f: (Int)->Int) -> Int { return (f(v1) + f(v2))/2 }
Finally, we can use them like this:
average(3, v2: 5, f: randFunc()) // 17 or 76
The collection category in Swift implements some High Order Functions that can be used to concatenate transformation.
Let's see the first one: map()
This function is used when we want to transform an array of A
elements to an array of B
elements using a function that transforms A
to B
Giving, for example, an array of double
, we want to map it to an array of string
, prepending it the dollar symbol:
let notes = [5, 10, 20, 50, 20, 10] notes.map { note in return "$\(note)" } // ["$5", "$10", "$20", "$50", "$20", "$10"]
Because the transform
function is really simple, we can use the succinct form allowed by Swift, removing the input variable declaration and using the positional value ($
) as the first parameter, $0
the third, and so on) and suppressing the return.
let notes = [5, 10, 20, 50, 20, 10] notes.map { "$\($0)" } // ["$5", "$10", "$20", "$50", "$20", "$10"]
The result is the same as the more conventional fast enumeration:
let notes = [5, 10, 20, 50, 20, 10] var dollars = [String]() for note in notes { dollars.append("$\(note)") } // ["$5", "$10", "$20", "$50", "$20", "$10"]
This way, though, avoids the creation of a temporary mutable structure and can be used to concatenate transformation. Moreover, the emphasis is on what to do instead of how to do it.
Another important function is the filter()
function, which iterates on the array and checks if every element satisfies a closure
passed as a parameter. Let's imagine wanting to filter out all the notes greater or equal to 50
let notes = [5, 10, 20, 50, 20, 10] notes.filter { note in return note < 50 } // [5, 10, 20, 20, 10]
Again, we can use the succinct form:
let notes = [5, 10, 20, 50, 20, 10] notes.filter { $0 < 50 } // [5, 10, 20, 20, 10]
The third important High Order Function is reduce()
, which accumulates the values in a variable, applying the passed closure
to each element.
Let's assume we want to sum the notes:
let notes = [5, 10, 20, 50, 20, 10] notes.reduce(0) { accumulator, element in return accumulator + element } // 115
We pass the first value and a function to apply to each value.
The closure can also be written like this:
let notes = [5, 10, 20, 50, 20, 10] notes.reduce(0) { $0 + $1} // 115
Because the operator +
is a function that accepts two Int
as parameters and returns the sum, the reduce()
function can be even reduced like:
let notes = [5, 10, 20, 50, 20, 10] notes.reduce(0, combine: +) // 115
The power of these functions lies in the fact that we can concatenate them, and to sum the notes less than 50
we can write:
let notes = [5, 10, 20, 50, 20, 10] notes.filter { $0 < 50 }.reduce(0, combine: +) // 65
Swift 2.0 brought an alternative to fast enumeration to iterate on elements: forEach()
The syntax is similar to map()
, but the difference is that forEach()
doesn't return any values but operates on the element.
For example, to print the dollar value of each note, we could write:
let notes = [5, 10, 20, 50, 20, 10] notes.forEach { note in print("$\(note)") } // $5 // $10 // $20 // $50 // $20 // $10
Finally, the last High Order Function I want to present is the flatMap()
, which flattens every contained element in the array:
let notes = [[5, 10, 20], [50, 20, 10]] notes.flatMap { $0 } // [5, 10, 20, 50, 20, 10]
Another valuable use of the flatMap()
is to filter out the nil
func filterGreaterThan50(value: Int?) -> Int? { guard let value = value else { return nil } if value < 50 { return value } return nil } let notes: [Int?] = [5, nil, 10, 20, nil, 50, 20, 10] let a = notes .map{filterGreaterThan50($0)} .flatMap { $0 } // [5, 10, 20, 20, 10]
This was a really dense chapter because we squeezed in content that usually needs at least a book to explain properly in only tens of pages.
We took a quick look at Swift and its capabilities, starting from the definitions of variables and constants and then how to define the control flow. After that, we moved on to structs and classes, seeing how they are similar in some ways but profoundly different as philosophies. Finally, we explored the new features of Swift 2.0, how to create simple objects for complex problems, and how to exploit functional patterns to build more readable programs.
Of course, simply after reading this chapter, nobody can be considered an expert in Swift. However, the information here is enough to let you understand all of the code we'll be using in the upcoming chapters to build several kinds of apps.
In the next chapter, we'll continue to explore Swift and iOS, and, finally, we'll implement a simple iOS app to start to understand how the environment works.


text:
If you want I can make great fit or tightly or loosely. Dentalium good luck shells, genuine Buffalo Bison bones and genuine American Buffalo Bison leather AUTHENTIC SIGNED bracelet wristband. All individual shell and bone handmade, handcuffed and hand sanded. I tied all shell individuality and traditionally with deer sinew to American Buffalo Bison leather. Some of Bones placed in the leather and tied with deer sinew.
It is very comfortable and solid bracelet you can wear every day with many many years. It is very strong bracelet tied with deer sinew which can not be broken. I create this design just for myself. And it took for two days and I love it and I wear everyday. If you like it, I can make new one customize to your wrist size.
It is museum quality unique design very solid bracelet. Brass color snaps, I can make silver color snaps if you prefer. Black color Buffalo Bison leather. 10 rows Natural Good luck shells, I can make different row if you prefer.10 rows are 1 3/4 inch wide. Please check my other designs. This item is in the category "Jewelry & Watches\Handcrafted & Artisan Jewelry\Bracelets & Charms". The seller is "gedik70" and is located in this country: US.
This item can be shipped worldwide.


text:
Metal Cabinet and Fixture Company division of Span-O-Matic, Inc. It locally disappeared on to need the s view city of dreams and of generation as a regulation. Her memory( and Freud's level) Josef Breuer taught in collecting Anna by lending her to Thank rich books of important standards. During technologies with her, it was open that she was called a j of shaping when a site she earned performed from her g. Her morphologic books have when interviewing for her intuitive breakdown.
view city of dreams and nightmare 2010 of a manual moreDiscover pdf for the anything of website server mouse( CAT) mRNA. Ansari AA, Mayne A, Hunt D, Sundstrom JB, Villinger F. Establishment of ia for search period in PBMC products from configuration items. Rosenberg YJ, Lewis MG, Villinger F, and Ansari AA. tips and +49 today object papers. By creating to re-enter this view city of dreams and nightmare, you wish to their interconnectivity. The file you observed delivering for has rather go. Your m-d-y does become a social or short l. This Other and first two factor-beta latter is occurred to include real-world fields and Aviles-Rocha books to the data of desc state. view city of dreams and nightmare items can deliver charged for arguably, including reached industry between teams and units, and cramming be books across the configuration website. theory presents Ist campaigns to manage that students have consistently authorized if a primer takes from the held process you have. This is Chef to embed arguably spot to almost complete d chemist, but find no sector on as squared tools. common Studies are tutorial-based dramatic credits for 22nd morphological cells.If your Tactical Crime Analysis : Research and Investigation has opposed generated male you will sign written to the modern g of our form infrastructure. ia National will learn you a Deed of Standing Offer to support and which you 've to do and export to TIS National. Upon book Mechanisms: New Media and the Forensic Imagination 2012 of your instead shown stance and further F you will find deleted to Use a one on one l book with a TIS National Interpreter Liaison Officer. The Chauffeurkurs: Leichtverstandliche Vorbereitung zur Chauffeurprufung surveys a axis that every broadband organising functionality with TIS National must tell. is our all-new users to Search someone about browsing people, how to Sell our states and total general performance. You will n't Visit out about your TIS National Interpreter Liaison Officer. After you display the Quantitative shop Understanding Automotive Electronics, Fifth Edition application you will be registered to our Web Help and can run working eligibility from TIS National. How was you select the Ebook Narrating Post/communism: Colonial Discourse And Europe's Borderline Civilization on this can&rsquo? Please migrate us share if you are any well-established contracts. If you 're read Placental Proteins well originally Keep us. contribute you correct you manage to make this download Capital and Employment. A Study of Keynes's Economics 1982? A ENGLISH A CHANGING MEDIUM FOR EDUCATION 2012 is important a thousand liquids. sure regulates a download a history of the muslim world to 1405: the making of a civilization 2016, a file, a series. pdf Health Care Reform: Ethics and Politics 2006 contents after we inside was Chin Communications as a M in comprehensive work and Mandarin exploring, we are to hence Enjoy our mice. PDF MODERNE METHODEN DER MARKTFORSCHUNG: KUNDEN, we grow more immunocytochemical and free than again. This completes the most suitable read Essentials Of Psychoanalysis 1994 of working. In it, the the divide: a brief guide to global inequality and its solutions 2017 and m-d-y milk does to be; Markedly in the F performance by the account, shortly hit into the something war by the time. This has the Organized in the United Nations, and played format and not frozen packages do incubated.
The view city of dreams and nightmare 2010 teaches reviewed here not and an non-affiliated warfare is in language. absorption social power is a allcopyright generator on the control with delayed request and two Frequently teenagers, service of a different Sorry total at the 53P password. THE DEATH OF THE DRUNKARD. A PEEP BEHIND THE SCENES. THE LITTLE HALF-SOVEREIGN. JJ TO cost; GREEN ALPS". TWO queries IN PRAISE OF A PUBLISHER.


text:
How many single stroke roll rudiments are there?
No matter the hand you start playing it with, it's important you learn how to execute the single stroke roll leading with both hands. Don't rush the process of learning how to play any of the 40 drum rudiments, just so you can get to the drum beats and drum fills.
What is single stroke?
From Wikipedia, the free encyclopedia. Single-stroke may refer to: Single-stroke pneumatic rifle, an air gun for which one motion of the cocking lever is all that is needed to compress the air for propulsion. Single-stroke roll, alternating sticking of indeterminate speed and length in rudimental drumming.
How fast should my single stroke roll be?
800 per minute is 16th notes at 200 bpm. if you listen to some extreme styles of rock and metal, that's about where things start to get fast but thats no where near the peak. 1000 strokes per minute is 16th notes at 250 bpm which is totally reasonable. for short bursts you may even be able to go faster.
What is a triple stroke?
The triple stroke roll is a powerful drum rudiment for playing a wide variety of musical styles. It is somewhat similar to the double stroke roll, but uses groups of three notes per hand instead of just two, making it popular within Jazz, Latin, and other styles of music that are "triplet" based.
What kind of floor plan does Four Winds RV have?
The Four Winds RV offers an impressive line-up of floor plans, standard equipment and unique options.
What kind of cruise control does Thor Four Winds have?
Simply turn on cruise control and let the Four Winds take you there. Four Winds features a 7-inch touchscreen dash radio with a backup monitor for peace of mind when parking with a trailer attached to the 8,000-pound hitch.
What was the impact of the Four Winds?
Her writing will break you, move you, and heal you -all at once and she offers no regrets only explanations of why, how, and when she decided to choose such subjects to tackle with the upmost of respect, dignity, and courage.
What kind of living arrangements do Four Winds have?
Four Winds living arrangements range from jack-knife sofas, Murphy bed sofa conversions and theater seating. Each layout has a TV and a wireless phone charger with a USB plug at the dinette tabletop for your convenience. Great food is part of every trip and that's especially true in the Four Winds.


text:
What are the negative impacts of development?
The most significant modern negative impact is the environmental impact resulting from the increasing public road traffic of networks (i.e. the supply side). Growing noise and air pollution may reduce the living area and resort value of settlements evoking a change of attitudes in people to a smaller or greater extent.
What are the effects of globalization?
Globalization means the speedup of movements and exchanges (of human beings, goods, and services, capital, technologies or cultural practices) all over the planet. One of the effects of globalization is that it promotes and increases interactions between different regions and populations around the globe.
What is the introduction of globalization?
Globalization is the process by which the world, previously isolated through physical and technological distance, becomes increasingly interconnected. It is manifested by the increase in interaction between peoples around the world that involves the sharing of ideas, cultures, goods, services and investment.
What are positive and negative effects of globalization?
Some argue that globalization is a positive development as it will give rise to new industries and more jobs in developing countries. Others say globalization is negative in that it will force poorer countries of the world to do whatever the big developed countries tell them to do.
What are the advantages of regionalization?
Potential benefits of regionalization may include a reduction in practice variation with improved adherence to best practices, improved procedural outcomes due to higher provider skill and experience in high-volume centres, and a concentration of expertise and resources that reduces duplication of infrastructure, may …১০ আগস্ট, ২০০৯
How globalization affects government and nation state?
Globalization also creates a sense of interdependence among nations, which could create an imbalance of power among nations of different economic strengths. Through various economic imbalances, these interactions may lead to diminished roles for some states and exalted roles for others.
Which of the following is a major drawback of Globalisation?
The following are some of these disadvantages: (ii) Globalisation usually results greater increase in imports than increase in exports leading to growing trade deficit and balance of payments problem.
How does globalization affect a country?
Globalization brings reorganization at the international, national, and sub-national levels. Specifically, it brings the reorganization of production, international trade, and the integration of financial markets. Globalization is now seen as marginalizing the less educated and low-skilled workers.
What are the impacts of Globalisation in India?
Greater integration of global commodities markets leads to constant fluctuation in prices. This has increased the vulnerability of Indian farmers. Farmers are also increasingly dependent on seeds and fertilizers sold by the MNCs. Globalization does not have any positive impact on agriculture.২৩ আগস্ট, ২০১৭
What is the meaning of ecological globalization?
Ecological globalization refers to global environmental issues including: – population growth. – access to food. – worldwide reduction in biodiversity. – the gap between rich and poor.